Versions Compared

Key

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

...

Example of the output produced by this module:

Code Block
bgColor#F7F7ED
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
bgColor#F7F7ED
% psana -m EventKeys <input-files>

...

Example of the output produced by this module:

Code Block
bgColor#F7F7ED
[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
bgColor#F7F7ED
[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
bgColor#F7F7ED
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
bgColor#F7F7ED
[psana]
modules = cspad_mod.CsPadPedestals

[cspad_mod.CsPadPedestals]
source = DetInfo(CxiDs1.0:Cspad.0)
output = pedestals.dat
noise =

and then run psana:

Code Block
bgColor#F7F7ED
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
bgColor#F7F7ED
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
bgColor#F7F7ED
[psana]
modules = cspad_mod.CsPad2x2Pedestals

[cspad_mod.CsPad2x2Pedestals]
source = DetInfo(CxiSc1.0:Cspad2x2.0)
output = pedestals.dat
noise =

and then run psana:

Code Block
bgColor#F7F7ED
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.

...

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, mini-CSPad, 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 "mini-cspad-pix-spectra.txt.sha" outpuit file contains

Code Block
bgColor#F7F7ED
NPIXELS  143560
NBINS    100
AMIN     500
AMAX     1000
NEVENTS  2549
ARRFNAME mini-cspad-pix-spectra.txt

...

  1. If the first and/or last event numbers are defined, then the filter will select events in this range only.
  2. If the evtstring is defined, only listed events of event ranges will be selected. For example, the evtstring parameter can be defined as
    Code 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. The evtstring mode has higher priority than the 1st mode.
    The filterIsOn allows easy turn on/off this filter in *.cfg file.

...

  • ImgCalib uses the source and key_in parameters to get the input raw image (as ndarray<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, and fname_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 as double 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
bgColor#F7F7ED
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}}
} ;

...

  • <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++ module
    Code 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
bgColor#F7F7ED
 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
bgColor#F7F7ED
IntensityMonitorsData: Summary for parser
BATCH_RUN_NUMBER              0020
BATCH_NUMBER_OF_EVENTS        75

...

Note

Wiki Markup
The shape of the CSPad array in the file {{bkgd_fname}} is \[4*8*185\]\[388\] for all 2x1 sections.
The shape of the CSPad array in the event, specified by the {{source}} and {{inputKey}} or {{outputKey}},
is \[number_of_sections*188\]\[388\] depends on number of available in DAQ 2x1 sections, provided by the masks in CSPad configuration, for example:

Code Block
bgColor#F7F7ED
   shared_ptr<Psana::CsPad::ConfigV2> config2 = env.configStore().get(m_str_src);
   unsigned mask = config2->roiMask(quad_number); // should be in the range from 0 to 255

...