Page History
Include Page | ||||
---|---|---|---|---|
|
Table of Contents |
---|
Include Page | ||||
---|---|---|---|---|
|
About
This page provides a list of existing modules for psana framework. Only the modules that are included in the standard analysis releases appear on this page.
...
Example of the output produced by this module:
Code Block | ||
---|---|---|
| ||
Event keys:
EventKey(type=Psana::EvrData::DataV3, src=DetInfo(NoDetector.0:Evr.0))
EventKey(type=Psana::Camera::FrameV1, src=DetInfo(CxiDg1.0:Tm6740.0))
EventKey(type=Psana::Ipimb::DataV1, src=DetInfo(CxiDg1.0:Ipimb.0))
...
|
This module is useful to display the content of the events without dumping all the data. Example command which uses this module is:
Code Block | ||
---|---|---|
| ||
% psana -m EventKeys <input-files>
|
...
Example of the output produced by this module:
Code Block | ||
---|---|---|
| ||
[info:psana.PrintEventId] event ID: XtcEventId(run=100, time=2010-12-12 11:09:36.300506429-08)
[info:psana.PrintEventId] event ID: XtcEventId(run=100, time=2010-12-12 11:09:36.317163082-08)
|
...
Example of the output produced by this module with the default parameters (including output from PrintEventId module):
Code Block | ||
---|---|---|
| ||
[info:/root/] ================================================================================
[info:psana.PrintEventId] event ID: XtcEventId(run=100, time=2010-12-12 11:09:36.300506429-08)
[info:/root/] ================================================================================
[info:psana.PrintEventId] event ID: XtcEventId(run=100, time=2010-12-12 11:09:36.317163082-08)
|
...
To use this module with default parameters one could use this command:
Code Block | ||
---|---|---|
| ||
psana -m cspad_mod.CsPadPedestals input-files.xtc
|
...
To change module parameters one could create file with name psana.cfg
in the current directory with a contents like this:
Code Block | ||
---|---|---|
| ||
[psana]
modules = cspad_mod.CsPadPedestals
[cspad_mod.CsPadPedestals]
source = DetInfo(CxiDs1.0:Cspad.0)
output = pedestals.dat
noise =
|
and then run psana:
Code Block | ||
---|---|---|
| ||
psana input-files.xtc
|
This should produce file pedestals.dat
in the current directory. As the source address is more specific this configuration file can be used even if input data contain more than one CsPad device.
...
To use this module with default parameters one could use this command:
Code Block | ||
---|---|---|
| ||
psana -m cspad_mod.CsPad2x2Pedestals input-files.xtc
|
...
To change module parameters one could create file with name psana.cfg
in the current directory with a contents like this:
Code Block | ||
---|---|---|
| ||
[psana]
modules = cspad_mod.CsPad2x2Pedestals
[cspad_mod.CsPad2x2Pedestals]
source = DetInfo(CxiSc1.0:Cspad2x2.0)
output = pedestals.dat
noise =
|
and then run psana:
Code Block | ||
---|---|---|
| ||
psana input-files.xtc
|
This should produce file pedestals.dat
in the current directory. As the source address is more specific this configuration file can be used even if input data contain more than one CsPad2x2 device.
...
parameter | default value | description |
---|---|---|
|
| directory with calibration files, by default it is set to .../<experiment>/calib |
| "CsPad::CalibV1" | calibration type and group names |
| "CxiDs1.0:Cspad.0" | source of data |
|
| key for data processing stage |
| "image" | output key for image saved in event |
| true | on/off for tilt angle of 2x1-sections and quads. |
| 0 | verbosity:
|
...
Package ImgPixSpectra is intended to accumulate the spectra for all pixels of the image array.
Different modules of this package work with different data types for detectors like CSPad, CSPad2x2, Opal, Princeton camera, etc. All modules have the same interface and the same functionality.
In the loop over events from beginJob
to endJob
the image pixel amplitudes are accumulated in the 2-d array,
of the shape (<number-of-pixels>, <number-of-spectral-bins>). The first parameter is defined by the image size. The second is passed as an external parameter of the psana configuration file (psana.cfg
) along with minimal and maximal amplitudes. At the endJob
the spectral array is saved in file with specified name. Auxiliary file with the name extension *.sha
is created in order to save the shape parameters. For example, the "cspad2x2-pix-spectra.txt.sha" outpuit file contains
Code Block | ||
---|---|---|
| ||
NPIXELS 143560
NBINS 100
AMIN 500
AMAX 1000
NEVENTS 2549
ARRFNAME cspad2x2-pix-spectra.txt
|
...
- If the
first
and/orlast
event numbers are defined, then the filter will select events in this range only. If the
evtstring
is defined, only listed events of event ranges will be selected. For example, theevtstring
parameter can be defined asCode Block bgColor #F7F7ED 2,5,11-15,20-25,29,30
that means the list of events:
Code Block bgColor #F7F7ED 2 5 11 12 13 14 15 20 21 22 23 24 25 29 30
In the
evtstring
parameter the comma "," and sign minus "-" as a dash are the only allowed separators. Blank spaces are also allowed. Other characters may abort the program. Theevtstring
mode has higher priority than the 1st mode.
ThefilterIsOn
allows easy turn on/off this filter in*.cfg
file.
Module ImgAlgos::PnccdImageProducer
...
- Gets acqiris configuration and data from
Acqiris::ConfigV1
andAcqiris::DataDescV1
, etc. objects usingsource
andkey_in
; - produces
ndarray<dtypendarray<double,2>
object ofshape[] = {nbrChannels, nbrSamples}
for waveforms and times; - save configuration data in file defined by
fname_prefix
; - save waveforms in the event store with keys
key_wform
andkey_wform
.
parameter | default value | description |
---|---|---|
| "DetInfo(:Acqiris)" | source of data |
| "" (empty) | key for input data (raw - by default) |
| "acq_wform" | output key for wave forms saved in event |
| "acqirisacq_wform" | output key for array saved in event |
| "" | file name prefix for configuration parameters |
| 0 | verbosity:
|
...
- ImgCalib uses the
source
andkey_in
parameters to get the input raw image (asndarray<T,2>
object), where T stands for uint16_t, int, float, uint8_t, or double, - gets the calibration parameters from files
fname_peds
,fname_bkgd
,fname_gain
,fname_mask
, andfname_nrms
, if their names are specified, the specified by the file name corrections are applied per-pixel to raw data image as follows:
Code Block bgColor #F7F7ED A_cor = A_raw (1) - pedestal | if the file name is specified in the parameter "fname_peds" (2) - N*background | if the file name is specified in the parameter "fname_bkgd" (3) * gain | if the file name is specified in the parameter "fname_gain" (4) apply mask | if the file name is specified in the parameter "fname_mask" (5) apply N*RMS threshold | if the file name is specified in the parameter "fname_nrms" (6) apply threshold | if the "do_threshold" = true
- corrected image is saved in the event with key
key_out
asdouble
type.
...
This algorithm was motivated by users of amo42112:
1. Select the pixels in the window xmin
, xmax
, ymin
, ymax
with amplitudes above the threshold_low
.
2. Smear image for selected pixels, using 2-d matrix of weights over pixels
from -smear_radius
to +smear_radius
around each smeared pixel amplitude.
The matrix of weights is defined by the 2-d Gaussian function of width sigma
.
3. Find peaks as pixels with absolute-maximal amplitude above the threshold_high
in the center of the matrix -peak_radius
to +peak_radius
.
4. Put the vector of found peaks in the event with key peaksKey
. Each entry of this vector has an object of the struct Peak
, containing x, y positions, peak pixel amplitude, the total amplitude in the matrix, defined by the peak_radius
, and the number of pixels in the matrix above threshold_low
:
Code Block | ||
---|---|---|
| ||
struct Peak{
double x;
double y;
double ampmax; // amplitude in the peak maximum
double amptot; // total amplitude in the range of {{peak_radius}}
unsigned npix; // number of pixels in the range of {{peak_radius}}
} ;
|
...
This module finds peaks in the ndarray<double,2>
image object. Algorithm and the list of parameters are the same as described is section Psana Module ImgAlgos::CSPadArrPeakFinderCatalog. The only difference is that the image size is defined by the ndarray<double,2>
object.
...
- ImgHitFinder uses the
source
andkey_in
parameters to get the input raw image (asndarray<T,2>
object), where T stands for uint16_t, int, float, uint8_t, or double, - gets the calibration parameters from files
fname_peds
,fname_gain
,fname_mask
, andfname_thre
, if their names are specified, the specified by the file name corrections are applied per-pixel to raw data image as follows:
Code Block bgColor #F7F7ED A_cor = A_raw (1) - pedestal | if the file name is specified in the parameter "fname_peds" (2) * gain | if the file name is specified in the parameter "fname_gain" (3) apply mask | if the file name is specified in the parameter "fname_mask" (4) apply threshold | if the file name is specified in the parameter "fname_thre"
- corrected image is saved in the event with key
key_out
asdouble
(or unsigned for pixel map) type.
...
<fname_prefix>-<fname-common>-b<block-number>.<file_type>
<fname_prefix>-<fname-common>-med.txt
<fname_prefix>-<fname-common>-time.txt
is implemented in stand-alone c++ moduleCode Block bgColor #F7F7ED ImgAlgos/app/corana.cpp (or ImgAlgos/test/corana.cpp)
Note Note, the application in the
test
directory is compiled and run by the commands:
scons test
<path>/corana -f <fname_data>
-t <fname_tau>\
-h
-l <logfile>\
-b <basedir>\
where
<fname_data>
is one of the data files:<fname_prefix>-<fname-common>-b<block-number>.<file_type>
, which needs to be available;<fname_tau>
is a file with a list of indexes of tau for evaluation of correlations. By default or if the file is missing, the list of indexes will be generated automatically, and for book-keeping is saved in the file<fname_prefix>-<fname-common>-tau.txt
;<basedir>
is a directory for all data files, which is current by default;<logfile>
is an output log-file, or standard output by default.
...
- saves counter number and the time records in file
fname
. print summary parameters for parser, for example:
Code Block bgColor #F7F7ED ImgTimeStampList: Summary for parser BATCH_RUN_NUMBER 0020 BATCH_NUMBER_OF_EVENTS 75 BATCH_FRAME_TIME_INTERVAL_AVE 8.086934 BATCH_FRAME_TIME_INTERVAL_RMS 0.120381 BATCH_FRAME_TIME_INDEX_MAX 74
...
fname_imon_cfg
file content per line: source name, short name, on/off bits for 4-channels, normalization and selection, minimal, maximal and averaged intensities:
Code Block | ||
---|---|---|
| ||
BldInfo(FEEGasDetEnergy) FEEGasDetEnergy 1 1 1 1 0 1 3.000000 7.500000 5.250000
BldInfo(XCS-IPM-02) XCS-IPM-02 1 1 1 0 1 0 10.000000 13.000000 11.500000
BldInfo(XCS-IPM-mono) XCS-IPM-mono 1 1 1 0 0 1 14.500000 16.000000 15.250000
DetInfo(XcsBeamline.1:Ipimb.4) Ipimb.4 1 1 1 1 0 0 -1.000000 -1.000000 1.000000
DetInfo(XcsBeamline.1:Ipimb.5) Ipimb.5 1 1 1 1 0 0 -1.000000 -1.000000 1.000000
|
...
This module is intended for CorAna
project.
It gets the 5 intensity monitors data (4 channels for each) and saves them in the text or binary file file_data
. Comments (or header) for this file is saved separately in file_header
. It also prints the summary parameters for parser, for example:
Code Block | ||
---|---|---|
| ||
IntensityMonitorsData: Summary for parser
BATCH_RUN_NUMBER 0020
BATCH_NUMBER_OF_EVENTS 75
|
...
Note | |||||
---|---|---|---|---|---|
The shape of the CSPad array in the file
|
...
Is intended to print records showing job performance current and integrated from the beginning of job:
Code Block | ||
---|---|---|
| ||
py_img_algos.tahometer: run:0049 evt:000005 t[sec]: 2.575 dt[sec]: 2.575 n/t[1/sec]: 1.942 dn/dt[1/sec]: 1.942
|
...