as_visit_image#

lsst.analysis.ap.as_visit_image(image, *, image_type='science', exposure_record=None, detector=None)#

Return an AP image as an lsst.images type.

Parameters#

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

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

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

Role of a legacy image, which sets the type it becomes (a VisitImage for a science image, a DifferenceImage otherwise) and the mask planes it keeps.

exposure_recordlsst.daf.butler.DimensionRecord, optional

exposure dimension record of a legacy image. Without it the converted observation information lacks the fields the record supplies.

detectorlsst.afw.cameraGeom.Detector or lsst.images.cameras.Detector, optional

Detector to attach to a legacy image that has none, such as a legacy template; the science image’s detector is the right one.

Returns#

imagelsst.images.VisitImage

The image in lsst.images form. A converted image shares its image and variance pixels with image.

Raises#

TypeError

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

ValueError

Raised if a legacy image has no detector and none is given.