lsst.pipe.tasks  16.0-23-ge8a9b866+4
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask Class Reference
Inheritance diagram for lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask:
lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask lsst.pipe.tasks.coaddBase.CoaddBaseTask

Public Member Functions

def runDataRef (self, dataRef, selectDataList=[])
 
def prepareDcrInputs (self, templateCoadd, tempExpRefList, weightList)
 
def run (self, skyInfo, tempExpRefList, imageScalerList, weightList, supplementaryData=None)
 
def calculateNImage (self, dcrModels, bbox, tempExpRefList, spanSetMaskList, statsCtrl)
 
def dcrAssembleSubregion (self, dcrModels, bbox, tempExpRefList, imageScalerList, weightList, spanSetMaskList, statsFlags, statsCtrl, convergenceMetric, baseMask, subfilterVariance, gain)
 
def dcrResiduals (self, residual, visitInfo, bbox, wcs, filterInfo)
 
def newModelFromResidual (self, dcrModels, residualGeneratorList, bbox, statsFlags, statsCtrl, weightList, mask, gain)
 
def calculateConvergence (self, dcrModels, bbox, tempExpRefList, imageScalerList, weightList, spanSetMaskList, statsCtrl)
 
def calculateSingleConvergence (self, dcrModels, exposure, significanceImage, statsCtrl, altMaskSpans=None)
 
def stackCoadd (self, dcrCoadds)
 
def fillCoadd (self, dcrModels, skyInfo, tempExpRefList, weightList, calibration=None, coaddInputs=None, mask=None)
 
def calculateGain (self, modelIter, baseGain=1.)
 
def makeSupplementaryData (self, dataRef, selectDataList)
 
def run (self, skyInfo, tempExpRefList, imageScalerList, weightList, supplementaryData, args, kwargs)
 
def applyAltEdgeMask (self, mask, altMaskList)
 
def findArtifacts (self, templateCoadd, tempExpRefList, imageScalerList)
 
def prefilterArtifacts (self, spanSetList, exp)
 
def filterArtifacts (self, spanSetList, epochCountImage, nImage, footprintsToExclude=None)
 
def processResults (self, coaddExposure, dataRef)
 
def getTempExpRefList (self, patchRef, calExpRefList)
 
def prepareInputs (self, refList)
 
def prepareStats (self, mask=None)
 
def assembleMetadata (self, coaddExposure, tempExpRefList, weightList)
 
def assembleSubregion (self, coaddExposure, bbox, tempExpRefList, imageScalerList, weightList, altMaskList, statsFlags, statsCtrl, nImage=None)
 
def removeMaskPlanes (self, maskedImage)
 
def applyAltMaskPlanes (self, mask, altMaskSpans)
 
def shrinkValidPolygons (self, coaddInputs)
 
def readBrightObjectMasks (self, dataRef)
 
def setBrightObjectMasks (self, exposure, dataId, brightObjectMasks)
 
def setInexactPsf (self, mask)
 
def selectExposures (self, patchRef, skyInfo=None, selectDataList=[])
 Select exposures to coadd. More...
 
def getSkyInfo (self, patchRef)
 Use getSkyinfo to return the skyMap, tract and patch information, wcs and the outer bbox of the patch. More...
 
def getCalExp (self, dataRef, bgSubtracted)
 Return one "calexp" calibrated exposure. More...
 
def getCoaddDatasetName (self, warpType="direct")
 
def getTempExpDatasetName (self, warpType="direct")
 
def getBadPixelMask (self)
 Convenience method to provide the bitmask from the mask plane names. More...
 

Static Public Member Functions

def setRejectedMaskMapping (statsCtrl)
 

Public Attributes

 bufferSize
 
 warpCtrl
 
 brightObjectBitmask
 
 warpType
 

Static Public Attributes

 ConfigClass = DcrAssembleCoaddConfig
 
 RunnerClass = CoaddTaskRunner
 

Detailed Description

Assemble DCR coadded images from a set of warps.

