lsst.ip.diffim  16.0-18-geff7d6b+4
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.ip.diffim.psfMatch.PsfMatchTask Class Reference

Base class for Psf Matching; should not be called directly. More...

Inheritance diagram for lsst.ip.diffim.psfMatch.PsfMatchTask:
lsst.ip.diffim.imagePsfMatch.ImagePsfMatchTask lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask lsst.ip.diffim.snapPsfMatch.SnapPsfMatchTask lsst.ip.diffim.zogy.ZogyImagePsfMatchTask

Public Member Functions

def __init__ (self, args, kwargs)
 Create the psf-matching Task. More...
 

Public Attributes

 kConfig
 
 useRegularization
 
 hMat
 

Static Public Attributes

 ConfigClass = PsfMatchConfig
 

Detailed Description

Base class for Psf Matching; should not be called directly.

Contents

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Description

PsfMatchTask is a base class that implements the core functionality for matching the Psfs of two images using a spatially varying Psf-matching lsst.afw.math.LinearCombinationKernel. The Task requires the user to provide an instance of an lsst.afw.math.SpatialCellSet, filled with lsst.ip.diffim.KernelCandidate instances, and a list of lsst.afw.math.Kernels of basis shapes that will be used for the decomposition. If requested, the Task also performs background matching and returns the differential background model as an lsst.afw.math.Kernel.SpatialFunction.

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

ip_diffim_psfmatch_Initialize Task initialization

Create the psf-matching Task.

Parameters
*argsarguments to be passed to lsst.pipe.base.task.Task.__init__
**kwargskeyword arguments to be passed to lsst.pipe.base.task.Task.__init__

The initialization sets the Psf-matching kernel configuration using the value of self.config.kernel.active. If the kernel is requested with regularization to moderate the bias/variance tradeoff, currently only used when a delta function kernel basis is provided, it creates a regularization matrix stored as member variable self.hMat.

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Invoking the Task

As a base class, this Task is not directly invoked. However, run() methods that are implemented on derived classes will make use of the core _solve() functionality, which defines a sequence of lsst.afw.math.CandidateVisitor classes that iterate through the KernelCandidates, first building up a per-candidate solution and then building up a spatial model from the ensemble of candidates. Sigma clipping is performed using the mean and standard deviation of all kernel sums (to reject variable objects), on the per-candidate substamp diffim residuals (to indicate a bad choice of kernel basis shapes for that particular object), and on the substamp diffim residuals using the spatial kernel fit (to indicate a bad choice of spatial kernel order, or poor constraints on the spatial model). The _diagnostic() method logs information on the quality of the spatial fit, and also modifies the Task metadata.

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Configuration parameters

See PsfMatchConfig, PsfMatchConfigAL, PsfMatchConfigDF, and DetectionConfig.

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Quantities set in Metadata

spatialConditionNum
Condition number of the spatial kernel fit; via PsfMatchTask._diagnostic
spatialKernelSum

Kernel sum (10^{-0.4 * Δ zeropoint}) of the spatial Psf-matching kernel; via PsfMatchTask._diagnostic

ALBasisNGauss
If using sum-of-Gaussian basis, the number of gaussians used; via generateAlardLuptonBasisList
ALBasisDegGauss
If using sum-of-Gaussian basis, the degree of spatial variation of the Gaussians; via generateAlardLuptonBasisList
ALBasisSigGauss
If using sum-of-Gaussian basis, the widths (sigma) of the Gaussians; via generateAlardLuptonBasisList
ALKernelSize

If using sum-of-Gaussian basis, the kernel size; via generateAlardLuptonBasisList

NFalsePositivesTotal
Total number of diaSources; via KernelCandidateQa.aggregate
NFalsePositivesRefAssociated
Number of diaSources that associate with the reference catalog; via KernelCandidateQa.aggregate
NFalsePositivesRefAssociated
Number of diaSources that associate with the source catalog; via KernelCandidateQa.aggregate
NFalsePositivesUnassociated
Number of diaSources that are orphans; via KernelCandidateQa.aggregate
metric_MEAN
Mean value of substamp diffim quality metrics across all KernelCandidates, for both the per-candidate (LOCAL) and SPATIAL residuals; via KernelCandidateQa.aggregate
metric_MEDIAN
Median value of substamp diffim quality metrics across all KernelCandidates, for both the per-candidate (LOCAL) and SPATIAL residuals; via KernelCandidateQa.aggregate
metric_STDEV
Standard deviation of substamp diffim quality metrics across all KernelCandidates, for both the per-candidate (LOCAL) and SPATIAL residuals; via KernelCandidateQa.aggregate

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Debug variables

The command line task interface supports a flag -d/–debug to import debug.py from your PYTHONPATH. The relevant contents of debug.py for this Task include:

import sys
import lsstDebug
def DebugInfo(name):
di = lsstDebug.getInfo(name)
if name == "lsst.ip.diffim.psfMatch":
di.display = True # enable debug output
di.maskTransparency = 80 # ds9 mask transparency
di.displayCandidates = True # show all the candidates and residuals
di.displayKernelBasis = False # show kernel basis functions
di.displayKernelMosaic = True # show kernel realized across the image
di.plotKernelSpatialModel = False # show coefficients of spatial model
di.showBadCandidates = True # show the bad candidates (red) along with good (green)
return di
lsstDebug.Info = DebugInfo
lsstDebug.frame = 1

Note that if you want addional logging info, you may add to your scripts:

import lsst.log.utils as logUtils
logUtils.traceSetAt("ip.diffim", 4)

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Example code

As a base class, there is no example code for PsfMatchTask. However, see ImagePsfMatchTask, SnapPsfMatchTask, and ModelPsfMatchTask.

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Definition at line 529 of file psfMatch.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.ip.diffim.psfMatch.PsfMatchTask.__init__ (   self,
  args,
  kwargs 
)

Create the psf-matching Task.

Parameters
*argsarguments to be passed to lsst.pipe.base.task.Task.__init__
**kwargskeyword arguments to be passed to lsst.pipe.base.task.Task.__init__

The initialization sets the Psf-matching kernel configuration using the value of self.config.kernel.active. If the kernel is requested with regularization to moderate the bias/variance tradeoff, currently only used when a delta function kernel basis is provided, it creates a regularization matrix stored as member variable self.hMat.

Definition at line 680 of file psfMatch.py.

Member Data Documentation

◆ ConfigClass

lsst.ip.diffim.psfMatch.PsfMatchTask.ConfigClass = PsfMatchConfig
static

Definition at line 677 of file psfMatch.py.

◆ hMat

lsst.ip.diffim.psfMatch.PsfMatchTask.hMat

Definition at line 702 of file psfMatch.py.

◆ kConfig

lsst.ip.diffim.psfMatch.PsfMatchTask.kConfig

Definition at line 693 of file psfMatch.py.

◆ useRegularization

lsst.ip.diffim.psfMatch.PsfMatchTask.useRegularization

Definition at line 697 of file psfMatch.py.


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