mesmer.xarray_utils.global_mean.weighted_mean#

mesmer.xarray_utils.global_mean.weighted_mean(data, weights, x_dim='lon', y_dim='lat')#

Calculate the area-weighted global mean

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).

  • x_dim (str, default: “lon”) – Name of the x-dimension.

  • y_dim (str, default: “lat”) – Name of the y-dimension.

Returns:

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