mesmer.core.weighted.weighted_mean

Contents

mesmer.core.weighted.weighted_mean#

mesmer.core.weighted.weighted_mean(data, weights, dims=None)#

weighted mean - convenience function which ignores data_vars missing dims

Parameters:
  • data (xr.Dataset | xr.DataArray) – Array reduce to the global mean.

  • weights (xr.DataArray) – DataArray containing the area of each grid cell (or a measure proportional to the grid cell area).

  • dims (Hashable or Iterable of Hashable, optional) – Dimension(s) over which to apply the weighted mean.

Returns:

obj (xr.Dataset | xr.DataArray) – Array converted to an unstructured grid.