lsst.pipe.tasks g4a941329ef+046d1863bc
|
Classes | |
class | DcrAssembleCoaddConnections |
Functions | |
dcrAssembleSubregion (self, dcrModels, subExposures, bbox, dcrBBox, warpRefList, statsCtrl, convergenceMetric, gain, modelWeights, refImage, dcrWeights) | |
dcrResiduals (self, residual, visitInfo, wcs, effectiveWavelength, bandwidth) | |
newModelFromResidual (self, dcrModels, residualGeneratorList, dcrBBox, statsCtrl, gain, modelWeights, refImage, dcrWeights) | |
calculateConvergence (self, dcrModels, subExposures, bbox, warpRefList, weightList, statsCtrl) | |
calculateSingleConvergence (self, dcrModels, exposure, significanceImage, statsCtrl) | |
stackCoadd (self, dcrCoadds) | |
fillCoadd (self, dcrModels, skyInfo, warpRefList, weightList, calibration=None, coaddInputs=None, mask=None, variance=None) | |
calculateGain (self, convergenceList, gainList) | |
calculateModelWeights (self, dcrModels, dcrBBox) | |
applyModelWeights (self, modelImages, refImage, modelWeights) | |
loadSubExposures (self, bbox, statsCtrl, warpRefList, imageScalerList, spanSetMaskList) | |
selectCoaddPsf (self, templateCoadd, warpRefList) | |
Variables | |
bufferSize : `int` | |
int | weightsThreshold = 1. |
int | goodPix = dcrWeights[0].array > weightsThreshold |
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 1138 of file dcrAssembleCoadd.py.
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` 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 864 of file dcrAssembleCoadd.py.
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 1024 of file dcrAssembleCoadd.py.
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 1105 of file dcrAssembleCoadd.py.
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 906 of file dcrAssembleCoadd.py.
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` 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 701 of file dcrAssembleCoadd.py.
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 775 of file dcrAssembleCoadd.py.
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` 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 967 of file dcrAssembleCoadd.py.
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` 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 1158 of file dcrAssembleCoadd.py.
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 808 of file dcrAssembleCoadd.py.
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` 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 1200 of file dcrAssembleCoadd.py.
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 948 of file dcrAssembleCoadd.py.
lsst.pipe.tasks.dcrAssembleCoadd.bufferSize : `int` |
Definition at line 265 of file dcrAssembleCoadd.py.
tuple lsst.pipe.tasks.dcrAssembleCoadd.goodPix = dcrWeights[0].array > weightsThreshold |
Definition at line 692 of file dcrAssembleCoadd.py.
int lsst.pipe.tasks.dcrAssembleCoadd.weightsThreshold = 1. |
Definition at line 691 of file dcrAssembleCoadd.py.