Internal API#
This page shows already-implemented Uxarray internal API functions. You can also check the UXarray Milestones and UXarray RoadMap for a high level understanding of UXarray’s future function development milestones and roadmap. Please let us know if you have any feedback!
UxDataset#
The uxarray.UxDataset
class inherits from xarray.Dataset
. Below is a list of
features explicitly added to work on Unstructured Grids.
Class#
|
A |
Attributes#
Methods#
Override to make sure the result is an instance of |
|
|
Add an array to this dataset. |
|
Override to make the result a complete instance of |
Override to make the result an instance of |
|
|
Override to make the result an |
|
Override to make the result a complete instance of |
|
Override to make the result a complete instance of |
UxDataArray#
The uxarray.UxDataArray
class inherits from xarray.DataArray
. Below is a list of
features explicitly added to work on Unstructured Grids.
Class#
|
N-dimensional |
Attributes#
Methods#
|
Override to make the result a |
|
Override to make the result a complete instance of |
|
Override to make the result a complete instance of |
Returns whether the data stored is Face Centered (i.e. |
|
Returns whether the data stored is Node Centered (i.e. |
Grid#
Class#
|
Represents a two-dimensional unstructured grid encoded following the UGRID conventions and provides grid-specific functionality. |
Operators#
|
Two grids are equal if they have matching grid topology variables, coordinates, and dims all of which are equal. |
|
Two grids are not equal if they have differing grid topology variables, coordinates, or dims. |
Helpers#
Connectivity#
Converts a given dense matrix connectivity to a sparse matrix format where the locations of non fill-value entries are stored using COO (coordinate list) standard. |
|
Replaces all instances of the the current fill value ( |
|
Constructs the UGRID connectivity variable ( |
|
Builds the Grid.Mesh2_node_faces: integer DataArray of size (nMesh2_node, nMaxNumFacesPerNode) (optional) A DataArray of indices indicating faces that are neighboring each node. |
|
Helper for ( |
|
Constructs the UGRID connectivity variable ( |
|
Constructs the UGRID connectivity variable ( |
|
Constructs the connectivity variable ( |
Geometry#
Constructs the shell of each polygon derived from the closed off face nodes, which can be used to construct Shapely Polygons. |
|
Constructs |
|
Constructs |
|
Constructs and returns a |
|
Constructs and returns a |
|
Constructs and returns a |
|
Determines if a pole point is inside a polygon. |
|
Classify the location of the polygon relative to the hemisphere. |
|
|
Check the number of intersections of the reference edge with the given edges. |
Coordinates#
A helper function that populates the xyz attribute in UXarray.Grid._ds. |
|
Helper function that populates the longitude and latitude and store it into the Mesh2_node_x and Mesh2_node_y. |
|
Finds the centroids using cartesian averaging of faces based off the vertices. |
|
Constructs the xyz centroid coordinate for each face using Cartesian Averaging. |
Arcs#
Calculate the angle between two 3D vectors u and v in radians. |
|
Calculate the angle between two 3D vectors u and v in radians. |
Utils#
|
Calculate the difference of products using the FMA (fused multiply-add) operation: (a * b) - (c * d). |
Solve for the intersection point between a great circle arc and a constant latitude. |
|
|
Calculate the inverse Jacobian matrix for a given set of parameters. |
Remapping#
Nearest Neighbor Remapping between two grids, mapping data that resides on either the corner nodes or face centers on the source grid to the corner nodes or face centers of the destination grid.. |
|
Nearest Neighbor Remapping implementation for |
|
Nearest Neighbor Remapping implementation for |
Grid Parsing and Encoding#
UGRID#
|
UGRID file reader. |
Encodes UGRID file . |
|
Check mesh topology and dimension. |
|
|
Checks whether a given |
MPAS#
|
Function to read in a MPAS Grid dataset and encode either the Primal or Dual Mesh in the UGRID conventions. |
|
Encodes the MPAS Primal-Mesh in the UGRID conventions. |
|
Encodes the MPAS Dual-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. |
Exodus#
|
Exodus file reader. |
|
Encodes an Exodus file. |
|
Helper function to get exodus element type from number of nodes. |
SCRIP#
|
If input dataset ( |
|
Function to reassign lat/lon variables to mesh2_node variables. |
|
Function to reassign UGRID formatted variables to SCRIP formatted variables. |
Shapefile#
|
Read shape file. |
Vertices#
Create a grid with faces constructed from vertices specified by the given argument. |
Utils#
|
Checks input and contents to determine grid type. |
Core Utils#
|
Given a dataset containing variables residing on an unstructured grid, remaps the original dimension name to match the UGRID conventions (i.e. |