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 variables triCellIndices, the cell that each triangle is part of; nodeCellIndices and nodeCellWeights, the indices and weights used to interpolate from MPAS cell centers to triangle nodes; Cartesian coordinates xNode, yNode, and zNode; and lonNode` and latNode in radians. lonNode is guaranteed to be within 180 degrees of the cell center corresponding to triCellIndices. Nodes always have a counterclockwise winding.