lsst.meas.algorithms g1581cd22ba+880e5d07f7
Loading...
Searching...
No Matches
lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask Class Reference
Inheritance diagram for lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask:

Public Member Functions

 __init__ (self, config=None, *, name=None, parentTask=None, log=None)
 
 run (self, exposure, background=None, stats=True, statsKeys=None, backgroundToPhotometricRatio=None)
 
 fitBackground (self, maskedImage, nx=0, ny=0, algorithm=None)
 

Public Attributes

int binSizeX = 0 else self.config.binSizeX
 
int binSizeY = 0 else self.config.binSizeY
 

Static Public Attributes

 ConfigClass = SubtractBackgroundConfig
 

Protected Member Functions

 _addStats (self, exposure, background, statsKeys=None)
 

Static Protected Attributes

str _DefaultName = "subtractBackground"
 

Detailed Description

Subtract the background from an exposure

Definition at line 200 of file subtractBackground.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask.__init__ ( self,
config = None,
* ,
name = None,
parentTask = None,
log = None )

Definition at line 206 of file subtractBackground.py.

Member Function Documentation

◆ _addStats()

lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask._addStats ( self,
exposure,
background,
statsKeys = None )
protected
Add statistics about the background to the exposure's metadata

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure whose background was subtracted.
background : `lsst.afw.math.BackgroundList`
    Background model
statsKeys : `tuple`
    Key names used to store the mean and variance of the background in
    the exposure's metadata (a tuple); if None then use
    ("BGMEAN", "BGVAR"); ignored if stats is false.

Definition at line 279 of file subtractBackground.py.

◆ fitBackground()

lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask.fitBackground ( self,
maskedImage,
nx = 0,
ny = 0,
algorithm = None )
Estimate the background of a masked image

Parameters
----------
maskedImage : `lsst.afw.image.maskedImage`
    Masked image whose background is to be computed
nx : 'int`
    Number of x bands; if 0 compute from width and `self.config.binSizeX`
ny : `int`
    Number of y bands; if 0 compute from height and `self.config.binSizeY`
algorithm : `str`
    Name of interpolation algorithm; if None use `self.config.algorithm`

Returns
-------
bg : `lsst.afw.math.Background`
    A fit background

Raises
------
RuntimeError
    Raised if lsst.afw.math.makeBackground returns None, an indicator
    of failure.

Definition at line 304 of file subtractBackground.py.

◆ run()

lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask.run ( self,
exposure,
background = None,
stats = True,
statsKeys = None,
backgroundToPhotometricRatio = None )
Fit and subtract the background of an exposure.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure whose background is to be subtracted.
background : `lsst.afw.math.BackgroundList`
    Initial background model already subtracted. May be None if no background
    has been subtracted.
stats : `bool`
    If True then measure the mean and variance of the full background model and
    record the results in the exposure's metadata.
statsKeys : `tuple`
    Key names used to store the mean and variance of the background in the
    exposure's metadata (another tuple); if None then use ("BGMEAN", "BGVAR");
    ignored if stats is false.
backgroundToPhotometricRatio : `lsst.afw.image.Image`, optional
    Image to multiply a photometrically-flattened image by to obtain a
    background-flattened image.
    Only used if config.doApplyFlatBackgroundRatio = True.

Returns
-------
background : `lsst.afw.math.BackgroundList`
    Full background model (initial model with changes), contained in an
    `lsst.pipe.base.Struct`.

Definition at line 211 of file subtractBackground.py.

Member Data Documentation

◆ _DefaultName

str lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask._DefaultName = "subtractBackground"
staticprotected

Definition at line 204 of file subtractBackground.py.

◆ binSizeX

lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask.binSizeX = 0 else self.config.binSizeX

Definition at line 208 of file subtractBackground.py.

◆ binSizeY

lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask.binSizeY = 0 else self.config.binSizeY

Definition at line 209 of file subtractBackground.py.

◆ ConfigClass

lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask.ConfigClass = SubtractBackgroundConfig
static

Definition at line 203 of file subtractBackground.py.


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