polaris.ocean.viz.transect.horiz.mesh_to_triangles
- polaris.ocean.viz.transect.horiz.mesh_to_triangles(ds_mesh)[source]
Construct a dataset in which each MPAS cell is divided into the triangles connecting pairs of adjacent vertices to cell centers.
- Parameters:
ds_mesh (xarray.Dataset) – An MPAS mesh
- Returns:
ds_tris (xarray.Dataset) – A dataset that defines triangles connecting pairs of adjacent vertices to cell centers as well as the cell index that each triangle is in and cell indices and weights for interpolating data defined at cell centers to triangle nodes.
ds_tris
includes variablestriCellIndices
, the cell that each triangle is part of;nodeCellIndices
andnodeCellWeights
, the indices and weights used to interpolate from MPAS cell centers to triangle nodes; Cartesian coordinatesxNode
,yNode
, andzNode
; andlonNode`
andlatNode
in radians.lonNode
is guaranteed to be within 180 degrees of the cell center corresponding totriCellIndices
. Nodes always have a counterclockwise winding.