lsst.ip.diffim g40c9b15c53+9752a2df40
Loading...
Searching...
No Matches
lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask Class Reference
Inheritance diagram for lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask:
lsst.ip.diffim.psfMatch.PsfMatchTask

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 run (self, exposure, referencePsfModel, kernelSum=1.0)
 

Public Attributes

 log
 
 kConfig = self.config.kernel.active
 
bool useRegularization = self.kConfig.useRegularization
 
 hMat = diffimLib.makeRegularizationMatrix(pexConfig.makePropertySet(self.kConfig))
 

Static Public Attributes

 ConfigClass = PsfMatchConfig
 

Protected Member Functions

 _diagnostic (self, kernelCellSet, spatialSolution, spatialKernel, spatialBg)
 
 _buildCellSet (self, exposure, referencePsfModel)
 
 _makePsfMaskedImage (self, psfModel, posX, posY, dimensions=None)
 
 _displayDebug (self, kernelCellSet, spatialKernel, spatialBackground)
 
 _createPcaBasis (self, kernelCellSet, nStarPerCell, ps)
 
 _solve (self, kernelCellSet, basisList)
 

Static Protected Attributes

str _DefaultName = "psfMatch"
 

Detailed Description

Match two model Psfs, and application of the Psf-matching kernel
to an input Exposure.

Definition at line 173 of file modelPsfMatch.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask.__init__ ( self,
* args,
** kwargs )

Definition at line 179 of file modelPsfMatch.py.

Member Function Documentation

◆ _buildCellSet()

lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask._buildCellSet ( self,
exposure,
referencePsfModel )
protected
Build a SpatialCellSet for use with the solve method

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    The science exposure that will be convolved; must contain a Psf
referencePsfModel : `lsst.afw.detection.Psf`
    Psf model to match to

Returns
-------
result : `struct`
    - ``kernelCellSet`` : a SpatialCellSet to be used by self._solve
    - ``referencePsfModel`` : Validated and/or modified
        reference model used to populate the SpatialCellSet

Notes
-----
If the reference Psf model and science Psf model have different dimensions,
adjust the referencePsfModel (the model to which the exposure PSF will be matched)
to match that of the science Psf. If the science Psf dimensions vary across the image,
as is common with a WarpedPsf, either pad or clip (depending on config.padPsf)
the dimensions to be constant.

Reimplemented from lsst.ip.diffim.psfMatch.PsfMatchTask.

Definition at line 276 of file modelPsfMatch.py.

◆ _createPcaBasis()

lsst.ip.diffim.psfMatch.PsfMatchTask._createPcaBasis ( self,
kernelCellSet,
nStarPerCell,
ps )
protectedinherited
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.

Parameters
----------
kernelCellSet : `lsst.afw.math.SpatialCellSet`
    a SpatialCellSet containing KernelCandidates, from which components are derived
nStarPerCell : `int`
    the number of stars per cell to visit when doing the PCA
ps : `lsst.daf.base.PropertySet`
    input property set controlling the single kernel visitor

Returns
-------
nRejectedPca : `int`
    number of KernelCandidates rejected during PCA loop
spatialBasisList : `list` of `lsst.afw.math.kernel.FixedKernel`
    basis list containing the principal shapes as Kernels

Raises
------
RuntimeError
    If the Eigenvalues sum to zero.

Definition at line 726 of file psfMatch.py.

◆ _diagnostic()

lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask._diagnostic ( self,
kernelCellSet,
spatialSolution,
spatialKernel,
spatialBg )
protected
Print diagnostic information on spatial kernel and background fit

The debugging diagnostics are not really useful here, since the images we are matching have
no variance.  Thus override the _diagnostic method to generate no logging information

Reimplemented from lsst.ip.diffim.psfMatch.PsfMatchTask.

Definition at line 269 of file modelPsfMatch.py.

◆ _displayDebug()

