sigma_clipped_stats¶
-
astropy.stats.sigma_clipped_stats(data, mask=None, mask_val=None, sigma=3.0, iters=None)[source] [edit on github]¶ Calculate sigma-clipped statistics from data.
For example, sigma-clipped statistics can be used to estimate the background and background noise in an image.
Parameters: data : array-like
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 aTruevalue indicates the corresponding element ofdatais masked. Masked pixels are excluded when computing the image statistics.mask_val : float, optional
An image data value (e.g.,
0.0) that is ignored when computing the image statistics.mask_valwill be masked in addition to any inputmask.sigma : float, optional
The number of standard deviations to use as the clipping limit.
iters : int, optional
The number of iterations to perform sigma clipping, or
Noneto clip until convergence is achieved (i.e., continue until the last iteration clips nothing) when calculating the image statistics.Returns: mean, median, stddev : float
The mean, median, and standard deviation of the sigma-clipped image.