get_visit_image#

lsst.analysis.ap.get_visit_image(butler, dataset, data_id=None, *, image_type='science', detector=None, **kwargs)#

Read an AP image as an lsst.images type, whatever its storage class.

Parameters#

butlerlsst.daf.butler.Butler

Butler to read from.

datasetstr or lsst.daf.butler.DatasetRef

Dataset type name, or a resolved reference.

data_iddict, optional

Data ID of the image; ignored when dataset is a reference.

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

Role of the image; see as_visit_image.

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

Detector for a legacy image that has none; see as_visit_image.

**kwargs

Additional data ID keys, passed to lsst.daf.butler.Butler.find_dataset.

Returns#

imagelsst.images.VisitImage

The image, converted with the exposure record of its visit if it is stored as a legacy exposure.

Raises#

lsst.daf.butler.DatasetNotFoundError

Raised if the butler has no such dataset.