|
| | __init__ (self, *args, **kwargs) |
| |
| | run (self, template, science, kernelSources, preconvolved=False, templateFwhmPix=None, scienceFwhmPix=None) |
| |
| | selectKernelSources (self, template, science, candidateList=None, preconvolved=False, templateFwhmPix=None, scienceFwhmPix=None) |
| |
| | getSelectSources (self, exposure, sigma=None, doSmooth=True, idFactory=None) |
| |
| | makeCandidateList (self, convolved, reference, kernelSize, candidateList, preconvolved=False, sigma=None) |
| |
| | makeKernelBasisList (self, targetFwhmPix=None, referenceFwhmPix=None, basisDegGauss=None, basisSigmaGauss=None, metadata=None) |
| |
|
| | _buildCellSet (self, convolved, reference, candidateList) |
| |
| | _adaptCellSize (self, candidateList) |
| |
| | _checkPsfWidths (self, template, science, templateFwhmPix, scienceFwhmPix, preconvolved=False) |
| |
| | _diagnostic (self, kernelCellSet, spatialSolution, spatialKernel, spatialBg) |
| |
| | _displayDebug (self, kernelCellSet, spatialKernel, spatialBackground) |
| |
| | _createPcaBasis (self, kernelCellSet, nStarPerCell, ps) |
| |
| | _solve (self, kernelCellSet, basisList) |
| |
Construct a kernel for PSF matching two exposures.
Definition at line 90 of file makeKernel.py.
◆ __init__()
| lsst.ip.diffim.makeKernel.MakeKernelTask.__init__ |
( |
| self, |
|
|
* | args, |
|
|
** | kwargs ) |
◆ _adaptCellSize()
| lsst.ip.diffim.makeKernel.MakeKernelTask._adaptCellSize |
( |
| self, |
|
|
| candidateList ) |
|
protected |
NOT IMPLEMENTED YET.
Parameters
----------
candidateList : `list`
A list of footprints/maskedImages for kernel candidates;
Returns
-------
sizeCellX, sizeCellY : `int`
New dimensions to use for the kernel.
Definition at line 404 of file makeKernel.py.
◆ _buildCellSet()
| lsst.ip.diffim.makeKernel.MakeKernelTask._buildCellSet |
( |
| self, |
|
|
| convolved, |
|
|
| reference, |
|
|
| candidateList ) |
|
protected |
Build a SpatialCellSet for use with the solve method.
Parameters
----------
convolved : `lsst.afw.image.MaskedImage`
MaskedImage to PSF-matched to reference.
reference : `lsst.afw.image.MaskedImage`
Reference MaskedImage.
candidateList : `lsst.afw.table.SourceCatalog`
Kernel candidate sources with footprints.
Returns
-------
kernelCellSet : `lsst.afw.math.SpatialCellSet`
A SpatialCellSet for use with self._solve.
Reimplemented from lsst.ip.diffim.psfMatch.PsfMatchTask.
Definition at line 359 of file makeKernel.py.
◆ _checkPsfWidths()
| lsst.ip.diffim.makeKernel.MakeKernelTask._checkPsfWidths |
( |
| self, |
|
|
| template, |
|
|
| science, |
|
|
| templateFwhmPix, |
|
|
| scienceFwhmPix, |
|
|
| preconvolved = False ) |
|
protected |
Check the science and template FWHM.
Parameters
----------
template : `lsst.afw.image.Exposure`
Exposure that will be convolved.
science : `lsst.afw.image.Exposure`
The exposure that will be matched.
templateFwhmPix, scienceFwhmPix : `float` or `None`
FWHM of the template or science PSF, in pixels.
Will be recalculated if not specified.
preconvolved : `bool`, optional
Was the science image convolved with its own PSF?
Returns
-------
templateFwhmPix, scienceFwhmPix : `float`
The desired PSF FWHM
Definition at line 419 of file makeKernel.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.psfMatch.PsfMatchTask._diagnostic |
( |
| self, |
|
|
| kernelCellSet, |
|
|
| spatialSolution, |
|
|
| spatialKernel, |
|
|
| spatialBg ) |
|
protectedinherited |
Provide logging diagnostics on quality of spatial kernel fit
Parameters
----------
kernelCellSet : `lsst.afw.math.SpatialCellSet`
Cellset that contains the KernelCandidates used in the fitting
spatialSolution : `lsst.ip.diffim.SpatialKernelSolution`
KernelSolution of best-fit
spatialKernel : `lsst.afw.math.LinearCombinationKernel`
Best-fit spatial Kernel model
spatialBg : `lsst.afw.math.Function2D`
Best-fit spatial background model
Reimplemented in lsst.ip.diffim.modelPsfMatch.ModelPsfMatchTask.
Definition at line 582 of file psfMatch.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.
◆ _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.
◆ getSelectSources()
| lsst.ip.diffim.makeKernel.MakeKernelTask.getSelectSources |
( |
| self, |
|
|
| exposure, |
|
|
| sigma = None, |
|
|
| doSmooth = True, |
|
|
| idFactory = None ) |
Get sources to use for Psf-matching.
This method runs detection and measurement on an exposure.
The returned set of sources will be used as candidates for
Psf-matching.
Parameters
----------
exposure : `lsst.afw.image.Exposure`
Exposure on which to run detection/measurement
sigma : `float`, optional
PSF sigma, in pixels, used for smoothing the image for detection.
If `None`, the PSF width will be used.
doSmooth : `bool`
Whether or not to smooth the Exposure with Psf before detection
idFactory : `lsst.afw.table.IdFactory`
Factory for the generation of Source ids
Returns
-------
selectSources :
source catalog containing candidates for the Psf-matching
Definition at line 182 of file makeKernel.py.
◆ makeCandidateList()
| lsst.ip.diffim.makeKernel.MakeKernelTask.makeCandidateList |
( |
| self, |
|
|
| convolved, |
|
|
| reference, |
|
|
| kernelSize, |
|
|
| candidateList, |
|
|
| preconvolved = False, |
|
|
| sigma = None ) |
Make a list of acceptable KernelCandidates.
Generate a list of candidate sources for Psf-matching, remove sources
with bad pixel masks set or that extend off the image.
Parameters
----------
convolved : `lsst.afw.image.Exposure`
Exposure that will be convolved. This is typically the template
image, and may have a large bbox than the reference exposure.
reference : `lsst.afw.image.Exposure`
Exposure that will be matched-to. This is typically the science
image.
kernelSize : `float`
Dimensions of the Psf-matching Kernel, used to set detection
footprints.
candidateList : `lsst.afw.table.SourceCatalog`
List of Sources to examine for kernel candidacy.
preconvolved : `bool`, optional
Was the science exposure already convolved with its PSF?
Returns
-------
candidates : `lsst.afw.table.SourceCatalog`
Candidates with footprints extended to a ``kernelSize`` box.
Raises
------
RuntimeError
If ``candidateList`` is empty after sub-selection.
Definition at line 243 of file makeKernel.py.
◆ makeKernelBasisList()
| lsst.ip.diffim.makeKernel.MakeKernelTask.makeKernelBasisList |
( |
| self, |
|
|
| targetFwhmPix = None, |
|
|
| referenceFwhmPix = None, |
|
|
| basisDegGauss = None, |
|
|
| basisSigmaGauss = None, |
|
|
| metadata = None ) |
Wrapper to set log messages for
`lsst.ip.diffim.makeKernelBasisList`.
Parameters
----------
targetFwhmPix : `float`, optional
Passed on to `lsst.ip.diffim.generateAlardLuptonBasisList`.
Not used for delta function basis sets.
referenceFwhmPix : `float`, optional
Passed on to `lsst.ip.diffim.generateAlardLuptonBasisList`.
Not used for delta function basis sets.
basisDegGauss : `list` of `int`, optional
Passed on to `lsst.ip.diffim.generateAlardLuptonBasisList`.
Not used for delta function basis sets.
basisSigmaGauss : `list` of `int`, optional
Passed on to `lsst.ip.diffim.generateAlardLuptonBasisList`.
Not used for delta function basis sets.
metadata : `lsst.daf.base.PropertySet`, optional
Passed on to `lsst.ip.diffim.generateAlardLuptonBasisList`.
Not used for delta function basis sets.
Returns
-------
basisList: `list` of `lsst.afw.math.kernel.FixedKernel`
List of basis kernels.
Definition at line 316 of file makeKernel.py.
◆ run()
| lsst.ip.diffim.makeKernel.MakeKernelTask.run |
( |
| self, |
|
|
| template, |
|
|
| science, |
|
|
| kernelSources, |
|
|
| preconvolved = False, |
|
|
| templateFwhmPix = None, |
|
|
| scienceFwhmPix = None ) |
Solve for the kernel and background model that best match two
Exposures evaluated at the given source locations.
Parameters
----------
template : `lsst.afw.image.Exposure`
Exposure that will be convolved.
science : `lsst.afw.image.Exposure`
The exposure that will be matched.
kernelSources : `lsst.afw.table.SourceCatalog`
Kernel candidate sources with appropriately sized footprints.
Typically the output of `MakeKernelTask.selectKernelSources`.
preconvolved : `bool`, optional
Was the science image convolved with its own PSF?
templateFwhmPix, scienceFwhmPix : `float` or `None`, optional
FWHM of the template or science PSF, in pixels.
Will be recalculated if not specified.
Returns
-------
results : `lsst.pipe.base.Struct`
``psfMatchingKernel`` : `lsst.afw.math.LinearCombinationKernel`
Spatially varying Psf-matching kernel.
``backgroundModel`` : `lsst.afw.math.Function2D`
Spatially varying background-matching function.
Definition at line 109 of file makeKernel.py.
◆ selectKernelSources()
| lsst.ip.diffim.makeKernel.MakeKernelTask.selectKernelSources |
( |
| self, |
|
|
| template, |
|
|
| science, |
|
|
| candidateList = None, |
|
|
| preconvolved = False, |
|
|
| templateFwhmPix = None, |
|
|
| scienceFwhmPix = None ) |
Select sources from a list of candidates, and extract footprints.
Parameters
----------
template : `lsst.afw.image.Exposure`
Exposure that will be convolved.
science : `lsst.afw.image.Exposure`
The exposure that will be matched.
candidateList : `lsst.afw.table.SourceCatalog`
Sources to check as possible kernel candidates.
preconvolved : `bool`, optional
Was the science image convolved with its own PSF?
templateFwhmPix, scienceFwhmPix : `float` or `None`, optional
FWHM of the template or science PSF, in pixels.
Will be recalculated if not specified.
Returns
-------
kernelSources : `lsst.afw.table.SourceCatalog`
Kernel candidates with appropriate sized footprints.
Definition at line 150 of file makeKernel.py.
◆ _DefaultName
| str lsst.ip.diffim.psfMatch.PsfMatchTask._DefaultName = "psfMatch" |
|
staticprotectedinherited |
◆ background
| lsst.ip.diffim.makeKernel.MakeKernelTask.background |
Initial value:= SubtractBackgroundTask(config=self.kConfig.afwBackgroundConfig, name="background",
parentTask=self)
Definition at line 101 of file makeKernel.py.
◆ 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 |
◆ selectAlgMetadata
◆ selectSchema
◆ useRegularization
| bool lsst.ip.diffim.psfMatch.PsfMatchTask.useRegularization = self.kConfig.useRegularization |
|
inherited |
The documentation for this class was generated from the following file: