This script lives in /sdf/group/lcls/ds/ana/tutorials/psana1_examples/dataAccess.py and demonstrates how to specify an experiment/run number and iterate over events.

from psana import *
ds = MPIDataSource('exp=xpptut15:run=54:smd')
nevent = 0
for evt in ds.events():
    nevent+=1
    if nevent==3: 
        break
print(f'Processed {nevent} events.')
  • No labels