|
| | run (self, template, science, sources, visitSummary=None) |
| |
| | runPreconvolve (self, template, science, matchedScience, selectSources, preConvKernel) |
| |
| | runConvolveTemplate (self, template, science, selectSources) |
| |
| | runConvolveScience (self, template, science, selectSources) |
| |
| | finalize (self, template, science, difference, kernel, templateMatched=True, preConvMode=False, preConvKernel=None, spatiallyVarying=False) |
| |
| | updateMasks (self, template, science) |
| |
|
| | _applyExternalCalibrations (self, exposure, visitSummary) |
| |
| | _calculateMagLim (self, exposure, nsigma=5.0, fallbackPsfSize=None) |
| |
| | _convolveExposure (self, exposure, kernel, convolutionControl, bbox=None, psf=None, photoCalib=None, interpolateBadMaskPlanes=False) |
| |
| | _sourceSelector (self, sources, mask) |
| |
| | _prepareInputs (self, template, science, visitSummary=None) |
| |
| | _clearMask (self, mask, clearMaskPlanes=None) |
| |
Subtract a template from a science image, convolving the science image
before computing the kernel, and also convolving the template before
subtraction.
Definition at line 993 of file subtractImages.py.
| lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask._convolveExposure |
( |
| self, |
|
|
| exposure, |
|
|
| kernel, |
|
|
| convolutionControl, |
|
|
| bbox = None, |
|
|
| psf = None, |
|
|
| photoCalib = None, |
|
|
| interpolateBadMaskPlanes = False ) |
|
protectedinherited |
Convolve an exposure with the given kernel.
Parameters
----------
exposure : `lsst.afw.Exposure`
exposure to convolve.
kernel : `lsst.afw.math.LinearCombinationKernel`
PSF matching kernel computed in the ``makeKernel`` subtask.
convolutionControl : `lsst.afw.math.ConvolutionControl`
Configuration for convolve algorithm.
bbox : `lsst.geom.Box2I`, optional
Bounding box to trim the convolved exposure to.
psf : `lsst.afw.detection.Psf`, optional
Point spread function (PSF) to set for the convolved exposure.
photoCalib : `lsst.afw.image.PhotoCalib`, optional
Photometric calibration of the convolved exposure.
Returns
-------
convolvedExp : `lsst.afw.Exposure`
The convolved image.
Definition at line 725 of file subtractImages.py.
| lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask._validateExposures |
( |
| template, |
|
|
| science ) |
|
staticprotectedinherited |
Check that the WCS of the two Exposures match, the template bbox
contains the science bbox, and that the bands match.
Parameters
----------
template : `lsst.afw.image.ExposureF`
Template exposure, warped to match the science exposure.
science : `lsst.afw.image.ExposureF`
Science exposure to subtract from the template.
Raises
------
AssertionError
Raised if the WCS of the template is not equal to the science WCS,
if the science image is not fully contained in the template
bounding box, or if the bands do not match.
Definition at line 696 of file subtractImages.py.
| lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.finalize |
( |
| self, |
|
|
| template, |
|
|
| science, |
|
|
| difference, |
|
|
| kernel, |
|
|
| templateMatched = True, |
|
|
| preConvMode = False, |
|
|
| preConvKernel = None, |
|
|
| spatiallyVarying = False ) |
|
inherited |
Decorrelate the difference image to undo the noise correlations
caused by convolution.
Parameters
----------
template : `lsst.afw.image.ExposureF`
Template exposure, warped to match the science exposure.
science : `lsst.afw.image.ExposureF`
Science exposure to subtract from the template.
difference : `lsst.afw.image.ExposureF`
Result of subtracting template and science.
kernel : `lsst.afw.math.Kernel`
An (optionally spatially-varying) PSF matching kernel
templateMatched : `bool`, optional
Was the template PSF-matched to the science image?
preConvMode : `bool`, optional
Was the science image preconvolved with its own PSF
before PSF matching the template?
preConvKernel : `lsst.afw.detection.Psf`, optional
If not `None`, then the science image was pre-convolved with
(the reflection of) this kernel. Must be normalized to sum to 1.
spatiallyVarying : `bool`, optional
Compute the decorrelation kernel spatially varying across the image?
Returns
-------
correctedExposure : `lsst.afw.image.ExposureF`
The decorrelated image difference.
Definition at line 600 of file subtractImages.py.
| lsst.ip.diffim.subtractImages.AlardLuptonPreconvolveSubtractTask.run |
( |
| self, |
|
|
| template, |
|
|
| science, |
|
|
| sources, |
|
|
| visitSummary = None ) |
Preconvolve the science image with its own PSF,
convolve the template image with a PSF-matching kernel and subtract
from the preconvolved science image.
Parameters
----------
template : `lsst.afw.image.ExposureF`
The template image, which has previously been warped to the science
image. The template bbox will be padded by a few pixels compared to
the science bbox.
science : `lsst.afw.image.ExposureF`
The science exposure.
sources : `lsst.afw.table.SourceCatalog`
Identified sources on the science exposure. This catalog is used to
select sources in order to perform the AL PSF matching on stamp
images around them.
visitSummary : `lsst.afw.table.ExposureCatalog`, optional
Exposure catalog with complete external calibrations. Catalog uses
the detector id for the catalog id, sorted on id for fast lookup.
Returns
-------
results : `lsst.pipe.base.Struct`
``scoreExposure`` : `lsst.afw.image.ExposureF`
Result of subtracting the convolved template and science
images. Attached PSF is that of the original science image.
``matchedTemplate`` : `lsst.afw.image.ExposureF`
Warped and PSF-matched template exposure. Attached PSF is that
of the original science image.
``matchedScience`` : `lsst.afw.image.ExposureF`
The science exposure after convolving with its own PSF.
Attached PSF is that of the original science image.
``backgroundModel`` : `lsst.afw.math.Function2D`
Background model that was fit while solving for the
PSF-matching kernel
``psfMatchingKernel`` : `lsst.afw.math.Kernel`
Final kernel used to PSF-match the template to the science
image.
Reimplemented from lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.
Definition at line 1001 of file subtractImages.py.
| lsst.ip.diffim.subtractImages.AlardLuptonPreconvolveSubtractTask.runPreconvolve |
( |
| self, |
|
|
| template, |
|
|
| science, |
|
|
| matchedScience, |
|
|
| selectSources, |
|
|
| preConvKernel ) |
Convolve the science image with its own PSF, then convolve the
template with a matching kernel and subtract to form the Score
exposure.
Parameters
----------
template : `lsst.afw.image.ExposureF`
Template exposure, warped to match the science exposure.
science : `lsst.afw.image.ExposureF`
Science exposure to subtract from the template.
matchedScience : `lsst.afw.image.ExposureF`
The science exposure, convolved with the reflection of its own PSF.
selectSources : `lsst.afw.table.SourceCatalog`
Identified sources on the science exposure. This catalog is used to
select sources in order to perform the AL PSF matching on stamp
images around them.
preConvKernel : `lsst.afw.math.Kernel`
The reflection of the kernel that was used to preconvolve the
`science` exposure. Must be normalized to sum to 1.
Returns
-------
results : `lsst.pipe.base.Struct`
``scoreExposure`` : `lsst.afw.image.ExposureF`
Result of subtracting the convolved template and science
images. Attached PSF is that of the original science image.
``matchedTemplate`` : `lsst.afw.image.ExposureF`
Warped and PSF-matched template exposure. Attached PSF is that
of the original science image.
``matchedScience`` : `lsst.afw.image.ExposureF`
The science exposure after convolving with its own PSF.
Attached PSF is that of the original science image.
``backgroundModel`` : `lsst.afw.math.Function2D`
Background model that was fit while solving for the
PSF-matching kernel
``psfMatchingKernel`` : `lsst.afw.math.Kernel`
Final kernel used to PSF-match the template to the science
image.
Definition at line 1065 of file subtractImages.py.