ComputeNoiseCorrelationTask#

class lsst.meas.algorithms.ComputeNoiseCorrelationTask(*args, **kwargs)#

Bases: Task

Compute 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#

maskedImageMaskedImage

Image for which to determine the correlation matrix.

refMaskedImageMaskedImage, optional

Image from which to determine which pixels to mask. If None, it defaults to maskedImage.

Returns#

corr_matrixCorrelationMatrix

Correlation matrix of the maskedImage.

Raises#

RuntimeError

Raised if refMaskedImage is provided and does not have the same dimensions as 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#

maskedImagelsst.afw.image.MaskedImage

Image+mask+variance to have background subtracted and restored.

Returns#

contextcontext manager

Context manager that ensure the background is restored.