Versions Compared

Key

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

...

Wiki Markup
This module extends features of the previous {{ImgAlgos::CSPadArrNoise}} module for the case of peak finding.
It works on CSPad data array (shaped as \[5920=4*8*185\]\[388\]). It does as follows:

  • in the constructor and beginJob(...) method:
    • enters input parameters,
    • (re)set the initial mask of noisy pixels from file hot_pix_mask_file (if its name is specified in the configuration file),
    • do necessary initialization of work arrays.
  • in the event(...) method:
    • uses the "median algorithm" to evaluate the signal and noise for each pixel,
    • Wiki Markup
      fills \[4\]\[8\]\[185\]\[388\] per-pixel arrays:
      • m_stat - number of events with |S/N| > SoNThr,
      • m_signal - signal amplitude, or 0(zero) for masked pixels.,
      • m_proc_status - sets 255 for S/N > SoNThr or 0(zero) for masked pixels.

counts the fraction of events where S/N > SoNThr,

...

      • pixels.
    • use arrays m_proc_status and m_signal to find peaks:
      • Wiki Markup
        iterate over \[185\]\[388\] 2x1 pixels and find the connected regions (using recursive flood-filling algorithm)
      • create vector of peaks v_peaks of struct Peak, using peak_npix_min, peak_npix_max, and peak_amp_tot_thr parameters,
    • loop over v_peaks, count total amplitude and the number of peaks in the event.
    • decide if the event selected or not based on event_npeak_min, event_amp_tot_thr, and selection_mode parameters.


h3. Needs to be done:
* periodically dynamically re-generate the mask, based on m_stat array and frac_noisy_imgs parameter,
* save the final mask in file (???),
* put the vector with peaks v_peaks in the evt,
* put the signal array m_signal in the evt,
* save v_peaks and m_signal in file for selected events, depending on save_in_file parameter.

Module configuration parameters:

  • source (default: "DetInfo(:Cspad)") – input source of data
  • key (default: "") – key for input data, for example, it might be "calibrated"
  • statusfile fracfile (default: "cspad-pix-frac.dat") – out file with per-pixel fraction of noisy images
  • maskfile (default: "cspad-pix-mask.dat") – out file with pixel mask
  • rmin (default: 3) – radial parameter of the area for median algorithm
  • dr (default: 1) – radial band width of the area for median algorithm
  • SoNThr (default: 3) – S/N threshold for each pixel to be considered as noisy
  • frac_noisy_imgs (default: 0.1) – 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: 100.) – threshold on total signal amplitude of the group of connected pixels
  • event_npeak_min (default: 10) – threshold on number of good peaks for the event selection
  • event_amp_tot_thr(default: 1000.) – threshold on total signal amplitude of all good peaks for the event selection
  • selection_mode (default: SELECTION_ON) – selection mode, other allowed values are: SELECTION_OFF, or SELECTION_INV
  • save_in_file (default: false) – save or not the image array and peak vector in file
  • print_bits (default: 0) – module verbosity:
    • =0 - print nothing,
    • +1 - input pars,
    • +2 - empty,
    • +4 - processed statistics,
    • +8 - output in files,
    • +16 - empty,
    • +32 - event time stamp,
    • +64 - vector of indexes and map of indexes for the median algorithm,
    • +128- vector of found peaks.

...