Subtracts a dark frame _SUBTRACT_DARK_
Since transient ‘hot’ and ‘cold’ pixels can be present despite the application of a bad-pixel mask, the primitive also thresholds the dark-subtracted frame, setting values beyond the limits to be bad (i.e. undefined), to remove these non-physical values. Such values can lead to problems later in the pipeline. In a sense this processing step augments the bad-pixel mask.
This primitive is suitable for infrared imaging.
Processing only occurs for object, sky, and flat frames.
The dark-subtracted image can be displayed.
The subtraction assumes the same exposure time for the dark and object frame. That validation should be done by the $Cal-dark method.
The lower threshold limit is the clipped mean (mode) minus five standard deviations, subject to the constraint that the limit lies between -100 and 1. The upper limit is 1000 above the nominal saturation level for the instrument and its mode.
The primitive issues a warning if the dark-subtracted frame’s mode is negative, allowing for the error of the mode. It aborts with an error message if the modal dark-subtracted signal is more than one standard deviation negative.
The frame title is propagated.
Dark-subtracted frame inheriting the frame’s name but with the _dk suffix.
An array with bad-value substitution beyond thresholds and inheriting the frame’s name but with the _th suffix.