polaris.mesh.connectivity.count_active_edges

polaris.mesh.connectivity.count_active_edges(ds_mesh, cell_mask)[source]

Count the active edges of each cell.

A cell of the ocean domain needs at least two of them, so that a C-grid has a way to move water in and a way to move it out. The two edges need not be adjacent.

Parameters:
Returns:

count (numpy.ndarray) – The number of active edges of each cell, as an integer array of shape (nCells,). Cells outside the domain are counted too; callers that care should mask the result.