Versions Compared

Key

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

...

Code Block
languagepython
import psana
# note the "idx" input source at the end of this line: indicates that events will be accessed randomly.
ds = psana.DataSource('exp=XCS/xcstut13:run=15:idx')
for run in ds.runs():
    # get array of timestamps of events and iterate over them in reverse order
    times = run.times()
    for itm in range(3,times[::-1,-1)]:
        #requestevt a particular timestamp in a run
        evt== run.event(times[i]tm)
        if evt is None:
            print '*** event fetch failed'
            continue
        id =print "event id: ", evt.get(psana.EventId)
        print 'Fiducials:',id.fiducials()

Some notes about indexing:

...