xarray_werrmean
- PlasmaCalcs.tools.xarray_tools.xarray_werr_stats.xarray_werrmean(array, dim=None, *, keep=None, promote_dims_if_needed=True, missing_dims='raise', **kw)
returns Dataset of ‘mean’ and ‘std’ for array.
Equivalent: xarray_stats(array, stats=[‘mean’, ‘std’], …)- dim: None, str, or iterable of strs
- apply operation along these dimensions
- keep: None, str, or iterable of strs
- apply operation along all except for these dimensions.(can provide keep or dim, but not both.)
- promote_dims_if_needed: bool
- whether to promote non-dimension coords to dimensions.if False, raise DimensionKeyError if any relevant coord is not already a dimension.
- missing_dims: str in (‘ignore’, ‘warn’, ‘raise’)
- what to do if any coord is not found:‘ignore’ –> do nothing.‘warn’ –> raise a warning.‘raise’ –> raise DimensionKeyError.if not ‘raise’, any missing dims will be skipped.
additional kwargs are passed to array.mean and std.Can provide skipna=True/False to skip NaNs or not; default True for float dtypes.see also: xarray_werradd, xarray_werrsub, xarray_werrmul, xarray_werrdiv.Example:ds = arr.pc.werrmean().pc.werradd(arr2.pc.werrmean())ds[‘mean’] == arr.mean() + arr2.mean(),ds[‘std’] == sqrt(arr.std()**2 + arr2.std()**2)