Page History
...
Code Block |
---|
(ps-4.5.5) monarin@psanagpu111 (master *) psana2 $ python test_jump.py 0 4194783241933859761 (1024, 1024) 1 4194783249723600225 (1024, 1024) 2 4194783254218190609 (1024, 1024) 3 4194783258712780993 (1024, 1024) |
Running with Integrating Detector
Here's a sample python script, how you can analyze a run with an integrating detector (in this example, it's 'andor'). For more detail about the technical design, visit this page.
Code Block | ||||
---|---|---|---|---|
| ||||
# This `batch_size` should be set to a small number (e.g. 1)
# since all other events which are part of this intg. event will ben sent
# in the same batch.
batch_size = 1
from psana import DataSource
ds = DataSource(exp='xpptut15', run=1, dir='/cds/data/psdm/prj/public01/xtc',
intg_det='andor',
batch_size=batch_size)
run = next(ds.runs())
hsd = run.Detector('hsd')
andor = run.Detector('andor')
# Test calculating sum of the hsd for each integrating event.
sum_hsd = 0
for i_evt, evt in enumerate(run.events()):
hsd_calib = hsd.raw.calib(evt)
andor_calib = andor.raw.calib(evt)
# Keep summing the value of the other detector (hsd in this case)
sum_hsd += np.sum(hsd_calib[:])/np.prod(hsd_calib.shape)
# When an integrating event is found, print out and reset the sum variable
if andor_calib is not None:
val_andor = np.sum(andor_calib[:])/np.prod(andor_calib.shape)
print(f'i_evt: {i_evt} andor: {val_andor} sum_hsd:{sum_hsd}')
sum_hsd = 0 |
MPI Task Structure To Support Scaling
...
Overview
Content Tools