You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

This script lives in /reg/g/psdm/tutorials/examplePython/evtNames.py and demonstrates how to print out the names of the high-rate detectors and lower-rate "EPICS variables" (like temperatures/voltages).  The high-rate detectors include both hutch-specific detectors and detectors that live outside the hutch ("Beam Line Data", or "BLD").  The printing of all epics names has been commented out because there are many of them.

from psana import *
ds = DataSource('exp=xpptut15:run=59:smd')
epics = ds.env().epicsStore()
for nevent,evt in enumerate(ds.events()):
    for key in evt.keys(): print key
    # print epics.names()
    print 'There are',len(evt.keys()),'detectors in this event and',len(epics.names()),'slower EPICS variables'
    print 'The first detector is named',evt.keys()[0],'and the first epics variable is named',epics.names()[0]
    break

These outputs include both the "full" names and simpler "aliases", for both the high-rate detectors and the EPICS variables.  We recommend using the simpler aliases when they are available. For example this line of output shows the full-name "XppGon.0:Cspad.0", and the simpler alias "cspad":

EventKey(type=psana.CsPad.DataV2, src='DetInfo(XppGon.0:Cspad.0)', alias='cspad')

Similarly, full EPICS names typically look something like "XPP:USR:MMN:04.RBV" while the aliases are simpler strings like "PhaseAverage".

  • No labels