|
def | dcrAssembleSubregion (self, dcrModels, subExposures, bbox, dcrBBox, warpRefList, statsCtrl, convergenceMetric, gain, modelWeights, refImage, dcrWeights) |
|
def | dcrResiduals (self, residual, visitInfo, wcs, filterInfo) |
|
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) |
|
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 1110 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 790 of file dcrAssembleCoadd.py.
def lsst.pipe.tasks.dcrAssembleCoadd.dcrResiduals |
( |
|
self, |
|
|
|
residual, |
|
|
|
visitInfo, |
|
|
|
wcs, |
|
|
|
filterInfo |
|
) |
| |
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.
filterInfo : `lsst.afw.image.Filter`
The filter definition, set in the current instruments' obs package.
Required for any calculation of DCR, including making matched templates.
Yields
------
residualImage : `numpy.ndarray`
The residual image for the next subfilter, shifted for DCR.
Definition at line 862 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 1052 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 1244 of file dcrAssembleCoadd.py.