Notes
-----
As with AssembleCoaddTask, we want to assemble a coadded image from a set of
Warps (also called coadded temporary exposures), including the effects of
Differential Chromatic Refraction (DCR).
For full details of the mathematics and algorithm, please see
DMTN-037: DCR-matched template generation (https://dmtn-037.lsst.io).

This Task produces a DCR-corrected deepCoadd, as well as a dcrCoadd for
each subfilter used in the iterative calculation.
It begins by dividing the bandpass-defining filter into N equal bandwidth
"subfilters", and divides the flux in each pixel from an initial coadd
equally into each as a "dcrModel". Because the airmass and parallactic
angle of each individual exposure is known, we can calculate the shift
relative to the center of the band in each subfilter due to DCR. For each
exposure we apply this shift as a linear transformation to the dcrModels
and stack the results to produce a DCR-matched exposure. The matched
exposures are subtracted from the input exposures to produce a set of
residual images, and these residuals are reverse shifted for each
exposures' subfilters and stacked. The shifted and stacked residuals are
added to the dcrModels to produce a new estimate of the flux in each pixel
within each subfilter. The dcrModels are solved for iteratively, which
continues until the solution from a new iteration improves by less than
a set percentage, or a maximum number of iterations is reached.
Two forms of regularization are employed to reduce unphysical results.
First, the new solution is averaged with the solution from the previous
iteration, which mitigates oscillating solutions where the model
overshoots with alternating very high and low values.
Second, a common degeneracy when the data have a limited range of airmass or
parallactic angle values is for one subfilter to be fit with very low or
negative values, while another subfilter is fit with very high values. This
typically appears in the form of holes next to sources in one subfilter,
and corresponding extended wings in another. Because each subfilter has
a narrow bandwidth we assume that physical sources that are above the noise
level will not vary in flux by more than a factor of `frequencyClampFactor`
between subfilters, and pixels that have flux deviations larger than that
factor will have the excess flux distributed evenly among all subfilters.

Definition at line 121 of file dcrAssembleCoadd.py.

Member Function Documentation

◆ applyAltEdgeMask()

def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.applyAltEdgeMask (   self,
  mask,
  altMaskList 
)
inherited
Propagate alt EDGE mask to SENSOR_EDGE AND INEXACT_PSF planes.

Parameters
----------
mask : `lsst.afw.image.Mask`
    Original mask.
altMaskList : `list`
    List of Dicts containing ``spanSet`` lists.
    Each element contains the new mask plane name (e.g. "CLIPPED
    and/or "NO_DATA") as the key, and list of ``SpanSets`` to apply to
    the mask.

Definition at line 1863 of file assembleCoadd.py.

◆ applyAltMaskPlanes()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.applyAltMaskPlanes (   self,
  mask,
  altMaskSpans 
)
inherited
Apply in place alt mask formatted as SpanSets to a mask.

Parameters
----------
mask : `lsst.afw.image.Mask`
    Original mask.
altMaskSpans : `dict`
    SpanSet lists to apply. Each element contains the new mask
    plane name (e.g. "CLIPPED and/or "NO_DATA") as the key,
    and list of SpanSets to apply to the mask.

Returns
-------
mask : `lsst.afw.image.Mask`
    Updated mask.

Definition at line 776 of file assembleCoadd.py.

◆ assembleMetadata()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.assembleMetadata (   self,
  coaddExposure,
  tempExpRefList,
  weightList 
)
inherited
Set the metadata for the coadd.

This basic implementation sets the filter from the first input.

Parameters
----------
coaddExposure : `lsst.afw.image.Exposure`
    The target exposure for the coadd.
tempExpRefList : `list`
    List of data references to tempExp.
weightList : `list`
    List of weights.

Definition at line 607 of file assembleCoadd.py.

◆ assembleSubregion()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.assembleSubregion (   self,
  coaddExposure,
  bbox,
  tempExpRefList,
  imageScalerList,
  weightList,
  altMaskList,
  statsFlags,
  statsCtrl,
  nImage = None 
)
inherited
Assemble the coadd for a sub-region.

For each coaddTempExp, check for (and swap in) an alternative mask
if one is passed. Remove mask planes listed in
`config.removeMaskPlanes`. Finally, stack the actual exposures using
`lsst.afw.math.statisticsStack` with the statistic specified by
statsFlags. Typically, the statsFlag will be one of lsst.afw.math.MEAN for
a mean-stack or `lsst.afw.math.MEANCLIP` for outlier rejection using
an N-sigma clipped mean where N and iterations are specified by
statsCtrl.  Assign the stacked subregion back to the coadd.

Parameters
----------
coaddExposure : `lsst.afw.image.Exposure`
    The target exposure for the coadd.
bbox : `lsst.afw.geom.Box`
    Sub-region to coadd.
tempExpRefList : `list`
    List of data reference to tempExp.
imageScalerList : `list`
    List of image scalers.
weightList : `list`
    List of weights.
altMaskList : `list`
    List of alternate masks to use rather than those stored with
    tempExp, or None.  Each element is dict with keys = mask plane
    name to which to add the spans.
statsFlags : `lsst.afw.math.Property`
    Property object for statistic for coadd.
statsCtrl : `lsst.afw.math.StatisticsControl`
    Statistics control object for coadd.
nImage : `lsst.afw.image.ImageU`, optional
    Keeps track of exposure count for each pixel.

Definition at line 663 of file assembleCoadd.py.

◆ calculateConvergence()

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.calculateConvergence (   self,
  dcrModels,
  bbox,
  tempExpRefList,
  imageScalerList,
  weightList,
  spanSetMaskList,
  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.
bbox : `lsst.afw.geom.box.Box2I`
    Sub-region to coadd
tempExpRefList : `list` of `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.
weightList : `list` of `float`
    The weight to give each input exposure in the coadd
spanSetMaskList : `list` of `dict` containing spanSet lists, or None
    Each element is dict with keys = mask plane name to add the spans to
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 589 of file dcrAssembleCoadd.py.

◆ calculateGain()

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.calculateGain (   self,
  modelIter,
  baseGain = 1. 
)
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
----------
modelIter : `int`
    The current iteration of forward modeling.
baseGain : `float`, optional
    Description

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.

Definition at line 741 of file dcrAssembleCoadd.py.

◆ calculateNImage()

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.calculateNImage (   self,
  dcrModels,
  bbox,
  tempExpRefList,
  spanSetMaskList,
  statsCtrl 
)
Calculate the number of exposures contributing to each subfilter.

Parameters
----------
dcrModels : `lsst.pipe.tasks.DcrModel`
    Best fit model of the true sky after correcting chromatic effects.
bbox : `lsst.afw.geom.box.Box2I`
    Bounding box of the patch to coadd.
tempExpRefList : `list` of `lsst.daf.persistence.ButlerDataRef`
    The data references to the input warped exposures.
spanSetMaskList : `list` of `dict` containing spanSet lists, or None
    Each element is dict with keys = mask plane name to add the spans to
statsCtrl : `lsst.afw.math.StatisticsControl`
    Statistics control object for coadd

Returns
-------
dcrNImages : `list` of `lsst.afw.image.ImageU`
    List of exposure count images for each subfilter

Definition at line 394 of file dcrAssembleCoadd.py.

◆ calculateSingleConvergence()

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.calculateSingleConvergence (   self,
  dcrModels,
  exposure,
  significanceImage,
  statsCtrl,
  altMaskSpans = None 
)
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
altMaskSpans : `dict` containing spanSet lists, or None
    The keys of the `dict` equal the mask plane name to add the spans to

Returns
-------
convergenceMetric : `float`
    Quality of fit metric for one exposure, within the sub-region.

Definition at line 635 of file dcrAssembleCoadd.py.

◆ dcrAssembleSubregion()

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.dcrAssembleSubregion (   self,
  dcrModels,
  bbox,
  tempExpRefList,
  imageScalerList,
  weightList,
  spanSetMaskList,
  statsFlags,
  statsCtrl,
  convergenceMetric,
  baseMask,
  subfilterVariance,
  gain 
)
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.
bbox : `lsst.afw.geom.box.Box2I`
    Bounding box of the subregion to coadd.
tempExpRefList : `list` of `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.
weightList : `list` of `float`
    The weight to give each input exposure in the coadd
spanSetMaskList : `list` of `dict` containing spanSet lists, or None
    Each element is dict with keys = mask plane name to add the spans to
statsFlags : `lsst.afw.math.Property`
    Statistics settings for coaddition.
statsCtrl : `lsst.afw.math.StatisticsControl`
    Statistics control object for coadd
convergenceMetric : `float`
    Quality of fit metric for the matched templates of the input images.
baseMask : `lsst.afw.image.Mask`
    Mask of the initial template coadd.
subfilterVariance : `list` of `numpy.ndarray`
    The variance of each coadded subfilter image.
gain : `float`, optional
    Relative weight to give the new solution when updating the model.

Definition at line 432 of file dcrAssembleCoadd.py.

◆ dcrResiduals()

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.dcrResiduals (   self,
  residual,
  visitInfo,
  bbox,
  wcs,
  filterInfo 
)
Prepare a residual image for stacking in each subfilter by applying the reverse DCR shifts.

Parameters
----------
residual : `lsst.afw.image.MaskedImageF`
    The residual masked image for one exposure,
    after subtracting the matched template
visitInfo : `lsst.afw.image.VisitInfo`
    Metadata for the exposure.
bbox : `lsst.afw.geom.box.Box2I`
    Sub-region of the coadd
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 : `lsst.afw.image.maskedImageF`
    The residual image for the next subfilter, shifted for DCR.

Definition at line 503 of file dcrAssembleCoadd.py.

◆ fillCoadd()

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.fillCoadd (   self,
  dcrModels,
  skyInfo,
  tempExpRefList,
  weightList,
  calibration = None,
  coaddInputs = None,
  mask = 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
tempExpRefList : `list` of `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.Calib`, optional
    Scale factor to set the photometric zero point 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.

Returns
-------
dcrCoadds : `list` of `lsst.afw.image.ExposureF`
    A list of coadd exposures, each exposure containing
    the model for one subfilter.

Definition at line 699 of file dcrAssembleCoadd.py.

◆ filterArtifacts()

def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.filterArtifacts (   self,
  spanSetList,
  epochCountImage,
  nImage,
  footprintsToExclude = None 
)
inherited
Filter artifact candidates.

Parameters
----------
spanSetList : `list`
    List of SpanSets representing artifact candidates.
epochCountImage : `lsst.afw.image.Image`
    Image of accumulated number of warpDiff detections.
nImage : `lsst.afw.image.Image`
    Image of the accumulated number of total epochs contributing.

Returns
-------
maskSpanSetList : `list`
    List of SpanSets with artifacts.

Definition at line 2017 of file assembleCoadd.py.

◆ findArtifacts()

def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.findArtifacts (   self,
  templateCoadd,
  tempExpRefList,
  imageScalerList 
)
inherited
Find artifacts.

Loop through warps twice. The first loop builds a map with the count
of how many epochs each pixel deviates from the templateCoadd by more
than ``config.chiThreshold`` sigma. The second loop takes each
difference image and filters the artifacts detected in each using
count map to filter out variable sources and sources that are
difficult to subtract cleanly.

Parameters
----------
templateCoadd : `lsst.afw.image.Exposure`
    Exposure to serve as model of static sky.
tempExpRefList : `list`
    List of data references to warps.
imageScalerList : `list`
    List of image scalers.

Returns
-------
altMasks : `list`
    List of dicts containing information about CLIPPED
    (i.e., artifacts), NO_DATA, and EDGE pixels.

Definition at line 1882 of file assembleCoadd.py.

◆ getBadPixelMask()

def lsst.pipe.tasks.coaddBase.CoaddBaseTask.getBadPixelMask (   self)
inherited

Convenience method to provide the bitmask from the mask plane names.

Definition at line 221 of file coaddBase.py.

◆ getCalExp()

def lsst.pipe.tasks.coaddBase.CoaddBaseTask.getCalExp (   self,
  dataRef,
  bgSubtracted 
)
inherited

Return one "calexp" calibrated exposure.

Parameters
[in]dataRefa sensor-level data reference
[in]bgSubtractedreturn calexp with background subtracted? If False get the calexp's background background model and add it to the calexp.
Returns
calibrated exposure

If config.doApplyUberCal, meas_mosaic calibrations will be applied to the returned exposure using applyMosaicResults.

Definition at line 143 of file coaddBase.py.

◆ getCoaddDatasetName()

def lsst.pipe.tasks.coaddBase.CoaddBaseTask.getCoaddDatasetName (   self,
  warpType = "direct" 
)
inherited
Return coadd name for given warpType and task config

Parameters
----------
warpType : string
    Either 'direct' or 'psfMatched'

Returns
-------
CoaddDatasetName : `string`

Definition at line 171 of file coaddBase.py.

◆ getSkyInfo()

def lsst.pipe.tasks.coaddBase.CoaddBaseTask.getSkyInfo (   self,
  patchRef 
)
inherited

Use getSkyinfo to return the skyMap, tract and patch information, wcs and the outer bbox of the patch.

Parameters
[in]patchRefdata reference for sky map. Must include keys "tract" and "patch"
Returns
pipe_base Struct containing:
  • skyMap: sky map
  • tractInfo: information for chosen tract of sky map
  • patchInfo: information about chosen patch of tract
  • wcs: WCS of tract
  • bbox: outer bbox of patch, as an afwGeom Box2I

Definition at line 127 of file coaddBase.py.

◆ getTempExpDatasetName()

def lsst.pipe.tasks.coaddBase.CoaddBaseTask.getTempExpDatasetName (   self,
  warpType = "direct" 
)
inherited
Return warp name for given warpType and task config

Parameters
----------
warpType : string
    Either 'direct' or 'psfMatched'

Returns
-------
WarpDatasetName : `string`

Definition at line 186 of file coaddBase.py.

◆ getTempExpRefList()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.getTempExpRefList (   self,
  patchRef,
  calExpRefList 
)
inherited
Generate list data references corresponding to warped exposures
that lie within the patch to be coadded.

Parameters
----------
patchRef : `dataRef`
    Data reference for patch.
calExpRefList : `list`
    List of data references for input calexps.

Returns
-------
tempExpRefList : `list`
    List of Warp/CoaddTempExp data references.

Definition at line 409 of file assembleCoadd.py.

◆ makeSupplementaryData()

def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.makeSupplementaryData (   self,
  dataRef,
  selectDataList 
)
inherited
Make inputs specific to Subclass.

Generate a templateCoadd to use as a native model of static sky to
subtract from warps.

Parameters
----------
dataRef : `lsst.daf.persistence.butlerSubset.ButlerDataRef`
    Butler dataRef for supplementary data.
selectDataList : `list`
    List of data references to Warps.

Returns
-------
result : `lsst.pipe.base.Struct`
   Result struct with components:

   - ``templateCoaddcoadd``: coadded exposure (``lsst.afw.image.Exposure``).

Definition at line 1777 of file assembleCoadd.py.

◆ newModelFromResidual()

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.newModelFromResidual (   self,
  dcrModels,
  residualGeneratorList,
  bbox,
  statsFlags,
  statsCtrl,
  weightList,
  mask,
  gain 
)
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 `lsst.afw.image.maskedImageF`
    The residual image for the next subfilter, shifted for DCR.
bbox : `lsst.afw.geom.box.Box2I`
    Sub-region of the coadd
statsFlags : `lsst.afw.math.Property`
    Statistics settings for coaddition.
statsCtrl : `lsst.afw.math.StatisticsControl`
    Statistics control object for coadd
weightList : `list` of `float`
    The weight to give each input exposure in the coadd
mask : `lsst.afw.image.Mask`
    Mask to use for each new model image.
gain : `float`
    Relative weight to give the new solution when updating the model.

Returns
-------
dcrModel : `lsst.pipe.tasks.DcrModel`
    New model of the true sky after correcting chromatic effects.

Definition at line 532 of file dcrAssembleCoadd.py.

◆ prefilterArtifacts()

def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.prefilterArtifacts (   self,
  spanSetList,
  exp 
)
inherited
Remove artifact candidates covered by bad mask plane.

Any future editing of the candidate list that does not depend on
temporal information should go in this method.

Parameters
----------
spanSetList : `list`
    List of SpanSets representing artifact candidates.
exp : `lsst.afw.image.Exposure`
    Exposure containing mask planes used to prefilter.

Returns
-------
returnSpanSetList : `list`
    List of SpanSets with artifacts.

Definition at line 1985 of file assembleCoadd.py.

◆ prepareDcrInputs()

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.prepareDcrInputs (   self,
  templateCoadd,
  tempExpRefList,
  weightList 
)
Prepare the DCR coadd by iterating through the visitInfo of the input warps.

Sets the properties ``filterInfo`` and ``bufferSize``.

Parameters
----------
templateCoadd : `lsst.afw.image.ExposureF`
    The initial coadd exposure before accounting for DCR.
tempExpRefList : `list` of `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
    Will be modified in place if ``doAirmassWeight`` is set.

Returns
-------
dcrModels : `lsst.pipe.tasks.DcrModel`
    Best fit model of the true sky after correcting chromatic effects.

Raises
------
NotImplementedError
    If ``lambdaMin`` is missing from the Mapper class of the obs package being used.

Definition at line 213 of file dcrAssembleCoadd.py.

◆ prepareInputs()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.prepareInputs (   self,
  refList 
)
inherited
Prepare the input warps for coaddition by measuring the weight for
each warp and the scaling for the photometric zero point.

Each Warp has its own photometric zeropoint and background variance.
Before coadding these Warps together, compute a scale factor to
normalize the photometric zeropoint and compute the weight for each Warp.

Parameters
----------
refList : `list`
    List of data references to tempExp

Returns
-------
result : `lsst.pipe.base.Struct`
   Result struct with components:

   - ``tempExprefList``: `list` of data references to tempExp.
   - ``weightList``: `list` of weightings.
   - ``imageScalerList``: `list` of image scalers.

Definition at line 433 of file assembleCoadd.py.

◆ prepareStats()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.prepareStats (   self,
  mask = None 
)
inherited
Prepare the statistics for coadding images.

Parameters
----------
mask : `int`, optional
    Bit mask value to exclude from coaddition.

Returns
-------
stats : `lsst.pipe.base.Struct`
    Statistics structure with the following fields:

    - ``statsCtrl``: Statistics control object for coadd
(`lsst.afw.math.StatisticsControl`)
    - ``statsFlags``: Statistic for coadd (`lsst.afw.math.Property`)

Definition at line 502 of file assembleCoadd.py.

◆ processResults()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.processResults (   self,
  coaddExposure,
  dataRef 
)
inherited
Interpolate over missing data and mask bright stars.

Parameters
----------
coaddExposure : `lsst.afw.image.Exposure`
    The coadded exposure to process.
dataRef : `lsst.daf.persistence.ButlerDataRef`
    Butler data reference for supplementary data.

Definition at line 372 of file assembleCoadd.py.

◆ readBrightObjectMasks()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.readBrightObjectMasks (   self,
  dataRef 
)
inherited
Retrieve the bright object masks.

Returns None on failure.

Parameters
----------
dataRef : `lsst.daf.persistence.butlerSubset.ButlerDataRef`
    A Butler dataRef.

Returns
-------
result : `lsst.daf.persistence.butlerSubset.ButlerDataRef`
    Bright object mask from the Butler object, or None if it cannot
    be retrieved.

Definition at line 830 of file assembleCoadd.py.

◆ removeMaskPlanes()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.removeMaskPlanes (   self,
  maskedImage 
)
inherited
Unset the mask of an image for mask planes specified in the config.

Parameters
----------
maskedImage : `lsst.afw.image.MaskedImage`
    The masked image to be modified.

Definition at line 732 of file assembleCoadd.py.

◆ run() [1/2]

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.run (   self,
  skyInfo,
  tempExpRefList,
  imageScalerList,
  weightList,
  supplementaryData = None 
)
Assemble the coadd.

Requires additional inputs Struct ``supplementaryData`` to contain a
``templateCoadd`` that serves as the model of the static sky.

Find artifacts and apply them to the warps' masks creating a list of
alternative masks with a new "CLIPPED" plane and updated "NO_DATA" plane
Then pass these alternative masks to the base class's assemble method.

Divide the ``templateCoadd`` evenly between each subfilter of a
``DcrModel`` as the starting best estimate of the true wavelength-
dependent sky. Forward model the ``DcrModel`` using the known
chromatic effects in each subfilter and calculate a convergence metric
based on how well the modeled template matches the input warps. If
the convergence has not yet reached the desired threshold, then shift
and stack the residual images to build a new ``DcrModel``. Apply
conditioning to prevent oscillating solutions between iterations or
between subfilters.

Once the ``DcrModel`` reaches convergence or the maximum number of
iterations has been reached, fill the metadata for each subfilter
image and make them proper ``coaddExposure``s.

Parameters
----------
skyInfo : `lsst.pipe.base.Struct`
    Patch geometry information, from getSkyInfo
tempExpRefList : `list` of `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.
weightList : `list` of `float`
    The weight to give each input exposure in the coadd
supplementaryData : `lsst.pipe.base.Struct`
    Result struct returned by ``makeSupplementaryData`` with components:

    - ``templateCoadd``: coadded exposure (`lsst.afw.image.Exposure`)

Returns
-------
result : `lsst.pipe.base.Struct`
   Result struct with components:

    - ``coaddExposure``: coadded exposure (`lsst.afw.image.Exposure`)
    - ``nImage``: exposure count image (`lsst.afw.image.ImageU`)
    - ``dcrCoadds``: `list` of coadded exposures for each subfilter
    - ``dcrNImages``: `list` of exposure count images for each subfilter

Definition at line 267 of file dcrAssembleCoadd.py.

◆ run() [2/2]

def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.run (   self,
  skyInfo,
  tempExpRefList,
  imageScalerList,
  weightList,
  supplementaryData,
  args,
  kwargs 
)
inherited
Assemble the coadd.

Find artifacts and apply them to the warps' masks creating a list of
alternative masks with a new "CLIPPED" plane and updated "NO_DATA"
plane. Then pass these alternative masks to the base class's `run`
method.

Parameters
----------
skyInfo : `lsst.pipe.base.Struct`
    Patch geometry information.
tempExpRefList : `list`
    List of data references to warps.
imageScalerList : `list`
    List of image scalers.
weightList : `list`
    List of weights.
supplementaryData : `lsst.pipe.base.Struct`
    This Struct must contain a ``templateCoadd`` that serves as the
    model of the static sky.

Returns
-------
result : `lsst.pipe.base.Struct`
   Result struct with components:

   - ``coaddExposure``: coadded exposure (``lsst.afw.image.Exposure``).
   - ``nImage``: exposure count image (``lsst.afw.image.Image``), if requested.

Definition at line 1819 of file assembleCoadd.py.

◆ runDataRef()

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.runDataRef (   self,
  dataRef,
  selectDataList = [] 
)
Assemble a coadd from a set of warps.

Coadd a set of Warps. Compute weights to be applied to each Warp and
find scalings to match the photometric zeropoint to a reference Warp.
Assemble the Warps using run method.
Forward model chromatic effects across multiple subfilters,
and subtract from the input Warps to build sets of residuals.
Use the residuals to construct a new ``DcrModel`` for each subfilter,
and iterate until the model converges.
Interpolate over NaNs and optionally write the coadd to disk.
Return the coadded exposure.

Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
    Data reference defining the patch for coaddition and the
    reference Warp
selectDataList : `list` of `lsst.daf.persistence.ButlerDataRef`
    List of data references to warps. Data to be coadded will be
    selected from this list based on overlap with the patch defined by
    the data reference.

Returns
-------
results : `lsst.pipe.base.Struct`
    The Struct contains the following fields:

    - ``coaddExposure``: coadded exposure (`lsst.afw.image.Exposure`)
    - ``nImage``: exposure count image (`lsst.afw.image.ImageU`)
    - ``dcrCoadds``: `list` of coadded exposures for each subfilter
    - ``dcrNImages``: `list` of exposure count images for each subfilter

Definition at line 167 of file dcrAssembleCoadd.py.

◆ selectExposures()

def lsst.pipe.tasks.coaddBase.CoaddBaseTask.selectExposures (   self,
  patchRef,
  skyInfo = None,
  selectDataList = [] 
)
inherited

Select exposures to coadd.

Get the corners of the bbox supplied in skyInfo using afwGeom.Box2D and convert the pixel positions of the bbox corners to sky coordinates using skyInfo.wcs.pixelToSky. Use the WcsSelectImagesTask to select exposures that lie inside the patch indicated by the dataRef.

Parameters
[in]patchRefdata reference for sky map patch. Must include keys "tract", "patch", plus the camera-specific filter key (e.g. "filter" or "band")
[in]skyInfogeometry for the patch; output from getSkyInfo
Returns
a list of science exposures to coadd, as butler data references

Definition at line 107 of file coaddBase.py.

◆ setBrightObjectMasks()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.setBrightObjectMasks (   self,
  exposure,
  dataId,
  brightObjectMasks 
)
inherited
Set the bright object masks.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure under consideration.
dataId : `lsst.daf.persistence.dataId`
    Data identifier dict for patch.
brightObjectMasks : `lsst.afw.table`
    Table of bright objects to mask.

Definition at line 852 of file assembleCoadd.py.

◆ setInexactPsf()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.setInexactPsf (   self,
  mask 
)
inherited
Set INEXACT_PSF mask plane.

If any of the input images isn't represented in the coadd (due to
clipped pixels or chip gaps), the `CoaddPsf` will be inexact. Flag
these pixels.

Parameters
----------
mask : `lsst.afw.image.Mask`
    Coadded exposure's mask, modified in-place.

Definition at line 904 of file assembleCoadd.py.

◆ setRejectedMaskMapping()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.setRejectedMaskMapping (   statsCtrl)
staticinherited
Map certain mask planes of the warps to new planes for the coadd.

If a pixel is rejected due to a mask value other than EDGE, NO_DATA,
or CLIPPED, set it to REJECTED on the coadd.
If a pixel is rejected due to EDGE, set the coadd pixel to SENSOR_EDGE.
If a pixel is rejected due to CLIPPED, set the coadd pixel to CLIPPED.

Parameters
----------
statsCtrl : `lsst.afw.math.StatisticsControl`
    Statistics control object for coadd

Returns
-------
maskMap : `list` of `tuple` of `int`
    A list of mappings of mask planes of the warped exposures to
    mask planes of the coadd.

Definition at line 748 of file assembleCoadd.py.

◆ shrinkValidPolygons()

def lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.shrinkValidPolygons (   self,
  coaddInputs 
)
inherited
Shrink coaddInputs' ccds' ValidPolygons in place.

Either modify each ccd's validPolygon in place, or if CoaddInputs
does not have a validPolygon, create one from its bbox.

Parameters
----------
coaddInputs : `lsst.afw.image.coaddInputs`
    Original mask.

Definition at line 808 of file assembleCoadd.py.

◆ stackCoadd()

def lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.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 679 of file dcrAssembleCoadd.py.

Member Data Documentation

◆ brightObjectBitmask

lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.brightObjectBitmask
inherited

Definition at line 304 of file assembleCoadd.py.

◆ bufferSize

lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.bufferSize

Definition at line 252 of file dcrAssembleCoadd.py.

◆ ConfigClass

lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.ConfigClass = DcrAssembleCoaddConfig
static

Definition at line 163 of file dcrAssembleCoadd.py.

◆ RunnerClass

lsst.pipe.tasks.coaddBase.CoaddBaseTask.RunnerClass = CoaddTaskRunner
staticinherited

Definition at line 100 of file coaddBase.py.

◆ warpCtrl

lsst.pipe.tasks.dcrAssembleCoadd.DcrAssembleCoaddTask.warpCtrl

Definition at line 257 of file dcrAssembleCoadd.py.

◆ warpType

lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask.warpType
inherited

Definition at line 310 of file assembleCoadd.py.


The documentation for this class was generated from the following file: