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!
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 |
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 |
|
Constructs the UGRID connectivity variable ( |
|
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. |
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 |
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. |
Lines#
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). |
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. |
|
Helper to set MPAS global attributes. |
|
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. |