Sensor Calibration

Each pixel’s own dark current and bias, from a real sensor’s calibration frames, for SensorModel::set_dark_current_map() and set_bias_map(). See Sensor Modeling: From Spectral Flux to Digital Numbers.

enum class huira::BiasMapKind

What the values of a bias map are: see SensorModel::set_bias_map().

Values:

enumerator Absolute

Each pixel’s bias, in DN: a master bias frame. It replaces the bias level, which is not used while the map is set.

enumerator Relative

Each pixel’s offset from the bias level, in DN: the bias’s structure alone, averaging about 0. The bias level still applies, and changing it moves the whole map.

inline Image<float> huira::dark_current_from_master_dark(const Image<float> &master_dark, const Image<float> &master_bias, float conversion_gain, units::Second exposure_time)

The dark current of each pixel, in electrons per second, from a master dark and a master bias: (dark - bias) * gain / exposure time.

Both frames are in DN, as the camera read them out: an image with a sensor bit depth (a sensor response, or a frame read from a file that records it) holds DN / (2^bits - 1) and is converted; any other image’s values are taken as DN, and one that looks normalized (no bit depth, every value at most 1 DN) is refused. See docs/design_overview/sensor_modeling.rst, “Calibration maps”, for what files give.

The result is for SensorModel::set_dark_current_map(), in the master dark’s layout. A pixel below the master bias (noise, at a dark current near 0) gets 0; a warning counts them.

Parameters:
  • master_dark – The master dark.

  • master_bias – The master bias, the same size as the master dark.

  • conversion_gain – The conversion gain, in e-/DN, of the camera that took them.

  • exposure_time – The master dark’s exposure time.

Throws:

std::runtime_error – if the images differ in size, a pixel of either is not finite, either is normalized (see above), or the gain or the exposure time is not positive and finite.

Returns:

The dark current of each pixel, in e-/s.

inline Image<float> huira::dark_current_from_master_dark(const Image<float> &master_dark, float master_bias_dn, float conversion_gain, units::Second exposure_time)

The dark current of each pixel, in electrons per second, from a master dark and one bias for every pixel: (dark - bias) * gain / exposure time.

As the overload that takes a master bias, for a camera whose bias is the same everywhere.

Parameters:
  • master_dark – The master dark.

  • master_bias_dn – The bias, in DN (0 or more).

  • conversion_gain – The conversion gain, in e-/DN, of the camera that took the master dark.

  • exposure_time – The master dark’s exposure time.

Throws:

std::runtime_error – if a pixel of the master dark is not finite, the master dark is normalized (see the overload that takes a master bias), the bias is negative or not finite, or the gain or the exposure time is not positive and finite.

Returns:

The dark current of each pixel, in e-/s.