darkCorrection

lsst.ip.isr.darkCorrection(maskedImage, darkMaskedImage, expScale, darkScale, invert=False, trimToFit=False)

Apply dark correction in place.

Parameters:
maskedImagelsst.afw.image.MaskedImage

Image to process. The image is modified by this method.

darkMaskedImagelsst.afw.image.MaskedImage

Dark image of the same size as maskedImage.

expScalescalar

Dark exposure time for maskedImage.

darkScalescalar

Dark exposure time for darkMaskedImage.

invertBool, optional

If True, re-add the dark to an already corrected image.

trimToFitBool, optional

If True, raw data is symmetrically trimmed to match calibration size.

Raises:
RuntimeError

Raised if maskedImage and darkMaskedImage do not have the same size.

Notes

The dark correction is applied by calculating:

maskedImage -= dark * expScaling / darkScaling