Page History
...
Note that LCLS-II psana is not compatible with LCLS-I psana, so environments must activate one or the other, but not both.
Example Script
Detector Names
Use this command to see non-epics detector names that can be used with the Detector interface (see example below):
Code Block |
---|
(ps-4.1.0) psanagpu101:lcls2$ detnames exp=tmoc00118,run=123
---------------------
Name | Data Type
---------------------
epicsinfo | epicsinfo
timing | raw
hsd | raw
gmdstr0 | raw
etc. |
Use this command to see epics detector names names that can be used with the Detector interface (see example below):
Code Block |
---|
(ps-4.1.0) psanagpu101:lcls2$ detnames -e exp=tmoc00118,run=123
---------------------------
Name | Data Type
---------------------------
StaleFlags | raw
Keithley_Sum | raw
IM2K4_XrayPower | raw
IM3K4_XrayPower | raw
etc. |
Using the Detector Interface
Example Script Producing Small HDF5 File
You If you have xtc files (with associated smd files) you can run this script with MPI: PS_SRV_NODES=2; mpirun -n 6 python example.py
...
Code Block | ||
---|---|---|
| ||
from psana import DataSource import numpy as np # called back on each SRV node, for every smd.event() call below def test_callback(data_dict): print(data_dict) ds = DataSource(exp='xpptut13tmoc00118', run=1, dir='.tmp'123) # batch_size here specifies how often the dictionary of information # is sent to the SRV nodes smd = ds.smalldata(filename='my.h5', batch_size=5, callbacks=[test_callback]) run = next(ds.runs()) # necessary (instead of "None") since some ranks may not receive events # and the smd.sum() below could fail arrsum = np.zeros((2), dtype=np.int) for i,evt in enumerate(run.events()): myones = np.ones_like(arrsum) smd.event(evt, myfloat=2.0, arrint=myones) arrsum += myones if smd.summary: smd.sum(arrsum) smd.save_summary({'summary_array' : arrsum}, summary_int=1) smd.done() |
...
Overview
Content Tools