lsst.pipe.tasks gd5638573c2+392ae78cd2
Loading...
Searching...
No Matches
lsst.pipe.tasks.tractBackground.TractBackground Class Reference

Public Member Functions

 __init__ (self, config, skymap, tract, values=None, numbers=None, variances=None)
 __reduce__ (self)
 clone (self)
 addWarp (self, warp)
 __iadd__ (self, other)
 toWarpBackground (self, warp)
 getStatsImage (self)
 getVarianceImage (self)

Public Attributes

 config = config
 skymap = skymap
 tract = tract
 tractInfo = self.skymap[tract]
 dims = geom.Extent2I(tractDimX / self.config.xBin, tractDimY / self.config.yBin)

Protected Attributes

 _values = values
 _numbers = numbers
 _variances = variances

Detailed Description

Background model for a tract, comprised of warped exposures.

Similar to lsst.pipe.background.FocalPlaneBackground class, in that we
model the background using the "superpixel" method, measuring the
background in each superpixel and interpolating between them.

There is one use pattern for building a background model: create a
`TractBackground`, then `addWarp` for each of the patches in a tract.

Once you've built the background model, you can apply it to individual
warps with the `toWarpBackground` method.

Parameters
----------
config : `TractBackgroundConfig`
    Configuration for measuring tract backgrounds.
skymap : `lsst.skymap.ringsSkyMap.RingsSkyMap`
    Skymap object
tract : `int`
    Working Tract ID.
transform : `lsst.afw.geom.TransformPoint2ToPoint2`
    Transformation from tract coordinates to warp coordinates.
values : `lsst.afw.image.ImageF`
    Measured background values.
numbers : `lsst.afw.image.ImageF`
    Number of pixels in each background measurement.
variances : `lsst.afw.image.ImageF`
    Measured background variances.

Member Function Documentation

◆ __iadd__()

lsst.pipe.tasks.tractBackground.TractBackground.__iadd__ ( self,
other )
Merges with another TractBackground

This allows multiple background models to be constructed from
different warps, and then merged to form a single consistent
background model for the entire tract.

Parameters
----------
other : `TractBackground`
    Another background model to merge.

Returns
-------
self : `TractBackground`
    The merged background model.

◆ addWarp()

lsst.pipe.tasks.tractBackground.TractBackground.addWarp ( self,
warp )
Bins masked images of warps and adds these values into a blank image
with the binned tract dimensions at the location of the warp in the
tract.

Parameters
----------
warp : `lsst.afw.image.ExposureF`
    Warped image corresponding to a single patch in a single visit.

◆ getStatsImage()

lsst.pipe.tasks.tractBackground.TractBackground.getStatsImage ( self)
Return the background model data

This is the measurement of the background for each of the superpixels.

◆ getVarianceImage()

lsst.pipe.tasks.tractBackground.TractBackground.getVarianceImage ( self)
Return a variance image with the background model dimensions

Notes
-----
Does not interpolate or extrapolate over bad values.

◆ toWarpBackground()

lsst.pipe.tasks.tractBackground.TractBackground.toWarpBackground ( self,
warp )
Produce a background model for a warp

The superpixel model is transformed back to the native pixel
resolution, for application to the background of an individual warp.

Parameters
----------
warp : `lsst.afw.image.ExposureF`
    Warped image corresponding to a single patch in a single visit.

Returns
-------
bg : `lsst.afw.math.BackgroundList`
    Background model for warp.

The documentation for this class was generated from the following file:
  • python/lsst/pipe/tasks/tractBackground.py