LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self, modelImages, effectiveWavelength, bandwidth, filterLabel=None, psf=None, bbox=None, wcs=None, mask=None, variance=None, photoCalib=None) | |
fromImage (cls, maskedImage, dcrNumSubfilters, effectiveWavelength, bandwidth, wcs=None, filterLabel=None, psf=None, photoCalib=None) | |
fromQuantum (cls, availableCoaddRefs, effectiveWavelength, bandwidth, numSubfilters) | |
__len__ (self) | |
__getitem__ (self, subfilter) | |
__setitem__ (self, subfilter, maskedImage) | |
effectiveWavelength (self) | |
filter (self) | |
bandwidth (self) | |
psf (self) | |
bbox (self) | |
wcs (self) | |
mask (self) | |
variance (self) | |
getReferenceImage (self, bbox=None) | |
assign (self, dcrSubModel, bbox=None) | |
buildMatchedTemplate (self, exposure=None, order=3, visitInfo=None, bbox=None, mask=None, splitSubfilters=True, splitThreshold=0., amplifyModel=1.) | |
buildMatchedExposure (self, exposure=None, visitInfo=None, bbox=None, mask=None) | |
conditionDcrModel (self, modelImages, bbox, gain=1.) | |
regularizeModelIter (self, subfilter, newModel, bbox, regularizationFactor, regularizationWidth=2) | |
regularizeModelFreq (self, modelImages, bbox, statsCtrl, regularizationFactor, regularizationWidth=2, mask=None, convergenceMaskPlanes="DETECTED") | |
calculateNoiseCutoff (self, image, statsCtrl, bufferSize, convergenceMaskPlanes="DETECTED", mask=None, bbox=None) | |
applyImageThresholds (self, image, highThreshold=None, lowThreshold=None, regularizationWidth=2) | |
Public Attributes | |
dcrNumSubfilters | |
modelImages | |
photoCalib | |
psf | |
filter | |
Protected Attributes | |
_filterLabel | |
_effectiveWavelength | |
_bandwidth | |
_psf | |
_bbox | |
_wcs | |
_mask | |
_variance | |
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. modelImages : `list` of `lsst.afw.image.Image` A list of masked images, each containing the model for one subfilter 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 32 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.__init__ | ( | self, | |
modelImages, | |||
effectiveWavelength, | |||
bandwidth, | |||
filterLabel = None, | |||
psf = None, | |||
bbox = None, | |||
wcs = None, | |||
mask = None, | |||
variance = None, | |||
photoCalib = None ) |
Definition at line 52 of file dcrModel.py.
lsst.ip.diffim.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.Image` 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 181 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.__len__ | ( | self | ) |
Return the number of subfilters. Returns ------- dcrNumSubfilters : `int` The number of DCR subfilters in the model.
Definition at line 171 of file dcrModel.py.
lsst.ip.diffim.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.Image` 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 206 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.applyImageThresholds | ( | self, | |
image, | |||
highThreshold = None, | |||
lowThreshold = None, | |||
regularizationWidth = 2 ) |
Restrict image values to be between upper and lower limits. This method flags all pixels in an image that are outside of the given threshold values. The threshold values are taken from a reference image, so noisy pixels are likely to get flagged. In order to exclude those noisy pixels, the array of flags is eroded and dilated, which removes isolated pixels outside of the thresholds from the list of pixels to be modified. Pixels that remain flagged after this operation have their values set to the appropriate upper or lower threshold value. Parameters ---------- image : `numpy.ndarray` The image to apply the thresholds to. The values will be modified in place. highThreshold : `numpy.ndarray`, optional Array of upper limit values for each pixel of ``image``. lowThreshold : `numpy.ndarray`, optional Array of lower limit values for each pixel of ``image``. regularizationWidth : `int`, optional Minimum radius of a region to include in regularization, in pixels.
Definition at line 623 of file dcrModel.py.
lsst.ip.diffim.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 335 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.bandwidth | ( | self | ) |
Return the bandwidth of the model. Returns ------- bandwidth : `float` The bandwidth of the current filter, in nanometers.
Definition at line 253 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.bbox | ( | 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 275 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.buildMatchedExposure | ( | self, | |
exposure = None, | |||
visitInfo = None, | |||
bbox = None, | |||
mask = None ) |
Wrapper to create an exposure from a template image. Parameters ---------- 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, or use the entire coadd if not supplied. mask : `lsst.afw.image.Mask`, optional reference mask to use for the template image. Returns ------- templateExposure : `lsst.afw.image.exposureF` The DCR-matched template Raises ------ RuntimeError If no `photcCalib` is set.
Definition at line 426 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.buildMatchedTemplate | ( | self, | |
exposure = None, | |||
order = 3, | |||
visitInfo = None, | |||
bbox = None, | |||
mask = None, | |||
splitSubfilters = True, | |||
splitThreshold = 0., | |||
amplifyModel = 1. ) |
Create a DCR-matched template image for an exposure. Parameters ---------- 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 order : `int`, optional Interpolation order of the DCR shift. 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, or use the entire coadd if not supplied. mask : `lsst.afw.image.Mask`, optional reference mask to use for the template image. splitSubfilters : `bool`, optional Calculate DCR for two evenly-spaced wavelengths in each subfilter, instead of at the midpoint. Default: True splitThreshold : `float`, optional Minimum DCR difference within a subfilter required to use ``splitSubfilters`` amplifyModel : `float`, optional Multiplication factor to amplify differences between model planes. Used to speed convergence of iterative forward modeling. Returns ------- templateImage : `lsst.afw.image.ImageF` The DCR-matched template Raises ------ ValueError If neither ``exposure`` or ``visitInfo`` are set.
Definition at line 358 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.calculateNoiseCutoff | ( | self, | |
image, | |||
statsCtrl, | |||
bufferSize, | |||
convergenceMaskPlanes = "DETECTED", | |||
mask = None, | |||
bbox = None ) |
Helper function to calculate the background noise level of an image. Parameters ---------- image : `lsst.afw.image.Image` The input image to evaluate the background noise properties. statsCtrl : `lsst.afw.math.StatisticsControl` Statistics control object for coaddition. bufferSize : `int` Number of additional pixels to exclude from the edges of the bounding box. convergenceMaskPlanes : `list` of `str`, or `str` Mask planes to use to calculate convergence. mask : `lsst.afw.image.Mask`, Optional Optional alternate mask bbox : `lsst.afw.geom.Box2I`, optional Sub-region of the masked image to calculate the noise level over. Returns ------- noiseCutoff : `float` The threshold value to treat pixels as noise in an image..
Definition at line 586 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.conditionDcrModel | ( | self, | |
modelImages, | |||
bbox, | |||
gain = 1. ) |
Average two iterations' solutions to reduce oscillations. Parameters ---------- modelImages : `list` of `lsst.afw.image.Image` The new DCR model images from the current iteration. The values will be modified in place. bbox : `lsst.afw.geom.Box2I` Sub-region of the coadd gain : `float`, optional Relative weight to give the new solution when updating the model. Defaults to 1.0, which gives equal weight to both solutions.
Definition at line 474 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.effectiveWavelength | ( | self | ) |
Return the effective wavelength of the model. Returns ------- effectiveWavelength : `float` The effective wavelength of the current filter, in nanometers.
Definition at line 231 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.filter | ( | self | ) |
Return the filter label for the model. Returns ------- filterLabel : `lsst.afw.image.FilterLabel` The filter used for the input observations.
Definition at line 242 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.fromImage | ( | cls, | |
maskedImage, | |||
dcrNumSubfilters, | |||
effectiveWavelength, | |||
bandwidth, | |||
wcs = None, | |||
filterLabel = None, | |||
psf = None, | |||
photoCalib = 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. effectiveWavelength : `float` The effective wavelengths of the current filter, in nanometers. bandwidth : `float` The bandwidth of the current filter, in nanometers. wcs : `lsst.afw.geom.SkyWcs` Coordinate system definition (wcs) for the exposure. filterLabel : `lsst.afw.image.FilterLabel`, optional The filter label, set in the current instruments' obs package. Required for any calculation of DCR, including making matched templates. psf : `lsst.afw.detection.Psf`, optional Point spread function (PSF) of the model. Required if the ``DcrModel`` will be persisted. photoCalib : `lsst.afw.image.PhotoCalib`, optional Calibration to convert instrumental flux and flux error to nanoJansky. Returns ------- dcrModel : `lsst.pipe.tasks.DcrModel` Best fit model of the true sky after correcting chromatic effects.
Definition at line 67 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.fromQuantum | ( | cls, | |
availableCoaddRefs, | |||
effectiveWavelength, | |||
bandwidth, | |||
numSubfilters ) |
Load an existing DcrModel from a Gen 3 repository. Parameters ---------- availableCoaddRefs : `dict` [`int`, `lsst.daf.butler.DeferredDatasetHandle`] Dictionary of spatially relevant retrieved coadd patches, indexed by their sequential patch number. effectiveWavelength : `float` The effective wavelengths of the current filter, in nanometers. bandwidth : `float` The bandwidth of the current filter, in nanometers. numSubfilters : `int` Number of subfilters in the DcrCoadd. Returns ------- dcrModel : `lsst.pipe.tasks.DcrModel` Best fit model of the true sky after correcting chromatic effects.
Definition at line 121 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.getReferenceImage | ( | self, | |
bbox = None ) |
Calculate a reference image from the average of the subfilter images. Parameters ---------- bbox : `lsst.afw.geom.Box2I`, optional Sub-region of the coadd. Returns the entire image if `None`. Returns ------- refImage : `numpy.ndarray` The reference image with no chromatic effects applied.
Definition at line 318 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.mask | ( | self | ) |
Return the common mask of each subfilter image. Returns ------- mask : `lsst.afw.image.Mask` Mask plane of the DCR model.
Definition at line 297 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.psf | ( | self | ) |
Return the psf of the model. Returns ------- psf : `lsst.afw.detection.Psf` Point spread function (PSF) of the model.
Definition at line 264 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.regularizeModelFreq | ( | self, | |
modelImages, | |||
bbox, | |||
statsCtrl, | |||
regularizationFactor, | |||
regularizationWidth = 2, | |||
mask = None, | |||
convergenceMaskPlanes = "DETECTED" ) |
Restrict large variations in the model between subfilters. Parameters ---------- modelImages : `list` of `lsst.afw.image.Image` The new DCR model images from the current iteration. The values will be modified in place. bbox : `lsst.afw.geom.Box2I` Sub-region to coadd statsCtrl : `lsst.afw.math.StatisticsControl` Statistics control object for coaddition. regularizationFactor : `float` Maximum relative change of the model allowed between subfilters. regularizationWidth : `int`, optional Minimum radius of a region to include in regularization, in pixels. mask : `lsst.afw.image.Mask`, optional Optional alternate mask convergenceMaskPlanes : `list` of `str`, or `str`, optional Mask planes to use to calculate convergence. Notes ----- This implementation of frequency regularization restricts each subfilter image to be a smoothly-varying function times a reference image.
Definition at line 520 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.regularizeModelIter | ( | self, | |
subfilter, | |||
newModel, | |||
bbox, | |||
regularizationFactor, | |||
regularizationWidth = 2 ) |
Restrict large variations in the model between iterations. Parameters ---------- subfilter : `int` Index of the current subfilter within the full band. newModel : `lsst.afw.image.Image` 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 regularizationFactor : `float` Maximum relative change of the model allowed between iterations. regularizationWidth : int, optional Minimum radius of a region to include in regularization, in pixels.
Definition at line 494 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.variance | ( | self | ) |
Return the common variance of each subfilter image. Returns ------- variance : `lsst.afw.image.Image` Variance plane of the DCR model.
Definition at line 308 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.wcs | ( | self | ) |
Return the WCS of each subfilter image. Returns ------- bbox : `lsst.afw.geom.SkyWcs` Coordinate system definition (wcs) for the exposure.
Definition at line 286 of file dcrModel.py.
|
protected |
Definition at line 58 of file dcrModel.py.
|
protected |
Definition at line 60 of file dcrModel.py.
|
protected |
Definition at line 57 of file dcrModel.py.
|
protected |
Definition at line 56 of file dcrModel.py.
|
protected |
Definition at line 62 of file dcrModel.py.
|
protected |
Definition at line 59 of file dcrModel.py.
|
protected |
Definition at line 63 of file dcrModel.py.
|
protected |
Definition at line 61 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.dcrNumSubfilters |
Definition at line 54 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.filter |
Definition at line 466 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.modelImages |
Definition at line 55 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.photoCalib |
Definition at line 64 of file dcrModel.py.
lsst.ip.diffim.dcrModel.DcrModel.psf |
Definition at line 465 of file dcrModel.py.