craftutils.observation.image.SigmaClip.__call__(data, axis=None, masked=True, return_bounds=False, copy=True)

Perform sigma clipping on the provided data.

Parameters

dataarray-like or ~numpy.ma.MaskedArray

The data to be sigma clipped.

axisNone or int or tuple of int, optional

The axis or axes along which to sigma clip the data. If None, then the flattened data will be used. axis is passed to the cenfunc and stdfunc. The default is None.

maskedbool, optional

If True, then a ~numpy.ma.MaskedArray is returned, where the mask is True for clipped values. If False, then a ~numpy.ndarray is returned. The default is True.

return_boundsbool, optional

If True, then the minimum and maximum clipping bounds are also returned.

copybool, optional

If True, then the data array will be copied. If False and masked=True, then the returned masked array data will contain the same array as the input data (if data is a ~numpy.ndarray or ~numpy.ma.MaskedArray). If False and masked=False, the input data is modified in-place. The default is True.

Returns

resultarray-like

If masked=True, then a ~numpy.ma.MaskedArray is returned, where the mask is True for clipped values and where the input mask was True.

If masked=False, then a ~numpy.ndarray is returned.

If return_bounds=True, then in addition to the masked array or array above, the minimum and maximum clipping bounds are returned.

If masked=False and axis=None, then the output array is a flattened 1D ~numpy.ndarray where the clipped values have been removed. If return_bounds=True then the returned minimum and maximum thresholds are scalars.

If masked=False and axis is specified, then the output ~numpy.ndarray will have the same shape as the input data and contain np.nan where values were clipped. If the input data was a masked array, then the output ~numpy.ndarray will also contain np.nan where the input mask was True. If return_bounds=True then the returned minimum and maximum clipping thresholds will be be ~numpy.ndarrays.