as_masked_image#

lsst.analysis.ap.as_masked_image(image, *, image_type='science')#

Return the pixels of an AP image as an lsst.images.MaskedImage.

Use this for images without the detector, PSF and other components a VisitImage needs, such as a post-ISR image.

Parameters#

imagelsst.images.MaskedImage or lsst.afw.image.Exposure

Image to convert. An lsst.images.MaskedImage (which includes VisitImage) is returned unchanged.

image_type{“science”, “template”, “difference”}, optional

Role of a legacy image, which sets the mask planes it keeps.

Returns#

imagelsst.images.MaskedImage

The image, mask and variance, with a sky projection if image has a WCS. A converted image shares its image and variance pixels with image.

Raises#

TypeError

Raised if image is neither an lsst.images.MaskedImage nor an lsst.afw.image.Exposure.