lsst.ip.diffim gaa63f70f4e+5e034ae04a
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Attributes | List of all members
lsst.ip.diffim.makeKernel.MakeKernelTask Class Reference
Inheritance diagram for lsst.ip.diffim.makeKernel.MakeKernelTask:
lsst.ip.diffim.psfMatch.PsfMatchTask

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def run (self, template, science, kernelSources, preconvolved=False)
 
def selectKernelSources (self, template, science, candidateList=None, preconvolved=False)
 
def getSelectSources (self, exposure, sigma=None, doSmooth=True, idFactory=None)
 
def makeCandidateList (self, templateExposure, scienceExposure, kernelSize, candidateList=None, preconvolved=False)
 
def makeKernelBasisList (self, targetFwhmPix=None, referenceFwhmPix=None, basisDegGauss=None, basisSigmaGauss=None, metadata=None)
 

Public Attributes

 kConfig
 
 background
 
 selectSchema
 
 selectAlgMetadata
 

Static Public Attributes

MakeKernelConfig ConfigClass = MakeKernelConfig
 

Protected Member Functions

def _buildCellSet (self, templateMaskedImage, scienceMaskedImage, candidateList)
 
def _adaptCellSize (self, candidateList)
 

Static Protected Attributes

str _DefaultName = "makeALKernel"
 

Detailed Description

Construct a kernel for PSF matching two exposures.

Definition at line 76 of file makeKernel.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.ip.diffim.makeKernel.MakeKernelTask.__init__ (   self,
args,
**  kwargs 
)
Create the psf-matching Task

Parameters
----------
*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__``

Notes
-----
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.

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

Definition at line 83 of file makeKernel.py.

Member Function Documentation

◆ _adaptCellSize()

def 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 383 of file makeKernel.py.

◆ _buildCellSet()

def lsst.ip.diffim.makeKernel.MakeKernelTask._buildCellSet (   self,
  templateMaskedImage,
  scienceMaskedImage,
  candidateList 
)
protected
Build a SpatialCellSet for use with the solve method.

Parameters
----------
templateMaskedImage : `lsst.afw.image.MaskedImage`
    MaskedImage to PSF-matched to scienceMaskedImage
scienceMaskedImage : `lsst.afw.image.MaskedImage`
    Reference MaskedImage
candidateList : `list`
    A list of footprints/maskedImages for kernel candidates;

    - Currently supported: list of Footprints or measAlg.PsfCandidateF

Returns
-------
kernelCellSet : `lsst.afw.math.SpatialCellSet`
    a SpatialCellSet for use with self._solve

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

Definition at line 333 of file makeKernel.py.

◆ getSelectSources()

def 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 167 of file makeKernel.py.

◆ makeCandidateList()

def lsst.ip.diffim.makeKernel.MakeKernelTask.makeCandidateList (   self,
  templateExposure,
  scienceExposure,
  kernelSize,
  candidateList = None,
  preconvolved = False 
)
Make a list of acceptable KernelCandidates.

Accept or generate a list of candidate sources for
Psf-matching, and examine the Mask planes in both of the
images for indications of bad pixels

Parameters
----------
templateExposure : `lsst.afw.image.Exposure`
    Exposure that will be convolved
scienceExposure : `lsst.afw.image.Exposure`
    Exposure that will be matched-to
kernelSize : `float`
    Dimensions of the Psf-matching Kernel, used to grow detection footprints
candidateList : `list`, optional
    List of Sources to examine. Elements must be of type afw.table.Source
    or a type that wraps a Source and has a getSource() method, such as
    meas.algorithms.PsfCandidateF.
preconvolved : `bool`, optional
    Was the science exposure already convolved with its PSF?

Returns
-------
candidateList : `list` of `dict`
    A list of dicts having a "source" and "footprint"
    field for the Sources deemed to be appropriate for Psf
    matching.

Raises
------
RuntimeError
    If ``candidateList`` is empty or contains incompatible types.

Definition at line 226 of file makeKernel.py.

◆ makeKernelBasisList()

def 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 290 of file makeKernel.py.

◆ run()

def lsst.ip.diffim.makeKernel.MakeKernelTask.run (   self,
  template,
  science,
  kernelSources,
  preconvolved = False 
)
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 : `list` of `dict`
    A list of dicts having a "source" and "footprint"
    field for the Sources deemed to be appropriate for Psf
    matching. Can be the output from ``selectKernelSources``.
preconvolved : `bool`, optional
    Was the science image convolved with its own PSF?

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 95 of file makeKernel.py.

◆ selectKernelSources()

def lsst.ip.diffim.makeKernel.MakeKernelTask.selectKernelSources (   self,
  template,
  science,
  candidateList = None,
  preconvolved = False 
)
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 : `list`, optional
    List of Sources to examine. Elements must be of type afw.table.Source
    or a type that wraps a Source and has a getSource() method, such as
    meas.algorithms.PsfCandidateF.
preconvolved : `bool`, optional
    Was the science image convolved with its own PSF?

Returns
-------
kernelSources : `list` of `dict`
    A list of dicts having a "source" and "footprint"
    field for the Sources deemed to be appropriate for Psf
    matching.

Definition at line 134 of file makeKernel.py.

Member Data Documentation

◆ _DefaultName

str lsst.ip.diffim.makeKernel.MakeKernelTask._DefaultName = "makeALKernel"
staticprotected

Definition at line 81 of file makeKernel.py.

◆ background

lsst.ip.diffim.makeKernel.MakeKernelTask.background

Definition at line 88 of file makeKernel.py.

◆ ConfigClass

MakeKernelConfig lsst.ip.diffim.makeKernel.MakeKernelTask.ConfigClass = MakeKernelConfig
static

Definition at line 80 of file makeKernel.py.

◆ kConfig

lsst.ip.diffim.makeKernel.MakeKernelTask.kConfig

Definition at line 85 of file makeKernel.py.

◆ selectAlgMetadata

lsst.ip.diffim.makeKernel.MakeKernelTask.selectAlgMetadata

Definition at line 91 of file makeKernel.py.

◆ selectSchema

lsst.ip.diffim.makeKernel.MakeKernelTask.selectSchema

Definition at line 90 of file makeKernel.py.


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