Versions Compared

Key

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

...

Module ImgAlgos::ImgCalib

ImgCalib gets the input raw image, subtracts pedestals and normalized background, apply the gain factors and mask, and saves the corrected image in the event.

Functionality:

  • use the source and key_in parameters to get the input raw image (ndarray<double,2>),
  • get the calibration parameters from files fname_peds, fname_bkgd, fname_gain, and fname_mask, if their names are specified,
  • the specified by the file name corrections are applied per-pixel to raw data as follows:
    [[ A_cor = (A_raw - pedestal - N*background) * gain (apply) mask]],
  • corrected image is saved in the event with key key_out.

Details:

  • All files with input calibration parameters should have the same shape as image and formatted as regular text file containing 2d matrix (table) of float (or integer) values, with columns separated by space(s), ' ', and rows(lines) terminated by the '\n'.
  • Background normalization is performed in window defined by the parameters bkgd_row_min, bkgd_row_max, bkgd_col_min, and bkgd_col_max. Normalization factor [N] is evaluated for pixel amplitudes in this window as:
    [N = sum(A_raw - pedestal) / sum(A_bkgd)].
  • Masking algorithm assumes that good pixels in the fname_mask file should be marked by '1' (ones) and bad pixels – by '0' (zeros). Mask is applied as a last correction. The bad masked pixel amplitudes are substituted by the masked_value.

Module configuration parameters:

  • source (default: "DetInfo(:Camera)") – source of data,
  • key_in (default: "") – key for input image,
  • key_out (default: "calibrated") – output key for calibrated image saved in event,subtract_offset (default: true) – on/off the amplitude offset using configuration data
  • fname_peds (default: "") – input file name for pedestals
  • fname_bkgd (default: "") – input file name for background,
  • fname_gain (default: "") – input file name for gain,
  • fname_mask (default: "") – input file name for mask,
  • masked_value (default: 0) – amplitude value (in ADU) substituted for masked pixels,
  • bkgd_row_min (default: 0) – the window in image, which is used for background normalization,
  • bkgd_row_max (default: 10) – the window in image, which is used for background normalization,
  • bkgd_col_min (default: 0) – the window in image, which is used for background normalization,
  • bkgd_col_max (default: 10) – the window in image, which is used for background normalization,
  • print_bits (default: 0) – verbosity:
    • =0 - print nothing,
    • +1 - input pars,
    • +2 - time stamp for each event,
    • +4 - detailed info about input files for pedestals, mask, background, and gain.

...