GetTemplateTask#
- class lsst.ip.diffim.GetTemplateTask(*args, **kwargs)#
Bases:
PipelineTaskMethods 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
runmethod.Methods Documentation
- checkHighVariance(template)#
Set a mask plane for regions with unusually high variance.
Parameters#
- template
lsst.afw.image.Exposure The warped template exposure, which will be modified in place.
- template
- 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
runmethod.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
rundoes not have to read in all possibly-matching coadd exposures.Parameters#
- coaddExposureHandles
iterable[lsst.daf.butler.DeferredDatasetHandleoflsst.afw.image.Exposure] Dataset handles to exposures that might overlap the desired region.
- bbox
lsst.geom.Box2I Template bounding box of the pixel geometry onto which the coaddExposures will be resampled.
- skymap
lsst.skymap.SkyMap Geometry of the tracts and patches the coadds are defined on.
- wcs
lsst.afw.geom.SkyWcs Template WCS onto which the coadds will be resampled.
Returns#
- result
lsst.pipe.base.Struct A struct with attributes:
coaddExposuresDict of coadd exposures that overlap the projected bbox, indexed on tract id (
dict[int,list[lsst.daf.butler.DeferredDatasetHandleoflsst.afw.image.Exposure] ]).dataIdsDict 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.
- coaddExposureHandles
- 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#
- coaddExposureHandles
dict[int,listof [lsst.daf.butler.DeferredDatasetHandleoflsst.afw.image.Exposure]] Coadds to be mosaicked, indexed on tract id.
- bbox
lsst.geom.Box2I Template Bounding box of the detector geometry onto which to resample the
coaddExposureHandles. Modified in-place to include the template border.- wcs
lsst.afw.geom.SkyWcs Template WCS onto which to resample the
coaddExposureHandles.- dataIds
dict[int,list[lsst.daf.butler.DataCoordinate]] Record of the tract and patch of each coaddExposure, indexed on tract id.
- physical_filter
str Physical filter of the science image.
Returns#
- result
lsst.pipe.base.Struct A struct with attributes:
templateA template coadd exposure assembled out of patches (
lsst.afw.image.ExposureF).
Raises#
- NoWorkFound
If no coadds are found with sufficient un-masked pixels.
- coaddExposureHandles
- runQuantum(butlerQC, inputRefs, outputRefs)#
Do butler IO and transform to provide in memory objects for tasks
runmethod.Parameters#
- butlerQC
QuantumContext A butler which is specialized to operate in the context of a
lsst.daf.butler.Quantum.- inputRefs
InputQuantizedConnection Datastructure whose attribute names are the names that identify connections defined in corresponding
PipelineTaskConnectionsclass. The values of these attributes are thelsst.daf.butler.DatasetRefobjects associated with the defined input/prerequisite connections.- outputRefs
OutputQuantizedConnection Datastructure whose attribute names are the names that identify connections defined in corresponding
PipelineTaskConnectionsclass. The values of these attributes are thelsst.daf.butler.DatasetRefobjects associated with the defined output connections.
- butlerQC