backgroundFlatContext

lsst.meas.algorithms.backgroundFlatContext(maskedImage, doApply, backgroundToPhotometricRatio=None)

Context manager to convert from photometric-flattened to background- flattened image.

Parameters:
maskedImagelsst.afw.image.MaskedImage

Masked image (image + mask + variance) to convert from a photometrically flat image to an image suitable for background subtraction.

doApplybool

Apply the conversion? If False, this context manager will not do anything.

backgroundToPhotometricRatiolsst.afw.image.Image, optional

Image to multiply a photometrically-flattened image by to obtain a background-flattened image. Only used if doApply is True.

Yields:
maskedImagelsst.afw.image.MaskedImage

Masked image converted into an image suitable for background subtraction.

Raises:
RuntimeError if doApply is True and no ratio is supplied.
ValueError if the ratio is not an lsst.afw.image.Image.