Versions Compared

Key

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

...

  • gets CSPAD configuration from the environment frame Psana::CsPad::ConfigV#,
  • gets CSPAD data from the event frames Psana::CsPad::DataV#, Psana::CsPad::ElementV#,
  • creates the image data array as ndarray<T,3>, where T stands for outtype, which may be double, float, int, or uint16_t,
  • puts the image data array in the event with outkey tag.

The data array{{ndarray<T,3>}} has a shape (N,185,388), where N?32.
This array is combined from data arrays for quads, ndarray<int32_t,3> with shape (M,185,388), where M?32, taking into account the CSPAD configuration.

Note

In real data some 2x1 may be turned off, that can be seen in configuration object.

Module configuration parameters:

...

  • 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
    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.

...

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}}
} ;

...

  • <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
    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
    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
    

...

Code Block
IntensityMonitorsData: Summary for parser 
BATCH_RUN_NUMBER              0020
BATCH_NUMBER_OF_EVENTS        75

...

  • source (default: "DetInfo(:Cspad)") – input source of data
  • key (default: "") – key for input data, for example, it might be "calibrated"
  • key_signal_out (default: "") – key for output signal array. If the string non-empty, the array is added in the datagram for each event (before selection).
  • key_peaks_out (default: "peaks") – key for vector of found peaks in the selected event
  • hot_pix_mask_inp_file (default: "cspad-pix-mask-in.dat") – in read the pixel mask from file
  • hot_pix_mask_out_file (default: "cspad-pix-mask-out.dat") – out write current pixel mask in the file
  • frac_noisy_evts_file (default: "cspad-pix-frac-out.dat") – out file with per-pixel fraction of noisy images
  • evt_file_out (default: "./cspad-ev-") – out file with signal CSPad array. Time stamp is added.
  • rmin (default: 3) – radial parameter of the area for median algorithm
  • dr (default: 1) – radial band width of the area for median algorithm
  • SoNThr_noise (default: 3) – S/N threshold for each pixel to be considered as noisy
  • SoNThr_signal (default: 5) – S/N threshold for each pixel to be considered as noisy
  • frac_noisy_imgs (default: 0.9) – fraction of noisy images above which pixel will be masked
  • peak_npix_min (default: 4) – minimal number of connected pixels for the good peak
  • peak_npix_max (default: 25) – maximal number of connected pixels for the good peak
  • peak_amp_tot_thr (default: 0.) – threshold on total signal amplitude of the group of connected pixels, if =0:OFF
  • peak_SoN_thr (default: 7.) – threshold on peak S/N (S and N are sums over connected pixels)
  • event_npeak_min (default: 10) – threshold on minimal number of good peaks for the event selection
  • event_npeak_max (default: 10000) – threshold on maximal number of good peaks for the event selection
  • event_amp_tot_thr(default: 0.) – threshold on total signal amplitude in ADU of all good peaks for the event selection, if =0:OFF
  • nevents_mask_update (default: 0) – number of skipped events before each mask re-evaluation cycle
  • nevents_mask_accum (default: 50) – number of events for the mask re-evaluation
  • selection_mode (default: SELECTION_ON) – selection mode, other allowed values are: SELECTION_OFF, or SELECTION_INV
  • out_file_bits (default: 0) – control on writting of files:
    • =0 - save nothing,
    • +1 - save the hot_pix_mask_out_file file with current mask array in the endJob(...) method.
    • +2 - save the frac_noisy_evts_file file with current fraction of noisy events array in the endJob(...) method.
    • +4 - save the CSPad signal array for selected events in the file with name like <evt_file_out>-<counter>-<run>-<time stamp>.txt.
    • +8 - save the vector of found peaks in file <evt_file_out>-<counter>-<run>-<time-stamp>-peaks.txt.
  • print_bits (default: 0) – module verbosity:
    • =0 - summary at the endJob,
    • +1 - input pars (once in beginJob),
    • +2 - initial and current mask statistics (in constructor and when mask is updated),
    • +4 - event selection parameters (for each event); event no., time-stamp, mode, number of peaks, and amp_tot.
    • +8 - output in files (for selected events),
    • +16 - start/stop to collect data for mask re-evaluation (driven by the mode counters),
    • +32 - event time stamp (for each event),
    • +64 - vector of indexes and map of indexes for the median algorithm (once in beginJob),
    • +128 - peak parameters before selection (for each event),
    • +256 - peak parameters saved in file (for selected events),
    • +512 - selection statistics (N<5: for each event; N<50: for each 10-th; N<500: for each 100-th, then for each 1000-th),
    • +1024 - event time stamp (for selected events),
    • +2048 - peak finding from connected pixels; this is printed for connected region of signal pixels if npix>peak_npix_min-2 (otherwise too much junk output).

...