Page History
...
Code Block |
---|
/reg/g/psdm/tutorials/common/data_access_methods/ |
Printing identifiers of all events
...
of a run
Try First try this:
Code Block |
---|
./print_event_id.py |
...
Code Block |
---|
./print_event_id.py
1: XtcEventId(run=366, time=2013-04-21 04:37:39.343773772-07, fiducials=38877, ticks=329342, vector=19553)
2: XtcEventId(run=366, time=2013-04-21 04:37:39.360457259-07, fiducials=38883, ticks=331442, vector=19554)
3: XtcEventId(run=366, time=2013-04-21 04:37:39.377123777-07, fiducials=38889, ticks=330560, vector=19555)
4: XtcEventId(run=366, time=2013-04-21 04:37:39.393797466-07, fiducials=38895, ticks=329762, vector=19556)
5: XtcEventId(run=366, time=2013-04-21 04:37:39.410477971-07, fiducials=38901, ticks=331204, vector=19557)
6: XtcEventId(run=366, time=2013-04-21 04:37:39.427145705-07, fiducials=38907, ticks=331036, vector=19558)
7: XtcEventId(run=366, time=2013-04-21 04:37:39.443816588-07, fiducials=38913, ticks=329370, vector=19559)
8: XtcEventId(run=366, time=2013-04-21 04:37:39.460499778-07, fiducials=38919, ticks=331414, vector=19560)
9: XtcEventId(run=366, time=2013-04-21 04:37:39.477167658-07, fiducials=38925, ticks=330616, vector=19561)
10: XtcEventId(run=366, time=2013-04-21 04:37:39.493840079-07, fiducials=38931, ticks=329720, vector=19562)
...
|
Printing a catalog of event components of an event
The sample can be run like this:
Code Block |
---|
./print_event_keys.py Components of the first event found in the dataset: EventKey(type=psana.EvrData.DataV3, src='DetInfo(NoDetector.0:Evr.0)') EventKey(type=psana.Acqiris.DataDescV1, src='DetInfo(SxrEndstation.0:Acqiris.0)') EventKey(type=psana.Acqiris.DataDescV1, src='DetInfo(SxrEndstation.0:Acqiris.1)') EventKey(type=psana.Bld.BldDataEBeamV3, src='BldInfo(EBeam)') EventKey(type=psana.Bld.BldDataPhaseCavity, src='BldInfo(PhaseCavity)') EventKey(type=psana.Bld.BldDataFEEGasDetEnergy, src='BldInfo(FEEGasDetEnergy)') EventKey(type=psana.Bld.BldDataGMDV1, src='BldInfo(GMD)') EventKey(type=psana.EventId) EventKey(type=None) |
Why it's so important to know this information? Because these parameters will tell you:
- what's inside the event
- and how to extract the corresponding data objects associated with these keys
The above shown output will translate into the following getters (similar to the one which is used in the very first example extracting event identifiers):
Code Block |
---|
obj = evt.get( psana.EvrData.DataV3, psana.Source('DetInfo(NoDetector.0:Evr.0)'))
obj = evt.get( psana.Acqiris.DataDescV1, psana.Source('DetInfo(SxrEndstation.0:Acqiris.0)'))
obj = evt.get( psana.Acqiris.DataDescV1, psana.Source('DetInfo(SxrEndstation.0:Acqiris.1)'))
obj = evt.get( psana.Bld.BldDataEBeamV3, psana.Source('BldInfo(EBeam)'))
obj = evt.get( psana.Bld.BldDataPhaseCavity, psana.Source('BldInfo(PhaseCavity)'))
obj = evt.get( psana.Bld.BldDataFEEGasDetEnergy, psana.Source('BldInfo(FEEGasDetEnergy)'))
obj = evt.get( psana.Bld.BldDataGMDV1, psana.Source('BldInfo(GMD)'))
obj = evt.get( psana.EventId)
|
Note that event components obtained through this API will be objects of various classes. A full catalog of those objects can be found in the Reference Manual which is auto-generated from the code of the OFFLINE releases.
4. Instrument-specific examples
...
Overview
Content Tools