|
| | __init__ (self, *args, **kwargs) |
| |
| | run (self, exposure, referencePsfModel, kernelSum=1.0) |
| |
|
| | log |
| |
| | kConfig = self.config.kernel.active |
| |
| bool | useRegularization = self.kConfig.useRegularization |
| |
| | hMat = diffimLib.makeRegularizationMatrix(pexConfig.makePropertySet(self.kConfig)) |
| |
|
| | _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) |
| |
Match two model Psfs, and application of the Psf-matching kernel
to an input Exposure.
Definition at line 173 of file modelPsfMatch.py.
◆ __init__()
| lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask.__init__ |
( |
| self, |
|
|
* | args, |
|
|
** | kwargs ) |
◆ _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 728 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 674 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 801 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.
◆ _DefaultName
| str lsst.ip.diffim.psfMatch.PsfMatchTask._DefaultName = "psfMatch" |
|
staticprotectedinherited |
◆ ConfigClass
◆ hMat
| lsst.ip.diffim.psfMatch.PsfMatchTask.hMat = diffimLib.makeRegularizationMatrix(pexConfig.makePropertySet(self.kConfig)) |
|
inherited |
◆ kConfig
| lsst.ip.diffim.psfMatch.PsfMatchTask.kConfig = self.config.kernel.active |
|
inherited |
◆ log
| lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask.log |
◆ useRegularization
| bool lsst.ip.diffim.psfMatch.PsfMatchTask.useRegularization = self.kConfig.useRegularization |
|
inherited |
The documentation for this class was generated from the following file: