conditionalSigmaClip

lsst.ts.wep.utils.conditionalSigmaClip(array: ndarray, sigmaClipKwargs: dict, stdMin: float = 0.005) ndarray

Apply conditional sigma clipping to an array. Note this function applies sigma clipping to each column of the input array, and replaces the column with the clipped data while maintaining masked elements as NaN. Sigma clipping is only applied if the standard deviation exceeds std_min. This function is used in the combineZernikesSigmaClipTask

Parameters

arraynp.ndarray

Input array to be processed.

sigmafloat

Number of standard deviations for the clipping limit.

stdMinfloat

Minimum standard deviation to apply sigma clipping.

stdFuncstr

Function to calculate the standard deviation. Can be either “mad_std” or “std”

Returns

np.ndarray

Processed array with conditional sigma clipping applied.

Raises

ValueError

If stdFunc is not “mad_std” or “std”