lsst.pipe.tasks  19.0.0-61-gec4c6e08+6
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.tasks.scaleVariance.ScaleVarianceTask Class Reference
Inheritance diagram for lsst.pipe.tasks.scaleVariance.ScaleVarianceTask:

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def subtractedBackground (self, maskedImage)
 
def run (self, maskedImage)
 
def pixelBased (self, maskedImage)
 
def imageBased (self, maskedImage)
 

Static Public Attributes

 ConfigClass
 

Detailed Description

Scale the variance in a MaskedImage

The variance plane in a convolved or warped image (or a coadd derived
from warped images) does not accurately reflect the noise properties of
the image because variance has been lost to covariance. This Task
attempts to correct for this by scaling the variance plane to match
the observed variance in the image. This is not perfect (because we're
not tracking the covariance) but it's simple and is often good enough.

Definition at line 48 of file scaleVariance.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.tasks.scaleVariance.ScaleVarianceTask.__init__ (   self,
args,
**  kwargs 
)

Definition at line 61 of file scaleVariance.py.

Member Function Documentation

◆ imageBased()

def lsst.pipe.tasks.scaleVariance.ScaleVarianceTask.imageBased (   self,
  maskedImage 
)
Determine the variance rescaling factor from image statistics

We calculate average(SNR) = stdev(image)/median(variance), and
the value should be unity. The variance rescaling factor is the
factor that brings this value to unity.

This may not work well if the pixels from which we measure the
standard deviation of the image are not effectively the same pixels
from which we measure the median of the variance. In that case, use
an alternate method.

Parameters
----------
maskedImage :  `lsst.afw.image.MaskedImage`
    Image for which to determine the variance rescaling factor.

Returns
-------
factor : `float`
    Variance rescaling factor.

Definition at line 164 of file scaleVariance.py.

◆ pixelBased()

def lsst.pipe.tasks.scaleVariance.ScaleVarianceTask.pixelBased (   self,
  maskedImage 
)
Determine the variance rescaling factor from pixel statistics

We calculate SNR = image/sqrt(variance), and the distribution
for most of the background-subtracted image should have a standard
deviation of unity. The variance rescaling factor is the factor that
brings that distribution to have unit standard deviation.

This may not work well if the image has a lot of structure in it, as
the assumptions are violated. In that case, use an alternate
method.

Parameters
----------
maskedImage : `lsst.afw.image.MaskedImage`
    Image for which to determine the variance rescaling factor.

Returns
-------
factor : `float`
    Variance rescaling factor.

Definition at line 126 of file scaleVariance.py.

◆ run()

def lsst.pipe.tasks.scaleVariance.ScaleVarianceTask.run (   self,
  maskedImage 
)
Rescale the variance in a maskedImage

Parameters
----------
maskedImage :  `lsst.afw.image.MaskedImage`
    Image for which to determine the variance rescaling factor.

Returns
-------
factor : `float`
    Variance rescaling factor.

Raises
------
RuntimeError
    If the estimated variance rescaling factor exceeds the
    configured limit.

Definition at line 94 of file scaleVariance.py.

◆ subtractedBackground()

def lsst.pipe.tasks.scaleVariance.ScaleVarianceTask.subtractedBackground (   self,
  maskedImage 
)
Context manager for subtracting the background

We need to subtract the background so that the entire image
(apart from objects, which should be clipped) will have the
image/sqrt(variance) distributed about zero.

This context manager subtracts the background, and ensures it
is restored on exit.

Parameters
----------
maskedImage : `lsst.afw.image.MaskedImage`
    Image+mask+variance to have background subtracted and restored.

Returns
-------
context : context manager
    Context manager that ensure the background is restored.

Definition at line 66 of file scaleVariance.py.

Member Data Documentation

◆ ConfigClass

lsst.pipe.tasks.scaleVariance.ScaleVarianceTask.ConfigClass
static

Definition at line 58 of file scaleVariance.py.


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