lsst.ip.diffim gfe49aa100b+f14789e3e6
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask Class Reference
Inheritance diagram for lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask:

Public Member Functions

def __init__ (self, **kwargs)
 
def run (self, template, science, sources, finalizedPsfApCorrCatalog=None)
 
def runConvolveTemplate (self, template, science, selectSources)
 
def runConvolveScience (self, template, science, selectSources)
 
def finalize (self, template, science, difference, kernel, templateMatched=True, preConvMode=False, preConvKernel=None, spatiallyVarying=False)
 

Public Attributes

 convolutionControl
 

Static Public Attributes

 ConfigClass = AlardLuptonSubtractConfig
 

Detailed Description

Compute the image difference of a science and template image using
the Alard & Lupton (1998) algorithm.

Definition at line 184 of file subtractImages.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.__init__ (   self,
**  kwargs 
)

Definition at line 191 of file subtractImages.py.

Member Function Documentation

◆ finalize()

def 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 477 of file subtractImages.py.

◆ run()

def lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.run (   self,
  template,
  science,
  sources,
  finalizedPsfApCorrCatalog = 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 if config.doApplyFinalizedPsf=True.  Catalog uses
    the detector id for the catalog id, sorted on id for fast lookup.

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

Definition at line 245 of file subtractImages.py.

◆ runConvolveScience()

def 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 410 of file subtractImages.py.

◆ runConvolveTemplate()

def 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 354 of file subtractImages.py.

Member Data Documentation

◆ ConfigClass

lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.ConfigClass = AlardLuptonSubtractConfig
static

Definition at line 188 of file subtractImages.py.

◆ convolutionControl

lsst.ip.diffim.subtractImages.AlardLuptonSubtractTask.convolutionControl

Definition at line 198 of file subtractImages.py.


The documentation for this class was generated from the following file: