FocalPlaneBackground¶
-
class
lsst.pipe.tasks.background.
FocalPlaneBackground
(config, dims, transform, values=None, numbers=None)¶ Bases:
object
Background model for a focal plane camera
We model the background empirically with the “superpixel” method: we measure the background in each superpixel and interpolate between superpixels to yield the model.
The principal difference between this and
lsst.afw.math.BackgroundMI
is that here the superpixels are defined in the frame of the focal plane of the camera which removes discontinuities across detectors.The constructor you probably want to use is the
fromCamera
classmethod.There are two use patterns for building a background model:
- Serial: create a
FocalPlaneBackground
, thenaddCcd
for each of the CCDs in an exposure. - Parallel: create a
FocalPlaneBackground
, thenclone
it for each of the CCDs in an exposure and use those toaddCcd
their respective CCD image. Finally,merge
all the clones into the original.
Once you’ve built the background model, you can apply it to individual CCDs with the
toCcdBackground
method.Methods Summary
addCcd
(exposure)Add CCD to model clone
()fromCamera
(config, camera)Construct from a camera object fromSimilar
(other)Construct from an object that has the same interface. getStatsImage
()Return the background model data merge
(other)Merge with another FocalPlaneBackground toCcdBackground
(detector, bbox)Produce a background model for a CCD Methods Documentation
-
addCcd
(exposure)¶ Add CCD to model
We measure the background on the CCD (clipped mean), and record the results in the model. For simplicity, measurements are made in a box on the CCD corresponding to the warped coordinates of the superpixel rather than accounting for little rotations, etc. We also record the number of pixels used in the measurement so we can have a measure of confidence in each bin’s value.
Parameters: - exposure :
lsst.afw.image.Exposure
CCD exposure to measure
- exposure :
-
clone
()¶
-
classmethod
fromCamera
(config, camera)¶ Construct from a camera object
Parameters: - config :
FocalPlaneBackgroundConfig
Configuration for measuring backgrounds.
- camera :
lsst.afw.cameraGeom.Camera
Camera for which to measure backgrounds.
- config :
-
classmethod
fromSimilar
(other)¶ Construct from an object that has the same interface.
Parameters: - other :
FocalPlaneBackground
-like An object that matches the interface of
FocalPlaneBackground
but which may be different.
Returns: - background :
FocalPlaneBackground
Something guaranteed to be a
FocalPlaneBackground
.
- other :
-
getStatsImage
()¶ Return the background model data
This is the measurement of the background for each of the superpixels.
-
merge
(other)¶ Merge with another FocalPlaneBackground
This allows multiple background models to be constructed from different CCDs, and then merged to form a single consistent background model for the entire focal plane.
Parameters: - other :
FocalPlaneBackground
Another background model to merge.
Returns: - self :
FocalPlaneBackground
The merged background model.
- other :
-
toCcdBackground
(detector, bbox)¶ Produce a background model for a CCD
The superpixel background model is warped back to the CCD frame, for application to the individual CCD.
Parameters: - detector :
lsst.afw.cameraGeom.Detector
CCD for which to produce background model.
- bbox :
lsst.geom.Box2I
Bounding box of CCD exposure.
Returns: - bg :
lsst.afw.math.BackgroundList
Background model for CCD.
- detector :
- Serial: create a