Page History
...
Code Block |
---|
[ImgAlgos.ImgPeakFilter] source = DetInfo(:Opal1000) key = peaks threshold_peak = 5 threshold_total= 0 n_peaks_min = 10 print_bits = 11 fname = img selection_mode = SELECTION_ON |
Example for Module
...
ImgAlgos::
...
ImgSaveInFile
Code Block |
---|
modules = ... ImgAlgos.ImgSaveInFile:1 ...
[ImgAlgos.ImgSaveInFile:1]
source = DetInfo(:Opal1000) # or CxiDs1.0:Cspad.0
key |
Code Block |
[psana] files = /reg/d/psdm/<instrument>/<experiment>/xtc/<file-name-1>.xtc \ ... /reg/d/psdm/<instrument>/<experiment>/xtc/<file-name-N>.xtc events = img fname = 1000 experiment = cxii0212 calib-dir = anamy-cxii0212/calib modules = cspad_mod.CsPadCalib \ img #eventSave ImgAlgos.CSPadMaskApply \ = 5 saveAll = true |
See Module ImgAlgos::ImgSaveInFile
Example for Module ImgPeakFinder and ImgPeakFilter for CSPad
Module ImgAlgos::ImgPeakFinder
works on image. In order to apply this algorithm to CSPad the image should be produced. In next example the image is produced using consequtive modules cspad_mod.CsPadCalib
, ImgAlgos.CSPadMaskApply
, and CSPadPixCoords.CSPadImageProducer
:
Code Block |
---|
[psana] files = /reg/d/psdm/<instrument>/<experiment>/xtc/<file-name-1>.xtc CSPadPixCoords.CSPadImageProducer \ ImgAlgos.ImgPeakFinder \ ImgAlgos..ImgPeakFilter \. ImgAlgos.ImgSaveInFile:1 [cspad_mod.CsPadCalib] inputKey/reg/d/psdm/<instrument>/<experiment>/xtc/<file-name-N>.xtc events = 1000 outputKey experiment = calibratedcxii0212 doPedestalscalib-dir = yes doPixelStatus = no doCommonMode = yes [ImgAlgos.CSPadMaskApply] sourceana-cxii0212/calib modules = cspad_mod.CsPadCalib \ = DetInfo(CxiDs1.0:Cspad.0) inkeyImgAlgos.CSPadMaskApply \ CSPadPixCoords.CSPadImageProducer \ = calibrated outkey ImgAlgos.ImgPeakFinder \ = masked_arr mask_fname ImgAlgos.ImgPeakFilter \ = <your-local-directory>/<mask-file-name>.dat masked_amp ImgAlgos.ImgSaveInFile:1 [cspad_mod.CsPadCalib] inputKey = outputKey = 0 print_bits = calibrated doPedestals = yes doPixelStatus = 5 mask_control_bitsno doCommonMode = 15yes [CSPadPixCoordsImgAlgos.CSPadImageProducerCSPadMaskApply] calibDirsource = /reg/d/psdm/<instrument>/<experiment>/calib typeGroupName = CsPad::CalibV1 sourceDetInfo(CxiDs1.0:Cspad.0) inkey = CxiDs1.0:Cspad.0 keycalibrated outkey = masked_arr imgkeymask_fname = <your-local-directory>/<mask-file-name>.dat masked_amp = img0 print_bits = 0 #tiltIsApplied 5 mask_control_bits = true15 [ImgAlgosCSPadPixCoords.ImgPeakFinderCSPadImageProducer] source calibDir = DetInfo(= /reg/d/psdm/<instrument>/<experiment>/calib typeGroupName = CsPad::CalibV1 source = CxiDs1.0:Cspad.0) key = img peaksKeymasked_arr imgkey = peaksimg threshold_lowprint_bits = 2 threshold_high 0 #tiltIsApplied = 5 sigma true [ImgAlgos.ImgPeakFinder] source = 1.5 smear_radiusDetInfo(CxiDs1.0:Cspad.0) key = 5 peak_radius = 7 xmin = img peaksKey = peaks threshold_low = 2 threshold_high = 5 sigma = 1.5 smear_radius = 5 peak_radius = 7 xmin = 20 xmax = 1700 ymin = 20 ymax = 1700 #testEvent = 5 print_bits = 3 #finderIsOn = true [ImgAlgos.ImgPeakFilter] source = DetInfo(CxiDs1.0:Cspad.0) key = peaks threshold_peak = 5 threshold_total= 0 n_peaks_min = 10 print_bits = 11 fname = cspad-img selection_mode = SELECTION_ON [ImgAlgos.ImgSaveInFile:1] source = CxiDs1.0:Cspad.0 key = img fname = cspad-img #eventSave = 1 saveAll = true |
Example for Module ImgAlgos::CSPadArrAverage
...
Configuration file example for evaluation of pedestals:
Code Block |
---|
[psana] modules = ... ImgAlgos.ImgSaveInFile:1 ...ImgAlgos.CSPadArrAverage files = <path-to-the-dark-run-file>.xtc [ImgAlgos.ImgSaveInFile:1CSPadArrAverage] source = DetInfo(:Opal1000) # or CxiDs1.0:Cspad.0) key = avefile = cspad-pedestals-ave.dat rmsfile = cspad-pedestals-rms.dat print_bits = img15 fnameevts_stage1 = 100 evts_stage2 = my-img #eventSave = 5 saveAll = true |
See Module ImgAlgos::ImgSaveInFile
Example for Module ImgAlgos::CSPadArrAverage
...
= 100
gate_width1 = 100
gate_width2 = 10
|
Configuration file example for evaluation of pedestalsbackground:
Code Block |
---|
[psana] modulesfiles = ImgAlgos.CSPadArrAverage files = <path-to-the-darkbackground-run-file>.xtc [modules = cspad_mod.CsPadCalib ImgAlgos.CSPadArrAverage] source skip-events = DetInfo(CxiDs1.0:Cspad.0) key500 events = avefile = cspad-pedestals-ave.dat rmsfile = cspad-pedestals-rms.dat print_bits 1000000 [cspad_mod.CsPadCalib] inputKey = outputKey = 15calibrated evts_stage1doPedestals = 100 evts_stage2 = 100yes gate_width1doPixelStatus = 100 gate_width2no doCommonMode = 10 |
Configuration file example for evaluation of background:
Code Block |
---|
[psana] files no [ImgAlgos.CSPadArrAverage] source = DetInfo(CxiDs1.0:Cspad.0) key = <path-to-the-background-run-file>.xtc modules calibrated avefile = cspad_mod.CsPadCalib ImgAlgos.CSPadArrAverage skip-events = 500 events = 1000000 [cspad_mod.CsPadCalib] inputKey -background-ave.dat rmsfile = cspad-background-rms.dat print_bits = outputKey = calibrated doPedestals = 15 |
Images of the CSPad arrays for averaged and rms values, respectively, in one of the CXI runs:
Example for Module ImgAlgos::CSPadBkgdSubtract
See Module ImgAlgos::CSPadBkgdSubtract
Code Block |
---|
[psana] files = /reg/d/psdm/<instrument>/<experiment>/xtc/<file-name-1>.xtc \ yes doPixelStatus = no doCommonMode = no [ImgAlgos.CSPadArrAverage] source = DetInfo(CxiDs1.0:Cspad.0) key = calibrated avefile = cspad-background-ave.dat rmsfile = cspad-background-rms.dat print_bits = 15 |
Images of the CSPad arrays for averaged and rms values, respectively, in one of the CXI runs:
Example for Module ImgAlgos::CSPadBkgdSubtract
See Module ImgAlgos::CSPadBkgdSubtract
Code Block |
---|
[psana] files = /reg/d/psdm /reg/d/psdm/<instrument>/<experiment>/xtc/<file-name-1>2>.xtc \ ... /reg/d/psdm/<instrument>/<experiment>/xtc/<file-name-2>.xtc \ ... /reg/d/psdm/<instrument>/<experiment>/xtc/<file-name-N>.xtc N>.xtc skip-events = 500 events = 10 modules = cspad_mod.CsPadCalib ImgAlgos.CSPadBkgdSubtract [cspad_mod.CsPadCalib] inputKey = outputKey = calibrated doPedestals = yes doPixelStatus = no doCommonMode = no [ImgAlgos.CSPadBkgdSubtract] source = DetInfo(CxiDs1.0:Cspad.0) inputKey = calibrated outputKey = bkgd_subtracted bkgd_fname = <the-file-name-with-background-array> norm_sector = 0 print_bits = 3 |
...
Selected events
ev-007713:
ev-008944:
Example for
...
Module ImgAlgos::CSPadArrPeakAnalysis
See Module ImgAlgos::CSPadArrPeakAnalysis
Example of the psana configuration file:
Code Block |
---|
modules = cspad_mod.CsPadCalib \
|
This example demonstrates how to run psana with the time stamp filter and event writer in xtc file.
Both modules are available in psana library and they need only to be described in the configuration file. For example, the configuration file tstamp-filter-and-event-writer.cfg
may looks like:
Code Block |
---|
[psana] ImgAlgos.CSPadMaskApply \ ImgAlgos.CSPadArrPeakFinder \ ImgAlgos.CSPadArrPeakAnalysis # ...configuration parameters of other modules... [ImgAlgos.CSPadArrPeakAnalysis] source = DetInfo(CxiDs1.0:Cspad.0) key files = peaks print_bits = /reg/d/psdm/<INSTRUMENT>/<experiment>/xtc/e158-r0021-s00-c00.xtc \ = 7 fname_root = file.root |
After execution in psana the file.root
containing histogram(s) and ntuple(s) will be produced. Then, auxiliary script in root, running by the commend
root -q -f proc.C
produces the plots with histograms:
Example for TimeStampFilter and XtcOutputModule
This example demonstrates how to run psana with the time stamp filter and event writer in xtc file.
Both modules are available in psana library and they need only to be described in the configuration file. For example, the configuration file tstamp-filter-and-event-writer.cfg
may looks like:
Code Block |
---|
[psana] /reg/d/psdm/<INSTRUMENT>/<experiment>/xtc/e158-r0021-s01-c00.xtc \ /reg/d/psdm/ files = /reg/d/psdm/<INSTRUMENT>/<experiment>/xtc/e158-r0021-s02s00-c00.xtc \ /reg/d/psdm/<INSTRUMENT>/<experiment>/xtc/e158-r0021-s03s01-c00.xtc \ /reg/d/psdm/<INSTRUMENT>/<experiment>/xtc/e158-r0021-s04s02-c00.xtc \ /reg/d/psdm/<INSTRUMENT>/<experiment>/xtc/e158-r0021-s05s03-c00.xtc skip-events = 10 events \ = 100 modules = ImgAlgos.TimeStampFilter /reg/d/psdm/<INSTRUMENT>/<experiment>/xtc/e158-r0021-s04-c00.xtc \ /reg/d/psdm/<INSTRUMENT>/<experiment>/xtc/e158-r0021-s05-c00.xtc skip-events = 10 events = 100 modules = ImgAlgos.TimeStampFilter PSXtcOutput.XtcOutputModule [PSXtcOutput.XtcOutputModule] dirName = ./test_out [ImgAlgos.TimeStampFilter] tsinterval = 2012-02-02 18:17:00.409143728 / 2012-02-02 18:17:00.525853474 filterIsOn = true print_bits = 11 |
...
See also: Module ImgAlgos::TimeStampFilter and PSXtcOutput::PSXtcOutput
Example for Module ImgAlgos::CSPadArrPeakAnalysis
See Module ImgAlgos::CSPadArrPeakAnalysis
Example of the psana configuration file:
Code Block |
---|
modules = cspad_mod.CsPadCalib \
ImgAlgos.CSPadMaskApply \
ImgAlgos.CSPadArrPeakFinder \
ImgAlgos.CSPadArrPeakAnalysis
# ...configuration parameters of other modules...
[ImgAlgos.CSPadArrPeakAnalysis]
source = DetInfo(CxiDs1.0:Cspad.0)
key = peaks
print_bits = 7
fname_root = file.root
|
After execution in psana the file.root
containing histogram(s) and ntuple(s) will be produced. Then, auxiliary script in root, running by the commend
root -q -f proc.C
produces the plots with histograms: