Page History
...
The psana_test package includes the psana module dump, some Python library code for testing, and a command line tool for providing a line oriented dump of xtc files. The psana_test package is primarily for psana developers to do software testing, however the dump module and xtclinedump can be generally useful to users.
module dump
The dump module . This will take a standard psana datasource and dump all the event, config, and epics data found. The entire contents of large arrays are not printed. However a checksum over all the array data is, as well as the min, 25th percentile, median, 75th percentile, and max over the data. The dump module does not serve as a good example of how to retrieve and work with objects from the event store – see the psana_examples package for this. The psana_test package is primarily for psana developers to do software testing.
...
Running psana_test dump
An example of running the module is
...
Code Block | ||
---|---|---|
| ||
from psana_test import obj2str, epicsPvToStr def getPsanaState(event, configStore, epicsStore): evtDict = {} cfgDict = {} epicsDict = {} for key in event.keys(): if key.type() is None: continue obj = event.get(key.type(), key.src(), key.key()) if (obj is None): continue if not hasattr(obj,'TypeId'): continue evtDict[str(key)]=obj2str(obj) for key in configStore.keys(): if key.type() is None: continue obj = configStore.get(key.type(), key.src()) if (obj is None): continue if not hasattr(obj,'TypeId'): continue cfgDict[str(key)]=obj2str(obj) for pvName in epicsStore.pvNames(): pv = epicsStore.getPV(pvName) if not pv: continue epicsDict[pvName] = epicsPvToStr(pv) return evtDict, cfgDict, epicsDict |
xtclinedump
xtclinedump is a command line tool to dump xtc and datagram header information in a line oriented style. By keeping the output for each header to one line, it makes it easy to use grep to filter the output. The command can be run by
Code Block |
---|
xtclinedump dg xtcfile.xtc
or
xtclinedump xtc xtcfile.xtc |
The first just dumps datagram headers, the latter dumps xtc headers. There are some additional options, how much of the xtc payloads to print, and if you want parsed output for epics. A help string is available by typing xtclinedump with no arguments. Except for the non-default epics argument, xtclinedump does no parsing of the xtc payloads, it simply prints the first few bytes in hex. For reading through payloads, the intel architechture uses little endian, so 0x00040000 = 1024,
Package TimeTool
An example of how to use the TimeTool can be found Here.
...