Versions Compared

Key

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

...

  • Command to run psana is:
  • psana -c ./tstamp-filter-and-event-writer.cfg
  • For this configuration file psana will skip 10 events and loop over the next 100 events from the /reg/d/psdm/<INSTRUMENT>/<experiment>/xtc/e158-r0021-s0*-c00.xtc files and run consecutively modules = ImgAlgos.TimeStampFilter PSXtcOutput.XtcOutputModule. Parameters of these modules are described in the bottom part of the configuration file. Module TimeStampFilter passes events from the specified time interval and prints some useful information. Module XtcOutputModule will write passed events in the file with auto-generated name ./test_out/e158-r0021.xtcf.
  • See also: Module ImgAlgos::TimeStampFilter and PSXtcOutput::PSXtcOutput
  • Examples for Package

    py_img_algos

    pyimgalgos

  • Package py_img_algos pyimgalgos contains python modules which work with both frameworks pyana and psana.
  • Configuration file for pyana and/or psana should have relevant sections with parameters for [pyana] and/or [psana]. Alean section is ignored in each framework at run time. This is the only difference between two frameworks in the configuration file. All module descriptions are the same for two frameworks, as shown in examples below.
  • See description of modules in Package py_img_algospyimgalgos.
  • Example of configuration file for CSPAD

  • File py-xcs72913-r0049-cspad.cfg:
Code Block
bgColor#AAFFFF
# Run this script:
# psana -c py-xcs72913-r0049-cspad.cfg
# pyana -c py-xcs72913-r0049-cspad.cfg
#
# Useful commands:
# psana -m EventKeys -n 5 /reg/d/psdm/xcs/xcs72913/xtc/e265-r0049-*
# psana -m psana_examples.dump_cspad -n 5 exp=xcs72913:run=49
# pyana -m pyana_examples.dump_cspad -n 5 /reg/d/psdm/xcs/xcs72913/xtc/e265-r0049-*

[pyana]
files  = /reg/d/psdm/xcs/xcs72913/xtc/e265-r0049-s00-c00.xtc /reg/d/psdm/xcs/xcs72913/xtc/e265-r0049-s04-c00.xtc /reg/d/psdm/xcs/xcs72913/xtc/e265-r0049-s05-c00.xtc
num-events = 5
#skip-events = 0
#num-cpu = 1
verbose = 1 ; logging output: 0-nothing?, 1+INFO, 2+DEBUG, ...
modules = py_img_algospyimgalgos.tahometer py_img_algospyimgalgos.cspad_arr_producer py_img_algospyimgalgos.cspad_image_producer py_img_algospyimgalgos.image_save_in_file


[psana]
files = exp=xcs72913:run=49
events = 5                 
#skip-events = 0
modules = py_img_algospyimgalgos.tahometer py_img_algospyimgalgos.cspad_arr_producer py_img_algospyimgalgos.cspad_image_producer py_img_algospyimgalgos.image_save_in_file
verbose = 1 


[py_img_algospyimgalgos.tahometer]
dn         = 10
print_bits = 255


[py_img_algospyimgalgos.cspad_arr_producer]
#source    = -|Cspad-*
source     = XcsEndstation-0|Cspad-0 
data_type  = double
#data_type  = float
#data_type  = unsigned
#data_type  = uint16
val_miss   = 0
key_out    = cspad_array
print_bits = 1


[py_img_algospyimgalgos.cspad_image_producer]
calib_dir  = /reg/d/psdm/xcs/xcs72913/calib/CsPad::CalibV1/XcsEndstation.0:Cspad.0/
key_in     = cspad_array
key_out    = cspad_image
print_bits = 1

# Supported output file formats tiff, gif, png, eps, jpg, jpeg, txt, npy(default), npz
[py_img_algospyimgalgos.image_save_in_file]
key_in     = cspad_image
ofname     = img-for-cspad.txt
print_bits = 255

...

Code Block
bgColor#AAFFFF
# Run this script:
# psana -c py-meca6113-r0028-cspad2x2.cfg
# pyana -c py-meca6113-r0028-cspad2x2.cfg
#
# Useful commands:
# psana -m EventKeys -n 5 /reg/d/psdm/mec/meca6113/xtc/e332-r0028-s03-c00.xtc
# psana -m psana_examples.dump_cspad -n 5 exp=meca6113:run=28
# pyana -m pyana_examples.dump_cspad -n 5 /reg/d/psdm/mec/meca6113/xtc/e332-r0028-s03-c00.xtc

[pyana]
files  = /reg/d/psdm/mec/meca6113/xtc/e332-r0028-s03-c00.xtc
num-events = 5
#skip-events = 0
#num-cpu = 1
verbose = 0 ; logging output: 0-nothing?, 1+INFO, 2+DEBUG, ...
modules = py_img_algospyimgalgos.tahometer py_img_algospyimgalgos.cspad_arr_producer py_img_algospyimgalgos.cspad_image_producer py_img_algospyimgalgos.image_save_in_file


[psana]
files = exp=meca6113:run=28
events = 5 
#skip-events = 0
modules = py_img_algospyimgalgos.tahometer py_img_algospyimgalgos.cspad_arr_producer py_img_algospyimgalgos.cspad_image_producer py_img_algospyimgalgos.image_save_in_file


[py_img_algospyimgalgos.tahometer]
dn         = 10
print_bits = 255


[py_img_algospyimgalgos.cspad_arr_producer]
#source    = -|Cspad-*
source     = MecTargetChamber-0|Cspad2x2-3
#data_type  = double
data_type  = float
#data_type  = unsigned
#data_type  = uint16
#data_type  = uint32
val_miss   = 0
key_out    = cspad2x2_array
print_bits = 255


[py_img_algospyimgalgos.cspad_image_producer]
calib_dir  = /reg/d/psdm/mec/meca6113/calib/CsPad2x2::CalibV1/MecTargetChamber.0:Cspad2x2.3/
key_in     = cspad2x2_array
key_out    = cspad2x2_image
print_bits = 1

# Supported output file formats tiff, gif, png, eps, jpg, jpeg, txt, npy(default), npz
[py_img_algospyimgalgos.image_save_in_file]
key_in     = cspad2x2_image
ofname     = img-for-cspad2x2.tiff 
print_bits = 255

...