MakeKernelTask#
- class lsst.ip.diffim.MakeKernelTask(*args, **kwargs)#
Bases:
PsfMatchTaskConstruct a kernel for PSF matching two exposures.
Methods Summary
getSelectSources(exposure[, sigma, ...])Get sources to use for Psf-matching.
makeCandidateList(convolved, reference, ...)Make a list of acceptable KernelCandidates.
makeKernelBasisList([targetFwhmPix, ...])Wrapper to set log messages for
lsst.ip.diffim.makeKernelBasisList.run(template, science, kernelSources[, ...])Solve for the kernel and background model that best match two Exposures evaluated at the given source locations.
selectKernelSources(template, science[, ...])Select sources from a list of candidates, and extract footprints.
Methods Documentation
- getSelectSources(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
- exposure
- makeCandidateList(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
kernelSizebox.
Raises#
- RuntimeError
If
candidateListis empty after sub-selection.
- convolved
- makeKernelBasisList(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
listofint, optional Passed on to
lsst.ip.diffim.generateAlardLuptonBasisList. Not used for delta function basis sets.- basisSigmaGauss
listofint, 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:
listoflsst.afw.math.kernel.FixedKernel List of basis kernels.
- targetFwhmPix
- run(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?
Returns#
results :
lsst.pipe.base.StructpsfMatchingKernellsst.afw.math.LinearCombinationKernelSpatially varying Psf-matching kernel.
backgroundModellsst.afw.math.Function2DSpatially varying background-matching function.
- template
- selectKernelSources(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?
Returns#
- kernelSources
lsst.afw.table.SourceCatalog Kernel candidates with appropriate sized footprints.
- template