ComputeNoiseCorrelationTask#
- class lsst.meas.algorithms.ComputeNoiseCorrelationTask(*args, **kwargs)#
Bases:
TaskCompute the noise correlation coefficients 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 computes a matrix of correlation coefficients of a desired size. It assumes that the noise is (at least the correlation coefficients are) stationary and uses spatial averaging to compute the correlation coefficients.
Methods Summary
run(maskedImage[, refMaskedImage])Compute the correlation matrix from a maskedImage.
subtractedBackground(maskedImage)Context manager for subtracting the background
Methods Documentation
- run(maskedImage: MaskedImage, refMaskedImage: MaskedImage | None = None) CorrelationMatrix#
Compute the correlation matrix from a maskedImage.
Parameters#
- maskedImage
MaskedImage Image for which to determine the correlation matrix.
- refMaskedImage
MaskedImage, optional Image from which to determine which pixels to mask. If None, it defaults to
maskedImage.
Returns#
- corr_matrix
CorrelationMatrix Correlation matrix of the maskedImage.
Raises#
- RuntimeError
Raised if
refMaskedImageis provided and does not have the same dimensions asmaskedImage.
- maskedImage
- subtractedBackground(maskedImage: 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 with unit variance. 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#
- contextcontext manager
Context manager that ensure the background is restored.
- maskedImage