compass.landice.tests.ismip7_calibration.terms.integrate_by_group
- compass.landice.tests.ismip7_calibration.terms.integrate_by_group(melt, area, mask, groups, cell_dims, group_dim='basins')[source]
Integrate a melt rate over each group, in Gt yr-1.
This is the mesh-agnostic form of the toolbox’s
melt.where(mask).groupby(groups).sum() * reso**2 / 1e12.- Parameters:
melt (xarray.DataArray) – Melt rate in kg m-2 yr-1. May carry any number of extra dimensions (parameter values, ocean model, year, …); they are preserved.
area (xarray.DataArray) – Cell area in m2, over
cell_dimsonly.mask (xarray.DataArray or None) – Boolean; True where the cell should contribute (e.g. floating ice).
groups (xarray.DataArray) – Group id per cell (basin number, buttressing bin, …).
cell_dims (sequence of str) – Dimensions of
meltthat index cells.group_dim (str, optional) – Name to give the resulting group dimension.
- Returns:
xarray.DataArray – Integrated melt in Gt yr-1, with
cell_dimsreplaced bygroup_dim. Groups whose total is exactly zero are set to NaN.