sigma_clipped_stats¶

astropy.stats.
sigma_clipped_stats
(data, mask=None, mask_value=None, sigma=3.0, sigma_lower=None, sigma_upper=None, iters=5, cenfunc=<function median>, stdfunc=<function std>, std_ddof=0, axis=None)[source] [edit on github]¶ Calculate sigmaclipped statistics on the provided data.
Parameters: data : arraylike
Data array or object that can be converted to an array.
mask :
numpy.ndarray
(bool), optionalA boolean mask with the same shape as
data
, where aTrue
value indicates the corresponding element ofdata
is masked. Masked pixels are excluded when computing the statistics.mask_value : float, optional
A data value (e.g.,
0.0
) that is ignored when computing the statistics.mask_value
will be masked in addition to any inputmask
.sigma : float, optional
The number of standard deviations to use as the lower and upper clipping limit. These limits are overridden by
sigma_lower
andsigma_upper
, if input. Defaults to 3.sigma_lower : float, optional
sigma_upper : float, optional
iters : int, optional
The number of iterations to perform sigma clipping, or
None
to clip until convergence is achieved (i.e., continue until the last iteration clips nothing) when calculating the statistics. Defaults to 5.cenfunc : callable, optional
The function used to compute the center for the clipping. Must be a callable that takes in a masked array and outputs the central value. Defaults to the median (
numpy.ma.median
).stdfunc : callable, optional
The function used to compute the standard deviation about the center. Must be a callable that takes in a masked array and outputs a width estimator. Masked (rejected) pixels are those where:
deviation < (sigma_lower * stdfunc(deviation)) deviation > (sigma_upper * stdfunc(deviation))
where:
deviation = data  cenfunc(data [,axis=int])
Defaults to the standard deviation (
numpy.std
).std_ddof : int, optional
The delta degrees of freedom for the standard deviation calculation. The divisor used in the calculation is
N  std_ddof
, whereN
represents the number of elements. The default is zero.axis :
None
or int or tuple of int, optionalReturns: mean, median, stddev : float
The mean, median, and standard deviation of the sigmaclipped data.