GetTemplateTask#

class lsst.ip.diffim.GetTemplateTask(*args, **kwargs)#

Bases: PipelineTask

Methods Summary

checkHighVariance(template)

Set a mask plane for regions with unusually high variance.

getExposures(coaddExposureHandles, bbox, ...)

Return a data structure containing the coadds that overlap the specified bbox projected onto the sky, and a corresponding data structure of their dataIds.

run(*, coaddExposureHandles, bbox, wcs, ...)

Warp coadds from multiple tracts and patches to form a template to subtract from a science image.

runQuantum(butlerQC, inputRefs, outputRefs)

Do butler IO and transform to provide in memory objects for tasks run method.

Methods Documentation

checkHighVariance(template)#

Set a mask plane for regions with unusually high variance.

Parameters#

templatelsst.afw.image.Exposure

The warped template exposure, which will be modified in place.

getExposures(coaddExposureHandles, bbox, skymap, wcs)#

Return a data structure containing the coadds that overlap the specified bbox projected onto the sky, and a corresponding data structure of their dataIds. These are the appropriate inputs to this task’s run method.

The spatial index in the butler registry has generous padding and often supplies patches near, but not directly overlapping the desired region. This method filters the inputs so that run does not have to read in all possibly-matching coadd exposures.

Parameters#

coaddExposureHandlesiterable [lsst.daf.butler.DeferredDatasetHandle of lsst.afw.image.Exposure]

Dataset handles to exposures that might overlap the desired region.

bboxlsst.geom.Box2I

Template bounding box of the pixel geometry onto which the coaddExposures will be resampled.

skymaplsst.skymap.SkyMap

Geometry of the tracts and patches the coadds are defined on.

wcslsst.afw.geom.SkyWcs

Template WCS onto which the coadds will be resampled.

Returns#

resultlsst.pipe.base.Struct

A struct with attributes:

coaddExposures

Dict of coadd exposures that overlap the projected bbox, indexed on tract id (dict [int, list [lsst.daf.butler.DeferredDatasetHandle of

lsst.afw.image.Exposure] ]).

dataIds

Dict of data IDs of the coadd exposures that overlap the projected bbox, indexed on tract id (dict [int, list [`lsst.daf.butler.DataCoordinate] ]).

Raises#

NoWorkFound

Raised if no patches overlap the input detector bbox, or the input WCS is None.

run(*, coaddExposureHandles, bbox, wcs, dataIds, physical_filter)#

Warp coadds from multiple tracts and patches to form a template to subtract from a science image.

Tract and patch overlap regions are combined by a variance-weighted average, and the variance planes are combined with the same weights, not added in quadrature; the overlap regions are not statistically independent, because they’re derived from the same original data. The PSF on the template is created by combining the CoaddPsf on each template image into a meta-CoaddPsf.

Parameters#

coaddExposureHandlesdict [int, list of [lsst.daf.butler.DeferredDatasetHandle of lsst.afw.image.Exposure]]

Coadds to be mosaicked, indexed on tract id.

bboxlsst.geom.Box2I

Template Bounding box of the detector geometry onto which to resample the coaddExposureHandles. Modified in-place to include the template border.

wcslsst.afw.geom.SkyWcs

Template WCS onto which to resample the coaddExposureHandles.

dataIdsdict [int, list [lsst.daf.butler.DataCoordinate]]

Record of the tract and patch of each coaddExposure, indexed on tract id.

physical_filterstr

Physical filter of the science image.

Returns#

resultlsst.pipe.base.Struct

A struct with attributes:

template

A template coadd exposure assembled out of patches (lsst.afw.image.ExposureF).

Raises#

NoWorkFound

If no coadds are found with sufficient un-masked pixels.

runQuantum(butlerQC, inputRefs, outputRefs)#

Do butler IO and transform to provide in memory objects for tasks run method.

Parameters#

butlerQCQuantumContext

A butler which is specialized to operate in the context of a lsst.daf.butler.Quantum.

inputRefsInputQuantizedConnection

Datastructure whose attribute names are the names that identify connections defined in corresponding PipelineTaskConnections class. The values of these attributes are the lsst.daf.butler.DatasetRef objects associated with the defined input/prerequisite connections.

outputRefsOutputQuantizedConnection

Datastructure whose attribute names are the names that identify connections defined in corresponding PipelineTaskConnections class. The values of these attributes are the lsst.daf.butler.DatasetRef objects associated with the defined output connections.