LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
Base class for Psf Matching; should not be called directly. More...
Public Member Functions | |
def | __init__ |
Create the psf-matching Task. More... | |
Public Attributes | |
kConfig | |
useRegularization | |
hMat | |
Static Public Attributes | |
ConfigClass = PsfMatchConfig | |
Private Member Functions | |
def | _diagnostic |
Provide logging diagnostics on quality of spatial kernel fit. More... | |
def | _displayDebug |
Provide visualization of the inputs and ouputs to the Psf-matching code. More... | |
def | _createPcaBasis |
Create Principal Component basis. More... | |
def | _buildCellSet |
Fill a SpatialCellSet with KernelCandidates for the Psf-matching process; override in derived classes. More... | |
def | _solve |
Solve for the PSF matching kernel. More... | |
Static Private Attributes | |
string | _DefaultName = "psfMatch" |
Base class for Psf Matching; should not be called directly.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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 an lsst.afw.math.KernelList 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.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Create the psf-matching Task.
*args | arguments to be passed to lsst.pipe.base.task.Task.__init__ |
**kwargs | keyword 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.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
See PsfMatchConfig, PsfMatchConfigAL, PsfMatchConfigDF, and DetectionConfig.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Kernel sum (10^{-0.4 * Δ zeropoint}) of the spatial Psf-matching kernel; via PsfMatchTask._diagnostic
If using sum-of-Gaussian basis, the kernel size; via generateAlardLuptonBasisList
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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:
Note that if you want addional logging info, you may add to your scripts:
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
As a base class, there is no example code for PsfMatchTask. However, see ImagePsfMatchTask, SnapPsfMatchTask, and ModelPsfMatchTask.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Definition at line 525 of file psfMatch.py.
def lsst.ip.diffim.psfMatch.PsfMatchTask.__init__ | ( | self, | |
args, | |||
kwargs | |||
) |
Create the psf-matching Task.
*args | arguments to be passed to lsst.pipe.base.task.Task.__init__ |
**kwargs | keyword 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 676 of file psfMatch.py.
|
private |
Fill a SpatialCellSet with KernelCandidates for the Psf-matching process; override in derived classes.
Definition at line 888 of file psfMatch.py.
|
private |
Create Principal Component basis.
If a principal component analysis is requested, typically when using a delta function basis, perform the PCA here and return a new basis list containing the new principal components.
kernelCellSet: | a SpatialCellSet containing KernelCandidates, from which components are derived |
nStarPerCell: | the number of stars per cell to visit when doing the PCA |
policy: | input policy controlling the single kernel visitor |
Definition at line 833 of file psfMatch.py.
|
private |
Provide logging diagnostics on quality of spatial kernel fit.
kernelCellSet: | Cellset that contains the KernelCandidates used in the fitting |
spatialSolution: | KernelSolution of best-fit |
spatialKernel: | Best-fit spatial Kernel model |
spatialBg: | Best-fit spatial background model |
Definition at line 700 of file psfMatch.py.
|
private |
Provide visualization of the inputs and ouputs to the Psf-matching code.
kernelCellSet: | the SpatialCellSet used in determining the matching kernel and background |
spatialKernel: | spatially varying Psf-matching kernel |
spatialBackground: | spatially varying background-matching function |
Definition at line 786 of file psfMatch.py.
|
private |
Solve for the PSF matching kernel.
kernelCellSet: | a SpatialCellSet to use in determining the matching kernel (typically as provided by _buildCellSet) |
basisList: | list of Kernels to be used in the decomposition of the spatially varying kernel (typically as provided by makeKernelBasisList) |
returnOnExcept: | if True then return (None, None) if an error occurs, else raise the exception |
Raise Exception if unable to determine PSF matching kernel and returnOnExcept False
Definition at line 894 of file psfMatch.py.
|
staticprivate |
Definition at line 674 of file psfMatch.py.
|
static |
Definition at line 673 of file psfMatch.py.
lsst.ip.diffim.psfMatch.PsfMatchTask.hMat |
Definition at line 698 of file psfMatch.py.
lsst.ip.diffim.psfMatch.PsfMatchTask.kConfig |
Definition at line 689 of file psfMatch.py.
lsst.ip.diffim.psfMatch.PsfMatchTask.useRegularization |
Definition at line 693 of file psfMatch.py.