lsst.ip.diffim.psfMatch.PsfMatchTask._displayDebug ( self,
kernelCellSet,
spatialKernel,
spatialBackground )
protectedinherited
Provide visualization of the inputs and ouputs to the Psf-matching code

Parameters
----------
kernelCellSet : `lsst.afw.math.SpatialCellSet`
    The SpatialCellSet used in determining the matching kernel and background
spatialKernel : `lsst.afw.math.LinearCombinationKernel`
    Spatially varying Psf-matching kernel
spatialBackground : `lsst.afw.math.Function2D`
    Spatially varying background-matching function

Definition at line 672 of file psfMatch.py.

◆ _makePsfMaskedImage()

lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask._makePsfMaskedImage ( self,
psfModel,
posX,
posY,
dimensions = None )
protected
Return a MaskedImage of the a PSF Model of specified dimensions

Definition at line 421 of file modelPsfMatch.py.

◆ _solve()

lsst.ip.diffim.psfMatch.PsfMatchTask._solve ( self,
kernelCellSet,
basisList )
protectedinherited
Solve for the PSF matching kernel

Parameters
----------
kernelCellSet : `lsst.afw.math.SpatialCellSet`
    a SpatialCellSet to use in determining the matching kernel
     (typically as provided by _buildCellSet)
basisList : `list` of `lsst.afw.math.kernel.FixedKernel`
    list of Kernels to be used in the decomposition of the spatially varying kernel
    (typically as provided by makeKernelBasisList)

Returns
-------
psfMatchingKernel : `lsst.afw.math.LinearCombinationKernel`
    Spatially varying Psf-matching kernel
backgroundModel : `lsst.afw.math.Function2D`
    Spatially varying background-matching function

Raises
------
NoKernelCandidatesError :
    If there are no useable kernel candidates.

Definition at line 799 of file psfMatch.py.

◆ run()

lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask.run ( self,
exposure,
referencePsfModel,
kernelSum = 1.0 )
Psf-match an exposure to a model Psf.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure to Psf-match to the reference Psf model;
    it must return a valid PSF model via exposure.getPsf()
referencePsfModel : `lsst.afw.detection.Psf`
    The Psf model to match to
kernelSum : `float`, optional
    A multipicative factor to apply to the kernel sum (default=1.0)

Returns
-------
result : `struct`
    - ``psfMatchedExposure`` : the Psf-matched Exposure.
        This has the same parent bbox, Wcs, PhotoCalib and
        Filter as the input Exposure but no Psf.
        In theory the Psf should equal referencePsfModel but
        the match is likely not exact.
    - ``psfMatchingKernel`` : the spatially varying Psf-matching kernel
    - ``kernelCellSet`` : SpatialCellSet used to solve for the Psf-matching kernel
    - ``referencePsfModel`` : Validated and/or modified reference model used

Raises
------
RuntimeError
    if the Exposure does not contain a Psf model

Definition at line 184 of file modelPsfMatch.py.

Member Data Documentation

◆ _DefaultName

str lsst.ip.diffim.psfMatch.PsfMatchTask._DefaultName = "psfMatch"
staticprotectedinherited

Definition at line 568 of file psfMatch.py.

◆ ConfigClass

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

Definition at line 567 of file psfMatch.py.

◆ hMat

lsst.ip.diffim.psfMatch.PsfMatchTask.hMat = diffimLib.makeRegularizationMatrix(pexConfig.makePropertySet(self.kConfig))
inherited

Definition at line 580 of file psfMatch.py.

◆ kConfig

lsst.ip.diffim.psfMatch.PsfMatchTask.kConfig = self.config.kernel.active
inherited

Definition at line 572 of file psfMatch.py.

◆ log

lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask.log

Definition at line 391 of file modelPsfMatch.py.

◆ useRegularization

bool lsst.ip.diffim.psfMatch.PsfMatchTask.useRegularization = self.kConfig.useRegularization
inherited

Definition at line 575 of file psfMatch.py.


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