Versions Compared

Key

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

...

  1. subtracts pedestals,
  2. subtracts normalized background,
  3. applys apply gain factors,
  4. applys apply mask, andapplys
  5. apply threshold as a constant low level,
  6. apply threshold as N*RMS,
    and saves the corrected image in the event.

...

  • ImgCalib uses the source and key_in parameters to get the input raw image (as ndarray<double,2> object),
  • gets 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 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 threshold   | if the "do_threshold" value is specified in the parameter "threshold"= true
    
  • corrected image is saved in the event with key key_out. The type of output data is the same as the type of input data.

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.

...

  • 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,
  • fname_peds (default: "") – input file name for pedestals, applied if the file name is specified,
  • fname_bkgd (default: "") – input file name for background, applied if the file name is specified,
  • fname_gain (default: "") – input file name for gain, applied if the file name is specified,
  • fname_mask (default: "") – input file name for mask, applied if the file name is specified,
  • fname_nrms (default: "") – input file name for RMS, applied if the file name is specified,
  • masked_value (default: 0.) – amplitude value (in ADU) substituted for masked pixels,
  • threshold_nrms (default: -1234563.) – threshold as a number of sigmas from file fname_nrms,
  • threshold (default: 0.) – constant low level threshold in ADU; if the default value is not changed - threshold is not applied,
  • below_thre_value (default: 0.) – the amplitude substituted in pixels below threshold,
  • do_threshold (default:false) – if true - low level threshold in ADU is applied,
  • 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.

The pedestal, background, gain, mask, and N*RMS corrections are applied if associated file name is specified.
The constant low level threshold is applied if do_threshold is true.
Corrections are not applied by default or with empty file names.

See also Example for Module ImgAlgos::ImgCalib.

...