lsst.pipe.tasks
16.0-5-g81851deb+5
|
Public Member Functions | |
def | __init__ (self, modelImages, filterInfo=None) |
def | fromImage (cls, maskedImage, dcrNumSubfilters, filterInfo=None) |
def | fromDataRef (cls, dataRef, dcrNumSubfilters) |
def | __len__ (self) |
def | __getitem__ (self, subfilter) |
def | __setitem__ (self, subfilter, maskedImage) |
def | getBBox (self) |
def | getReferenceImage (self, bbox=None) |
def | assign (self, dcrSubModel, bbox=None) |
def | buildMatchedTemplate (self, warpCtrl, exposure=None, visitInfo=None, bbox=None, wcs=None, mask=None) |
def | conditionDcrModel (self, subfilter, newModel, bbox, gain=1.) |
def | clampModel (self, subfilter, newModel, bbox, statsCtrl, regularizeSigma, modelClampFactor, convergenceMaskPlanes="DETECTED") |
def | regularizeModel (self, bbox, mask, statsCtrl, regularizeSigma, clampFrequency, convergenceMaskPlanes="DETECTED") |
def | calculateNoiseCutoff (self, maskedImage, statsCtrl, regularizeSigma, convergenceMaskPlanes="DETECTED", mask=None) |
Public Attributes | |
dcrNumSubfilters | |
filterInfo | |
modelImages | |
A model of the true sky after correcting chromatic effects. Attributes ---------- dcrNumSubfilters : `int` Number of sub-filters used to model chromatic effects within a band. filterInfo : `lsst.afw.image.Filter` The filter definition, set in the current instruments' obs package. modelImages : `list` of `lsst.afw.image.MaskedImage` A list of masked images, each containing the model for one subfilter Parameters ---------- modelImages : `list` of `lsst.afw.image.MaskedImage` A list of masked images, each containing the model for one subfilter. filterInfo : `lsst.afw.image.Filter`, optional The filter definition, set in the current instruments' obs package. Required for any calculation of DCR, including making matched templates. Notes ----- The ``DcrModel`` contains an estimate of the true sky, at a higher wavelength resolution than the input observations. It can be forward- modeled to produce Differential Chromatic Refraction (DCR) matched templates for a given ``Exposure``, and provides utilities for conditioning the model in ``dcrAssembleCoadd`` to avoid oscillating solutions between iterations of forward modeling or between the subfilters of the model.
Definition at line 35 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.__init__ | ( | self, | |
modelImages, | |||
filterInfo = None |
|||
) |
Definition at line 65 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.__getitem__ | ( | self, | |
subfilter | |||
) |
Iterate over the subfilters of the DCR model. Parameters ---------- subfilter : `int` Index of the current ``subfilter`` within the full band. Negative indices are allowed, and count in reverse order from the highest ``subfilter``. Returns ------- modelImage : `lsst.afw.image.MaskedImage` The DCR model for the given ``subfilter``. Raises ------ IndexError If the requested ``subfilter`` is greater or equal to the number of subfilters in the model.
Definition at line 139 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.__len__ | ( | self | ) |
Return the number of subfilters. Returns ------- dcrNumSubfilters : `int` The number of DCR subfilters in the model.
Definition at line 129 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.__setitem__ | ( | self, | |
subfilter, | |||
maskedImage | |||
) |
Update the model image for one subfilter. Parameters ---------- subfilter : `int` Index of the current subfilter within the full band. maskedImage : `lsst.afw.image.MaskedImage` The DCR model to set for the given ``subfilter``. Raises ------ IndexError If the requested ``subfilter`` is greater or equal to the number of subfilters in the model. ValueError If the bounding box of the new image does not match.
Definition at line 164 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.assign | ( | self, | |
dcrSubModel, | |||
bbox = None |
|||
) |
Update a sub-region of the ``DcrModel`` with new values. Parameters ---------- dcrSubModel : `lsst.pipe.tasks.DcrModel` New model of the true scene after correcting chromatic effects. bbox : `lsst.afw.geom.Box2I`, optional Sub-region of the coadd. Defaults to the bounding box of ``dcrSubModel``. Raises ------ ValueError If the new model has a different number of subfilters.
Definition at line 213 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.buildMatchedTemplate | ( | self, | |
warpCtrl, | |||
exposure = None , |
|||
visitInfo = None , |
|||
bbox = None , |
|||
wcs = None , |
|||
mask = None |
|||
) |
Create a DCR-matched template for an exposure. Parameters ---------- warpCtrl : `lsst.afw.math.WarpingControl` Configuration settings for warping an image exposure : `lsst.afw.image.Exposure`, optional The input exposure to build a matched template for. May be omitted if all of the metadata is supplied separately visitInfo : `lsst.afw.image.VisitInfo`, optional Metadata for the exposure. Ignored if ``exposure`` is set. bbox : `lsst.afw.geom.Box2I`, optional Sub-region of the coadd. Ignored if ``exposure`` is set. wcs : `lsst.afw.geom.SkyWcs`, optional Coordinate system definition (wcs) for the exposure. Ignored if ``exposure`` is set. mask : `lsst.afw.image.Mask`, optional reference mask to use for the template image. Ignored if ``exposure`` is set. Returns ------- templateImage : `lsst.afw.image.maskedImageF` The DCR-matched template Raises ------ ValueError If ``filterInfo`` is not set. ValueError If neither ``exposure`` or all of ``visitInfo``, ``bbox``, and ``wcs`` are set.
Definition at line 237 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.calculateNoiseCutoff | ( | self, | |
maskedImage, | |||
statsCtrl, | |||
regularizeSigma, | |||
convergenceMaskPlanes = "DETECTED" , |
|||
mask = None |
|||
) |
Helper function to calculate the background noise level of an image. Parameters ---------- maskedImage : `lsst.afw.image.MaskedImage` The input image to evaluate the background noise properties. statsCtrl : `lsst.afw.math.StatisticsControl` Statistics control object for coadd regularizeSigma : `float` Threshold to exclude noise-like pixels from regularization. convergenceMaskPlanes : `list` of `str`, or `str` Mask planes to use to calculate convergence. mask : `lsst.afw.image.Mask`, Optional Optional alternate mask Returns ------- noiseCutoff : `float` The threshold value to treat pixels as noise in an image..
Definition at line 396 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.clampModel | ( | self, | |
subfilter, | |||
newModel, | |||
bbox, | |||
statsCtrl, | |||
regularizeSigma, | |||
modelClampFactor, | |||
convergenceMaskPlanes = "DETECTED" |
|||
) |
Restrict large variations in the model between iterations. Parameters ---------- subfilter : `int` Index of the current subfilter within the full band. newModel : `lsst.afw.image.MaskedImage` The new DCR model for one subfilter from the current iteration. Values in ``newModel`` that are extreme compared with the last iteration are modified in place. bbox : `lsst.afw.geom.Box2I` Sub-region to coadd statsCtrl : `lsst.afw.math.StatisticsControl` Statistics control object for coadd regularizeSigma : `float` Threshold to exclude noise-like pixels from regularization. modelClampFactor : `float` Maximum relative change of the model allowed between iterations. convergenceMaskPlanes : `list` of `str`, or `str`, optional Mask planes to use to calculate convergence. Default value is set in ``calculateNoiseCutoff`` if not supplied.
Definition at line 313 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.conditionDcrModel | ( | self, | |
subfilter, | |||
newModel, | |||
bbox, | |||
gain = 1. |
|||
) |
Average two iterations' solutions to reduce oscillations. Parameters ---------- subfilter : `int` Index of the current subfilter within the full band. newModel : `lsst.afw.image.MaskedImage` The new DCR model for one subfilter from the current iteration. Values in ``newModel`` that are extreme compared with the last iteration are modified in place. bbox : `lsst.afw.geom.Box2I` Sub-region of the coadd gain : `float`, optional Additional weight to apply to the model from the current iteration. Defaults to 1.0, which gives equal weight to both solutions.
Definition at line 286 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.fromDataRef | ( | cls, | |
dataRef, | |||
dcrNumSubfilters | |||
) |
Load an existing DcrModel from a repository. Parameters ---------- dataRef : `lsst.daf.persistence.ButlerDataRef` Data reference defining the patch for coaddition and the reference Warp dcrNumSubfilters : `int` Number of sub-filters used to model chromatic effects within a band. Returns ------- dcrModel : `lsst.pipe.tasks.DcrModel` Best fit model of the true sky after correcting chromatic effects.
Definition at line 104 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.fromImage | ( | cls, | |
maskedImage, | |||
dcrNumSubfilters, | |||
filterInfo = None |
|||
) |
Initialize a DcrModel by dividing a coadd between the subfilters. Parameters ---------- maskedImage : `lsst.afw.image.MaskedImage` Input coadded image to divide equally between the subfilters. dcrNumSubfilters : `int` Number of sub-filters used to model chromatic effects within a band. filterInfo : None, optional The filter definition, set in the current instruments' obs package. Required for any calculation of DCR, including making matched templates. Returns ------- dcrModel : `lsst.pipe.tasks.DcrModel` Best fit model of the true sky after correcting chromatic effects.
Definition at line 71 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.getBBox | ( | self | ) |
Return the common bounding box of each subfilter image. Returns ------- bbox : `lsst.afw.geom.Box2I` Bounding box of the DCR model.
Definition at line 188 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.getReferenceImage | ( | self, | |
bbox = None |
|||
) |
Create a simple template from the DCR model. Parameters ---------- bbox : `lsst.afw.geom.Box2I`, optional Sub-region of the coadd. Returns the entire image if None. Returns ------- templateImage : `numpy.ndarray` The template with no chromatic effects applied.
Definition at line 198 of file dcrModel.py.
def lsst.pipe.tasks.dcrModel.DcrModel.regularizeModel | ( | self, | |
bbox, | |||
mask, | |||
statsCtrl, | |||
regularizeSigma, | |||
clampFrequency, | |||
convergenceMaskPlanes = "DETECTED" |
|||
) |
Restrict large variations in the model between subfilters. Any flux subtracted by the restriction is accumulated from all subfilters, and divided evenly to each afterwards in order to preserve total flux. Parameters ---------- bbox : `lsst.afw.geom.Box2I` Sub-region to coadd mask : `lsst.afw.image.Mask` Reference mask to use for all model planes. statsCtrl : `lsst.afw.math.StatisticsControl` Statistics control object for coadd regularizeSigma : `float` Threshold to exclude noise-like pixels from regularization. clampFrequency : `float` Maximum relative change of the model allowed between subfilters. convergenceMaskPlanes : `list` of `str`, or `str`, optional Mask planes to use to calculate convergence. (Default is "DETECTED") Default value is set in ``calculateNoiseCutoff`` if not supplied.
Definition at line 355 of file dcrModel.py.
lsst.pipe.tasks.dcrModel.DcrModel.dcrNumSubfilters |
Definition at line 66 of file dcrModel.py.
lsst.pipe.tasks.dcrModel.DcrModel.filterInfo |
Definition at line 67 of file dcrModel.py.
lsst.pipe.tasks.dcrModel.DcrModel.modelImages |
Definition at line 68 of file dcrModel.py.