webbpsf_ext.robust.mean

webbpsf_ext.robust.mean(inputData, Cut=3.0, axis=None, dtype=None, keepdims=False, return_std=False, return_mask=False)[source]

Robust Mean

Robust estimator of the mean of a data set. Based on the resistant_mean function from the AstroIDL User’s Library. NaN values are excluded.

This function trims away outliers using the median and the median absolute deviation. An approximation formula is used to correct for the truncation caused by trimming away outliers.

Parameters

inputData (ndarray) – The input data.

Keyword Arguments
  • Cut (float) – Sigma for rejection; default is 3.0.

  • axis (None or int or tuple of ints, optional) –

    Axis or axes along which the deviation is computed. The default is to compute the deviation of the flattened array.

    If this is a tuple of ints, a standard deviation is performed over multiple axes, instead of a single axis or all the axes as before. This is the equivalent of reshaping the input data and then taking the standard devation.

  • keepdims (bool, optional) – If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the original arr.

  • return_std (bool) – Also return the std dev calculated using only the “good” data?

  • return_mask (bool) – If set to True, then return only boolean array of good (1) and rejected (0) values.