|
lsst.pipe.tasks
14.0-50-g5874b18d
|
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 = ScaleVarianceConfig | |
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 50 of file scaleVariance.py.
| def lsst.pipe.tasks.scaleVariance.ScaleVarianceTask.__init__ | ( | self, | |
| args, | |||
| kwargs | |||
| ) |
Definition at line 63 of file scaleVariance.py.
| 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 159 of file scaleVariance.py.
| 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 128 of file scaleVariance.py.
| 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 96 of file scaleVariance.py.
| 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 68 of file scaleVariance.py.
|
static |
Definition at line 60 of file scaleVariance.py.
1.8.13