lentil.detector.collect_charge_bayer#

lentil.detector.collect_charge_bayer(img, wave, qe_red, qe_green, qe_blue, bayer_pattern, oversample=1, waveunit='nm', flatten=True)[source]#

Convert photon count (or flux) to electron count (or flux) by applying the detector’s wavelength-dependent quantum efficiency. Additional processing is performed to apply separate QE curves and location masks for the separate red, green, and blue channels.

Parameters:
  • img (array_like) – The photons presented to the sensor. Should have shape (nwave, nrows, ncols)

  • wave (array_like) – Wavelengths corresponding to each slice in count. The length of wave must be equal to the first dimension in count.

  • qe_red ({lentil.radiometry.Spectrum, array_like, scalar}) – Red channel quantum efficiency

  • qe_green ({lentil.radiometry.Spectrum, array_like, scalar}) – Green channel quantum efficiency

  • qe_blue ({lentil.radiometry.Spectrum, array_like, scalar}) – Blue channel quantum efficiency

  • bayer_pattern (string) – Layout of the detector’s Bayer pattern.

  • oversample (int, optional) – Oversampling factor present in count. Default is 1.

  • waveunit (str, optional) – Units of wave. Defaults is nm

  • flatten (bool, optional) – If True (default), the Bayer channels are flattened into a flat image, otherwise each color channel is returned separately ordered as (R, G, B)

Returns:

img – Electron count or flux

Return type:

ndarray

Notes

The units of count don’t really matter, as long as the user is aware that this method converts photons per whatever to electrons per whatever. Whatever is nothing for counts and seconds for flux.

This function does not rebin data to native sampling!