flatCorrection

lsst.ip.isr.flatCorrection(maskedImage, flatMaskedImage, scalingType, userScale=1.0, invert=False, trimToFit=False)

Apply flat correction in place.

Parameters:
maskedImagelsst.afw.image.MaskedImage

Image to process. The image is modified.

flatMaskedImagelsst.afw.image.MaskedImage

Flat image of the same size as maskedImage

scalingTypestr

Flat scale computation method. Allowed values are ‘MEAN’, ‘MEDIAN’, or ‘USER’.

userScalescalar, optional

Scale to use if scalingType='USER'.

invertBool, optional

If True, unflatten an already flattened image.

trimToFitBool, optional

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

Raises:
RuntimeError

Raised if maskedImage and flatMaskedImage do not have the same size or if scalingType is not an allowed value.