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 = valueif 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,dvEdgeanddcEdgeand thex_periodandy_periodattributes (zero where the mesh is not periodic)coord ({'x', 'y'}) – The coordinate that is constant along the line
value (float) – The value of
coordon the line (m)
- Returns:
line (xarray.Dataset) – A dataset with dimension
nLineEdgescontaining:edgeIndexzero-based indices of the edges crossing the line
cellsOnLineEdgezero-based indices of the two cells of each edge, with dimension
TWOsign+1 where positive normal velocity (from the first cell of the edge to the second) is toward increasing
coord, -1 otherwisedvEdgethe length of each edge (m)
weightthe 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,valueandlengthattributes record the line and its length (m).