Function used to check the number of pixels that deviate from the median.
Arguments
- x
cps_spct or raw_spct A spectrum measured in darkness.
- range
numeric A wavelength range [nm].
- tol.margin
numeric A multiplier applied to MAD, the default 1 corresponds to 1 pixel per 1000 pixels as the expected random Normal noise.
- max.hot, max.cold
integer Maximum number of hot and cold pixels exceeding the tolerance per 1000 array pixels.
- spct.label
character A character string to use in message.
- verbose
logical If true a message is emitted in addition to returning the outcome.
- QC.enabled
logical If FALSE return NA skipping QC.
Details
The expectation is that in a spectrum measured in the dark, to be
used as a reference, the variation among pixel counts is small. This also
applies in some cases to ranges of pixels protected from radiation by a
long pass or short pass filter. By default the whole spectrum is included
in the QC check, but if needed an argument can be passed to range
to select a smaller region.
Note
Disabling the quality control is necessary when the "dark" reference is a measurement of ambient light instead of true darkness; i.e., when the irradiance of one light source is measured as the difference between background illumination and background illuminations plus the target light source.