compass.landice.tests.ismip7_calibration.terms.stack_cells

compass.landice.tests.ismip7_calibration.terms.stack_cells(da, cell_dims)[source]

Flatten the cell dimensions of da into a single dimension.

Parameters:
  • da (xarray.DataArray) – Array with one or more cell dimensions.

  • cell_dims (sequence of str) – The dimensions to flatten, e.g. ('y', 'x') for a structured grid or ('nCells',) for an MPAS mesh.

Returns:

xarray.DataArray – da with cell_dims replaced by CELL_DIM.