Versions Compared

Key

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

...

Code Block
class Arguments:
  expt = 'ueddaq02'
  run = 66
  evtmax = 5
  detname = 'epixquad'

args = Arguments()

from psana.pyalgos.generic.NDArrUtils import info_ndarr
from psana import DataSource
ds = DataSource(exp=args.expt, run=args.run, dir=f'/cds/data/psdm/{args.expt[:3]}/{args.expt}/xtc')

for irun,run in enumerate(ds.runs()):
  print('\n==== %02d run: %d exp: %s detnames: %s' % (irun, run.runnum, run.expt, ','.join(run.detnames)))

  print('make %s detector object' % args.detname)
  det = run.Detector(args.detname)

  for istep,step in enumerate(run.steps()):
    print('\nStep %1d' % istep)

    for ievt,evt in enumerate(step.events()):
        if ievt>args.evtmax: exit('exit by number of events limit %d' % args.evtmax)

        print('%s\nEvent %04d' % (80*'_',ievt))
        segs = det.raw.segments(evt)
        raw = det.raw.raw(evt)

        print(info_ndarr(segs, 'segsments '))
        print(info_ndarr(raw, 'raw '))


Code Block
titleoutput of the above script
collapsetrue
==== 00 run: 66 exp: ueddaq02 detnames: timing,epixquad
make epixquad detector object

Step 0
________________________________________________________________________________
Event 0000
segsments shape:(4,) size:4 dtype:uint16 [0 1 2 3]
raw shape:(4, 352, 384) size:540672 dtype:uint16 [3304 3385 3401 3407 3291...]
________________________________________________________________________________
Event 0001
segsments shape:(4,) size:4 dtype:uint16 [0 1 2 3]
raw shape:(4, 352, 384) size:540672 dtype:uint16 [3278 3381 3385 3393 3298...]
________________________________________________________________________________
Event 0002
segsments shape:(4,) size:4 dtype:uint16 [0 1 2 3]
raw shape:(4, 352, 384) size:540672 dtype:uint16 [3317 3431 3431 5256 5790...]
________________________________________________________________________________
Event 0003
segsments shape:(4,) size:4 dtype:uint16 [0 1 2 3]
raw shape:(4, 352, 384) size:540672 dtype:uint16 [3325 3439 3426 3462 3361...]
________________________________________________________________________________
Event 0004
segsments shape:(4,) size:4 dtype:uint16 [0 1 2 3]
raw shape:(4, 352, 384) size:540672 dtype:uint16 [3328 3436 3434 3456 3348...]
________________________________________________________________________________
Event 0005
segsments shape:(4,) size:4 dtype:uint16 [0 1 2 3]
raw shape:(4, 352, 384) size:540672 dtype:uint16 [3335 3428 3426 3454 3347...]
exit by number of events limit 5


Methods of det.raw

Methods for AMI interface

...