compass.landice.tests.ismip7_calibration.terms.average_by_group

compass.landice.tests.ismip7_calibration.terms.average_by_group(melt, area, mask, groups, cell_dims, group_dim='basins')[source]

Area-weighted mean melt rate over each group, in kg m-2 yr-1.

This is the mesh-agnostic form of the toolbox’s melt.where(mask).groupby(groups).mean(). On a uniform grid an area-weighted mean and a plain mean coincide; on a variable-resolution mesh they do not, and the area-weighted one is the physically meaningful choice.

Parameters and returns are as for integrate_by_group(), except that the result is a mean rather than an integral.