Dark¶
The dark current of a CCD detector can be measured by using frames with an exposure time larger than zero (usually it is in the same order of magnitude as the science data) during which the shutter remains closed. Various dark frames are then combined into a master dark in order to increase the signal to noise of the dark current. Before doing this master frame combination, depending on the detector and the wavelength regime, the overscan and/or master bias has to be subtracted from the single frames.
As the master dark creation algorithm is essentially the same as the master bias algorithm (with the possible difference that a master bias image and a multiplicative scaling for the exposure time has to be taken into account) see Bias.
There is no dedicated Dark class in PyHDRL.
Example¶
The C developer manual example produces a master dark from raw dark
frames by overscan-correcting, scaling, subtracting a master bias, and
collapsing. The corresponding PyHDRL calls, with overscan an
already constructed hdrl.func.Overscan instance, are as follows.
Each raw_dark and master_bias is an hdrl.core.Image.
mul_scalar takes an HDRL value as a (data, error) tuple.
collapse = hdrl.func.Collapse.Median()
ilst = hdrl.core.ImageList()
for i, raw_dark in enumerate(raw_darks):
overscan.compute(raw_dark)
os_cor = overscan.correct(raw_dark)
cor_dark = os_cor.corrected
cor_dark.mul_scalar((scaling_factor[i], 0.0))
ilst.append(cor_dark)
ilst.sub_image(master_bias)
results = ilst.collapse(collapse)
master_dark = results.out