flatCorrection

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

Apply flat correction in place.

Parameters:
maskedImage : lsst.afw.image.MaskedImage

Image to process. The image is modified.

flatMaskedImage : lsst.afw.image.MaskedImage

Flat image of the same size as maskedImage

scalingType : str

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

userScale : scalar, optional

Scale to use if scalingType='USER'.

invert : Bool, optional

If True, unflatten an already flattened image.

trimToFit : Bool, 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.