oceanspy.compute.weighted_mean
- oceanspy.compute.weighted_mean(od, varNameList=None, axesList=None, storeWeights=True, aliased=True)[source]
Compute weighted means using volumes, surfaces, or distances.
\[\overline{\chi} = \frac{\sum_{i=1}^n w_i\chi_i}{\sum_{i=1}^n w_i}\]- Parameters:
- od: OceanDataset
oceandataset used to compute.
- varNameList: 1D array_like, str, or None
Name of variables to average. If None, use all variables.
- axesList: None, list
List of axes. If None, compute average along all axes (excluding mooring and station).
- storeWeights: bool
True: store weight values. False: drop weight values.
- aliased: bool
Set it False when working with private ds and grid.
- Returns:
- ds: xarray.Dataset
- w_mean_[varName]weight_[varName]
See also