polaris.ocean.overturning.get_line_edges

polaris.ocean.overturning.get_line_edges(ds_mesh: Dataset, coord: Literal['x', 'y'], value: float) → Dataset[source]

Find the edges crossing a line of constant x or y on a planar mesh

An edge crosses the line coord = value if its two cells lie on opposite sides of it. Edges on a domain boundary are never included. Across a periodic seam, cell positions are unwrapped, so the line may lie anywhere in the domain.

Parameters:
  • ds_mesh (xarray.Dataset) – A planar MPAS mesh, with cellsOnEdge, xCell, yCell, dvEdge and dcEdge and the x_period and y_period attributes (zero where the mesh is not periodic)

  • coord ({'x', 'y'}) – The coordinate that is constant along the line

  • value (float) – The value of coord on the line (m)

Returns:

line (xarray.Dataset) – A dataset with dimension nLineEdges containing:

edgeIndex

zero-based indices of the edges crossing the line

cellsOnLineEdge

zero-based indices of the two cells of each edge, with dimension TWO

sign

+1 where positive normal velocity (from the first cell of the edge to the second) is toward increasing coord, -1 otherwise

dvEdge

the length of each edge (m)

weight

the length of each edge projected onto the line (m), used for along-line means; the weights sum to the length of the line

The coord, value and length attributes record the line and its length (m).