LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self, **kwargs) | |
run (self, template, science, sources, finalizedPsfApCorrCatalog=None, visitSummary=None) | |
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) | |
Public Attributes | |
convolutionControl | |
log | |
Static Public Attributes | |
ConfigClass = AlardLuptonSubtractConfig | |
Protected Member Functions | |
_applyExternalCalibrations (self, exposure, visitSummary) | |
_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) | |
Static Protected Member Functions | |
_validateExposures (template, science) | |
_checkMask (mask, sources, excludeMaskPlanes) | |
_renameMaskPlanes (mask, maskPlane, newMaskPlane) | |
Static Protected Attributes | |
str | _DefaultName = "alardLuptonSubtract" |
Compute the image difference of a science and template image using the Alard & Lupton (1998) algorithm.
Definition at line 258 of file subtractImages.py.
lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.__init__ | ( | self, | |
** | kwargs ) |
Definition at line 265 of file subtractImages.py.
|
protected |
Replace calibrations (psf, and ApCorrMap) on this exposure with external ones.". Parameters ---------- exposure : `lsst.afw.image.exposure.Exposure` Input exposure to adjust calibrations. visitSummary : `lsst.afw.table.ExposureCatalog` Exposure catalog with external calibrations to be applied. Catalog uses the detector id for the catalog id, sorted on id for fast lookup. Returns ------- exposure : `lsst.afw.image.exposure.Exposure` Exposure with adjusted calibrations.
Definition at line 278 of file subtractImages.py.
|
staticprotected |
Exclude sources that are located on masked pixels. Parameters ---------- mask : `lsst.afw.image.Mask` The image mask plane to use to reject sources based on the location of their centroid on the ccd. sources : `lsst.afw.table.SourceCatalog` The source catalog to evaluate. excludeMaskPlanes : `list` of `str` List of the names of the mask planes to exclude. Returns ------- flags : `numpy.ndarray` of `bool` Array indicating whether each source in the catalog should be kept (True) or rejected (False) based on the value of the mask plane at its location.
Definition at line 763 of file subtractImages.py.
|
protected |
Clear the mask plane of the template. Parameters ---------- mask : `lsst.afw.image.Mask` The mask plane to erase, which will be modified in place. clearMaskPlanes : `list` of `str`, optional Erase the specified mask planes. If not supplied, the entire mask will be erased.
Definition at line 901 of file subtractImages.py.
|
protected |
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 662 of file subtractImages.py.
|
protected |
Perform preparatory calculations common to all Alard&Lupton Tasks. Parameters ---------- template : `lsst.afw.image.ExposureF` Template exposure, warped to match the science exposure. The variance plane of the template image is modified in place. science : `lsst.afw.image.ExposureF` Science exposure to subtract from the template. The variance plane of the science image is modified in place. visitSummary : `lsst.afw.table.ExposureCatalog`, optional Exposure catalog with external calibrations to be applied. Catalog uses the detector id for the catalog id, sorted on id for fast lookup.
Definition at line 796 of file subtractImages.py.
|
staticprotected |
Rename a mask plane by adding the new name and copying the data. Parameters ---------- mask : `lsst.afw.image.Mask` The mask image to update in place. maskPlane : `str` The name of the existing mask plane to copy. newMaskPlane : `str` The new name of the mask plane that will be added. If the mask plane already exists, it will be updated in place.
Definition at line 883 of file subtractImages.py.
|
protected |
Select sources from a catalog that meet the selection criteria. Parameters ---------- sources : `lsst.afw.table.SourceCatalog` Input source catalog to select sources from. mask : `lsst.afw.image.Mask` The image mask plane to use to reject sources based on their location on the ccd. Returns ------- selectSources : `lsst.afw.table.SourceCatalog` The input source catalog, with flagged and low signal-to-noise sources removed. Raises ------ RuntimeError If there are too few sources to compute the PSF matching kernel remaining after source selection.
Definition at line 707 of file subtractImages.py.
|
staticprotected |
Check that the WCS of the two Exposures match, and the template bbox contains the science bbox. 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, or if the science image is not fully contained in the template bounding box.
Definition at line 636 of file subtractImages.py.
lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.finalize | ( | self, | |
template, | |||
science, | |||
difference, | |||
kernel, | |||
templateMatched = True, | |||
preConvMode = False, | |||
preConvKernel = None, | |||
spatiallyVarying = False ) |
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 586 of file subtractImages.py.
lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.run | ( | self, | |
template, | |||
science, | |||
sources, | |||
finalizedPsfApCorrCatalog = None, | |||
visitSummary = None ) |
PSF match, subtract, and decorrelate two images. 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. 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. finalizedPsfApCorrCatalog : `lsst.afw.table.ExposureCatalog`, optional Exposure catalog with finalized psf models and aperture correction maps to be applied. Catalog uses the detector id for the catalog id, sorted on id for fast lookup. Deprecated in favor of ``visitSummary``, and will be removed after v26. visitSummary : `lsst.afw.table.ExposureCatalog`, optional Exposure catalog with external calibrations to be applied. Catalog uses the detector id for the catalog id, sorted on id for fast lookup. Ignored (for temporary backwards compatibility) if ``finalizedPsfApCorrCatalog`` is provided. Returns ------- results : `lsst.pipe.base.Struct` ``difference`` : `lsst.afw.image.ExposureF` Result of subtracting template and science. ``matchedTemplate`` : `lsst.afw.image.ExposureF` Warped and PSF-matched template exposure. ``backgroundModel`` : `lsst.afw.math.Function2D` Background model that was fit while solving for the PSF-matching kernel ``psfMatchingKernel`` : `lsst.afw.math.Kernel` Kernel used to PSF-match the convolved image. Raises ------ RuntimeError If an unsupported convolution mode is supplied. RuntimeError If there are too few sources to calculate the PSF matching kernel. lsst.pipe.base.NoWorkFound Raised if fraction of good pixels, defined as not having NO_DATA set, is less then the configured requiredTemplateFraction
Reimplemented in lsst.ip.diffim.subtractImages.AlardLuptonPreconvolveSubtractTask.
Definition at line 320 of file subtractImages.py.
lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.runConvolveScience | ( | self, | |
template, | |||
science, | |||
selectSources ) |
Convolve the science image with a PSF-matching kernel and subtract the template image. 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. 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. Returns ------- results : `lsst.pipe.base.Struct` ``difference`` : `lsst.afw.image.ExposureF` Result of subtracting template and science. ``matchedTemplate`` : `lsst.afw.image.ExposureF` Warped template exposure. Note that in this case, the template is not PSF-matched to the science image. ``backgroundModel`` : `lsst.afw.math.Function2D` Background model that was fit while solving for the PSF-matching kernel ``psfMatchingKernel`` : `lsst.afw.math.Kernel` Kernel used to PSF-match the science image to the template.
Definition at line 520 of file subtractImages.py.
lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.runConvolveTemplate | ( | self, | |
template, | |||
science, | |||
selectSources ) |
Convolve the template image with a PSF-matching kernel and subtract from the science image. 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. 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. Returns ------- results : `lsst.pipe.base.Struct` ``difference`` : `lsst.afw.image.ExposureF` Result of subtracting template and science. ``matchedTemplate`` : `lsst.afw.image.ExposureF` Warped and PSF-matched template exposure. ``backgroundModel`` : `lsst.afw.math.Function2D` Background model that was fit while solving for the PSF-matching kernel ``psfMatchingKernel`` : `lsst.afw.math.Kernel` Kernel used to PSF-match the template to the science image.
Definition at line 455 of file subtractImages.py.
lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.updateMasks | ( | self, | |
template, | |||
science ) |
Update the science and template mask planes before differencing. Parameters ---------- template : `lsst.afw.image.Exposure` Template exposure, warped to match the science exposure. The template mask planes will be erased, except for a few specified in the task config. science : `lsst.afw.image.Exposure` Science exposure to subtract from the template. The DETECTED and DETECTED_NEGATIVE mask planes of the science image will be erased.
Definition at line 838 of file subtractImages.py.
|
staticprotected |
Definition at line 263 of file subtractImages.py.
|
static |
Definition at line 262 of file subtractImages.py.
lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.convolutionControl |
Definition at line 272 of file subtractImages.py.
lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.log |
Definition at line 446 of file subtractImages.py.