Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Using the Detector Interface

Standard (per-shot) detectors and the slower epics variables can be accessed as shown here using the names discovered with the commands above.  You can use tab-completion in ipython or the jupyternotebook to explore what you can do with the various detector objects:

Code Block
languagepy
from psana import DataSource
ds = DataSource(exp='tmoc00118',run=123)
myrun = next(ds.runs())
opal = myrun.Detector('tmoopal')
epics_det = myrun.Detector('IM2K4_XrayPower')
for evt in myrun.events():
    img = opal.raw.image(evt)
    epics_val = epics_det(evt)
	# check for missing data
    if img is None or epics_val is None:
        print('none')
        continue
    print(img.shape,epics_val)


Example Script Producing Small HDF5 File

You can run this script with MPI: PS_SRV_NODES=2; mpirun -n 6 python example.py

...