Internal API#

This page shows already-implemented Uxarray internal API functions. You can also check the draft Uxarray API documentation to see the tentative whole API and let us know if you have any feedback!

Grid Methods#


Populates a dictionary for storing uxarray's internal representation of xarray object.


Loads a mesh dataset.


Create a grid with faces constructed from vertices specified by the given argument.


Initialize attributes for directly accessing UGRID dimensions and variables.


Constructs the UGRID connectivity variable (Mesh2_edge_nodes) and stores it within the internal (Grid.ds) and through the attribute (Grid.Mesh2_edge_nodes).


Constructs the UGRID connectivity variable (Mesh2_face_edges) and stores it within the internal (Grid.ds) and through the attribute (Grid.Mesh2_face_edges).


A helper function that populates the xyz attribute in UXarray.ds.


Helper function that populates the longitude and latitude and store it into the Mesh2_node_x and Mesh2_node_y.


Constructs nNodes_per_face, which contains the number of non- fill-value nodes for each face in Mesh2_face_nodes

Grid Helper Modules#


Exodus file reader.


Encodes an Exodus file.


Helper function to get exodus element type from number of nodes.


Encodes UGRID file .


UGRID file reader.


Encodes the MPAS Dual-Mesh in the UGRID conventions.


Encodes the MPAS Primal-Mesh in the UGRID conventions.


Replaces the padded values in verticesOnCell defined by nEdgesOnCell with a fill-value.


Replaces all instances of a zero (invalid/missing MPAS value) with a fill value.


Given an input using that is one-indexed, subtracts one from all non- fill value entries to convert to zero-indexed.


Helper to set MPAS global attributes.


Function to read in a MPAS Grid dataset and encode either the Primal or Dual Mesh in the UGRID conventions.


Function to reassign lat/lon variables to mesh2_node variables.


Function to reassign UGRID formatted variables to SCRIP formatted variables.


If input dataset (in_ds) file is an unstructured SCRIP file, function will reassign SCRIP variables to UGRID conventions in output file (out_ds).


Check mesh topology and dimension.


Replaces all instances of the the current fill value (original_fill) in (grid_var) with (new_fill) and converts to the dtype defined by (new_dtype)