LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
Classes | |
class | DcrAssembleCoaddConnections |
Functions | |
def | dcrAssembleSubregion (self, dcrModels, subExposures, bbox, dcrBBox, warpRefList, statsCtrl, convergenceMetric, gain, modelWeights, refImage, dcrWeights) |
def | dcrResiduals (self, residual, visitInfo, wcs, effectiveWavelength, bandwidth) |
def | newModelFromResidual (self, dcrModels, residualGeneratorList, dcrBBox, statsCtrl, gain, modelWeights, refImage, dcrWeights) |
def | calculateConvergence (self, dcrModels, subExposures, bbox, warpRefList, weightList, statsCtrl) |
def | calculateSingleConvergence (self, dcrModels, exposure, significanceImage, statsCtrl) |
def | stackCoadd (self, dcrCoadds) |
def | fillCoadd (self, dcrModels, skyInfo, warpRefList, weightList, calibration=None, coaddInputs=None, mask=None, variance=None) |
def | calculateGain (self, convergenceList, gainList) |
def | calculateModelWeights (self, dcrModels, dcrBBox) |
def | applyModelWeights (self, modelImages, refImage, modelWeights) |
def | loadSubExposures (self, bbox, statsCtrl, warpRefList, imageScalerList, spanSetMaskList) |
def | selectCoaddPsf (self, templateCoadd, warpRefList) |
Variables | |
int | weightsThreshold = 1. |
int | goodPix = dcrWeights[0].array > weightsThreshold |
def lsst.pipe.tasks.dcrAssembleCoadd.applyModelWeights | ( | self, | |
modelImages, | |||
refImage, | |||
modelWeights | |||
) |
Smoothly replace model pixel values with those from a reference at locations away from detected sources. Parameters ---------- modelImages : `list` of `lsst.afw.image.Image` The new DCR model images from the current iteration. The values will be modified in place. refImage : `lsst.afw.image.MaskedImage` A reference image used to supply the default pixel values. modelWeights : `numpy.ndarray` or `float` A 2D array of weight values that tapers smoothly to zero away from detected sources. Set to a placeholder value of 1.0 if ``self.config.useModelWeights`` is False.
Definition at line 1234 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.calculateConvergence | ( | self, | |
dcrModels, | |||
subExposures, | |||
bbox, | |||
warpRefList, | |||
weightList, | |||
statsCtrl | |||
) |
Calculate a quality of fit metric for the matched templates. Parameters ---------- dcrModels : `lsst.pipe.tasks.DcrModel` Best fit model of the true sky after correcting chromatic effects. subExposures : `dict` of `lsst.afw.image.ExposureF` The pre-loaded exposures for the current subregion. bbox : `lsst.geom.box.Box2I` Sub-region to coadd warpRefList : `list` of `lsst.daf.butler.DeferredDatasetHandle` or `lsst.daf.persistence.ButlerDataRef` The data references to the input warped exposures. weightList : `list` of `float` The weight to give each input exposure in the coadd statsCtrl : `lsst.afw.math.StatisticsControl` Statistics control object for coadd Returns ------- convergenceMetric : `float` Quality of fit metric for all input exposures, within the sub-region
Definition at line 959 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.calculateGain | ( | self, | |
convergenceList, | |||
gainList | |||
) |
Calculate the gain to use for the current iteration. After calculating a new DcrModel, each value is averaged with the value in the corresponding pixel from the previous iteration. This reduces oscillating solutions that iterative techniques are plagued by, and speeds convergence. By far the biggest changes to the model happen in the first couple iterations, so we can also use a more aggressive gain later when the model is changing slowly. Parameters ---------- convergenceList : `list` of `float` The quality of fit metric from each previous iteration. gainList : `list` of `float` The gains used in each previous iteration: appended with the new gain value. Gains are numbers between ``self.config.baseGain`` and 1. Returns ------- gain : `float` Relative weight to give the new solution when updating the model. A value of 1.0 gives equal weight to both solutions. Raises ------ ValueError If ``len(convergenceList) != len(gainList)+1``.
Definition at line 1120 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.calculateModelWeights | ( | self, | |
dcrModels, | |||
dcrBBox | |||
) |
Build an array that smoothly tapers to 0 away from detected sources. Parameters ---------- dcrModels : `lsst.pipe.tasks.DcrModel` Best fit model of the true sky after correcting chromatic effects. dcrBBox : `lsst.geom.box.Box2I` Sub-region of the coadd which includes a buffer to allow for DCR. Returns ------- weights : `numpy.ndarray` or `float` A 2D array of weight values that tapers smoothly to zero away from detected sources. Set to a placeholder value of 1.0 if ``self.config.useModelWeights`` is False. Raises ------ ValueError If ``useModelWeights`` is set and ``modelWeightsWidth`` is negative.
Definition at line 1201 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.calculateSingleConvergence | ( | self, | |
dcrModels, | |||
exposure, | |||
significanceImage, | |||
statsCtrl | |||
) |
Calculate a quality of fit metric for a single matched template. Parameters ---------- dcrModels : `lsst.pipe.tasks.DcrModel` Best fit model of the true sky after correcting chromatic effects. exposure : `lsst.afw.image.ExposureF` The input warped exposure to evaluate. significanceImage : `numpy.ndarray` Array of weights for each pixel corresponding to its significance for the convergence calculation. statsCtrl : `lsst.afw.math.StatisticsControl` Statistics control object for coadd Returns ------- convergenceMetric : `float` Quality of fit metric for one exposure, within the sub-region.
Definition at line 1002 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.dcrAssembleSubregion | ( | self, | |
dcrModels, | |||
subExposures, | |||
bbox, | |||
dcrBBox, | |||
warpRefList, | |||
statsCtrl, | |||
convergenceMetric, | |||
gain, | |||
modelWeights, | |||
refImage, | |||
dcrWeights | |||
) |
Assemble the DCR coadd for a sub-region. Build a DCR-matched template for each input exposure, then shift the residuals according to the DCR in each subfilter. Stack the shifted residuals and apply them as a correction to the solution from the previous iteration. Restrict the new model solutions from varying by more than a factor of `modelClampFactor` from the last solution, and additionally restrict the individual subfilter models from varying by more than a factor of `frequencyClampFactor` from their average. Finally, mitigate potentially oscillating solutions by averaging the new solution with the solution from the previous iteration, weighted by their convergence metric. Parameters ---------- dcrModels : `lsst.pipe.tasks.DcrModel` Best fit model of the true sky after correcting chromatic effects. subExposures : `dict` of `lsst.afw.image.ExposureF` The pre-loaded exposures for the current subregion. bbox : `lsst.geom.box.Box2I` Bounding box of the subregion to coadd. dcrBBox : `lsst.geom.box.Box2I` Sub-region of the coadd which includes a buffer to allow for DCR. warpRefList : `list` of `lsst.daf.butler.DeferredDatasetHandle` or `lsst.daf.persistence.ButlerDataRef` The data references to the input warped exposures. statsCtrl : `lsst.afw.math.StatisticsControl` Statistics control object for coadd convergenceMetric : `float` Quality of fit metric for the matched templates of the input images. gain : `float`, optional Relative weight to give the new solution when updating the model. modelWeights : `numpy.ndarray` or `float` A 2D array of weight values that tapers smoothly to zero away from detected sources. Set to a placeholder value of 1.0 if ``self.config.useModelWeights`` is False. refImage : `lsst.afw.image.Image` A reference image used to supply the default pixel values. dcrWeights : `list` of `lsst.afw.image.Image` Per-pixel weights for each subfilter. Equal to 1/(number of unmasked images contributing to each pixel).
Definition at line 800 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.dcrResiduals | ( | self, | |
residual, | |||
visitInfo, | |||
wcs, | |||
effectiveWavelength, | |||
bandwidth | |||
) |
Prepare a residual image for stacking in each subfilter by applying the reverse DCR shifts. Parameters ---------- residual : `numpy.ndarray` The residual masked image for one exposure, after subtracting the matched template visitInfo : `lsst.afw.image.VisitInfo` Metadata for the exposure. wcs : `lsst.afw.geom.SkyWcs` Coordinate system definition (wcs) for the exposure. Yields ------ residualImage : `numpy.ndarray` The residual image for the next subfilter, shifted for DCR.
Definition at line 874 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.fillCoadd | ( | self, | |
dcrModels, | |||
skyInfo, | |||
warpRefList, | |||
weightList, | |||
calibration = None , |
|||
coaddInputs = None , |
|||
mask = None , |
|||
variance = None |
|||
) |
Create a list of coadd exposures from a list of masked images. Parameters ---------- dcrModels : `lsst.pipe.tasks.DcrModel` Best fit model of the true sky after correcting chromatic effects. skyInfo : `lsst.pipe.base.Struct` Patch geometry information, from getSkyInfo warpRefList : `list` of `lsst.daf.butler.DeferredDatasetHandle` or `lsst.daf.persistence.ButlerDataRef` The data references to the input warped exposures. weightList : `list` of `float` The weight to give each input exposure in the coadd calibration : `lsst.afw.Image.PhotoCalib`, optional Scale factor to set the photometric calibration of an exposure. coaddInputs : `lsst.afw.Image.CoaddInputs`, optional A record of the observations that are included in the coadd. mask : `lsst.afw.image.Mask`, optional Optional mask to override the values in the final coadd. variance : `lsst.afw.image.Image`, optional Optional variance plane to override the values in the final coadd. Returns ------- dcrCoadds : `list` of `lsst.afw.image.ExposureF` A list of coadd exposures, each exposure containing the model for one subfilter.
Definition at line 1062 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.loadSubExposures | ( | self, | |
bbox, | |||
statsCtrl, | |||
warpRefList, | |||
imageScalerList, | |||
spanSetMaskList | |||
) |
Pre-load sub-regions of a list of exposures. Parameters ---------- bbox : `lsst.geom.box.Box2I` Sub-region to coadd statsCtrl : `lsst.afw.math.StatisticsControl` Statistics control object for coadd warpRefList : `list` of `lsst.daf.butler.DeferredDatasetHandle` or `lsst.daf.persistence.ButlerDataRef` The data references to the input warped exposures. imageScalerList : `list` of `lsst.pipe.task.ImageScaler` The image scalars correct for the zero point of the exposures. spanSetMaskList : `list` of `dict` containing spanSet lists, or None Each element is dict with keys = mask plane name to add the spans to Returns ------- subExposures : `dict` The `dict` keys are the visit IDs, and the values are `lsst.afw.image.ExposureF` The pre-loaded exposures for the current subregion. The variance plane contains weights, and not the variance
Definition at line 1254 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.newModelFromResidual | ( | self, | |
dcrModels, | |||
residualGeneratorList, | |||
dcrBBox, | |||
statsCtrl, | |||
gain, | |||
modelWeights, | |||
refImage, | |||
dcrWeights | |||
) |
Calculate a new DcrModel from a set of image residuals. Parameters ---------- dcrModels : `lsst.pipe.tasks.DcrModel` Current model of the true sky after correcting chromatic effects. residualGeneratorList : `generator` of `numpy.ndarray` The residual image for the next subfilter, shifted for DCR. dcrBBox : `lsst.geom.box.Box2I` Sub-region of the coadd which includes a buffer to allow for DCR. statsCtrl : `lsst.afw.math.StatisticsControl` Statistics control object for coadd gain : `float` Relative weight to give the new solution when updating the model. modelWeights : `numpy.ndarray` or `float` A 2D array of weight values that tapers smoothly to zero away from detected sources. Set to a placeholder value of 1.0 if ``self.config.useModelWeights`` is False. refImage : `lsst.afw.image.Image` A reference image used to supply the default pixel values. dcrWeights : `list` of `lsst.afw.image.Image` Per-pixel weights for each subfilter. Equal to 1/(number of unmasked images contributing to each pixel). Returns ------- dcrModel : `lsst.pipe.tasks.DcrModel` New model of the true sky after correcting chromatic effects.
Definition at line 903 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.selectCoaddPsf | ( | self, | |
templateCoadd, | |||
warpRefList | |||
) |
Compute the PSF of the coadd from the exposures with the best seeing. Parameters ---------- templateCoadd : `lsst.afw.image.ExposureF` The initial coadd exposure before accounting for DCR. warpRefList : `list` of `lsst.daf.butler.DeferredDatasetHandle` or `lsst.daf.persistence.ButlerDataRef` The data references to the input warped exposures. Returns ------- psf : `lsst.meas.algorithms.CoaddPsf` The average PSF of the input exposures with the best seeing.
Definition at line 1301 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.stackCoadd | ( | self, | |
dcrCoadds | |||
) |
Add a list of sub-band coadds together. Parameters ---------- dcrCoadds : `list` of `lsst.afw.image.ExposureF` A list of coadd exposures, each exposure containing the model for one subfilter. Returns ------- coaddExposure : `lsst.afw.image.ExposureF` A single coadd exposure that is the sum of the sub-bands.
Definition at line 1043 of file dcrAssembleCoadd.py.
tuple lsst.pipe.tasks.dcrAssembleCoadd.goodPix = dcrWeights[0].array > weightsThreshold |
Definition at line 791 of file dcrAssembleCoadd.py.
int lsst.pipe.tasks.dcrAssembleCoadd.weightsThreshold = 1. |
Definition at line 790 of file dcrAssembleCoadd.py.