User API#
This page shows already-implemented Uxarray user 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#
A xarray.Dataset
-like, multi-dimensional, in memory, array database.
Inherits from xarray.Dataset
and has its own unstructured grid-aware
dataset operators and attributes through the uxgrid
accessor.
Below is a list of features explicitly added to UxDataset to work on Unstructured Grids:
Class#
|
A |
IO#
|
Wraps |
|
Wraps |
Attributes#
|
|
Property to keep track of the source data sets used to instantiate this |
Methods#
|
Concise summary of Dataset variables and attributes including grid topology information stored in the |
Remapping#
|
Nearest Neighbor Remapping between a source ( |
Inverse Distance Weighted Remapping between a source ( |
Plotting#
Plotting Accessor for UxDataset, accessed through |
UxDataArray#
N-dimensional xarray.DataArray
-like array. Inherits from xarray.DataArray
and has its own unstructured grid-aware array operators and attributes through
the uxgrid
accessor.
Below is a list of features explicitly added to UxDataset to work on Unstructured Grids:
Class#
|
N-dimensional |
IO#
Converts a |
|
|
Constructs a |
|
Constructs a |
Attributes#
|
Methods#
|
Computes the integral of a data variable residing on an unstructured grid. |
|
Grid-informed implementation of xarray's |
Remapping#
|
Nearest Neighbor Remapping between a source ( |
Inverse Distance Weighted Remapping between a source ( |
|
Computes the Nodal Average of a Data Variable, which is the mean of the nodes that surround each face. |
Plotting#
Plotting Accessor for UxDataArray, accessed through |
|
Visualizes an unstructured grid data variable using data shading (rasterization + shading). |
|
Rasterized Plot of a Data Variable Residing on an Unstructured Grid. |
|
Vector Polygon Plot of a Data Variable Residing on an Unstructured Grid. |
|
Vector Point Plot of a Data Variable Mapped to either Node, Edge, or Face Coordinates. |
Subsetting#
Accessor for performing unstructured grid subsetting with a data variable, accessed through |
|
Subsets an unstructured grid by returning the |
|
Subsets an unstructured grid by returning all elements within some radius (in degrees) from a center coord. |
|
Subsets an unstructured grid between two latitude and longitude points which form a bounding box. |
Calculus Operators#
|
Computes the integral of a data variable residing on an unstructured grid. |
|
Computes the horizontal gradient of a data variable residing on an unstructured grid. |
|
Computes the absolute difference between a data variable. |
Grid#
Unstructured grid topology definition to store stores grid topology dimensions, coordinates, variables and provides grid-specific functions.
Can be used standalone to explore an unstructured grid topology, or can be
seen as the property of uxarray.UxDataset
and uxarray.DataArray
to make
them unstructured grid-aware data sets and arrays.
Class#
|
Represents a two-dimensional unstructured grid encoded following the UGRID conventions and provides grid-specific functionality. |
IO#
|
Constructs and returns an |
|
Constructs a |
|
Constructs a |
|
Constructs a |
|
Constructs a |
|
Constructs a |
Validate a grid object check for common errors, such as: |
Methods#
Function to calculate the total surface area of all the faces in a mesh. |
|
|
Face areas calculation function for grid class, calculates area of all faces in the grid. |
|
Encodes the grid as a new xarray.Dataset per grid format supplied in the grid_type argument. |
|
Get the BallTree data structure of this Grid that allows for nearest neighbor queries (k nearest or within some radius) on either the ( |
|
Get the KDTree data structure of this Grid that allows for nearest neighbor queries (k nearest or within some radius) on either the ( |
Returns a deep copy of this grid. |
|
|
Indexes an unstructured grid along a given dimension ( |
Dimensions#
Total number of nodes. |
|
Total number of edges. |
|
Total number of faces. |
|
The maximum number of nodes that can make up a single face. |
|
The maximum number of edges that surround a single face. |
|
The maximum number of faces that surround a single face. |
|
The maximum number of edges that surround a single edge. |
|
The maximum number of faces that surround a single node. |
|
The maximum number of edges that surround a single node. |
|
The number of nodes that make up each face. |
Spherical Coordinates#
Longitude of each node in degrees. |
|
Latitude of each node in degrees. |
|
Longitude of the center of each edge in degrees. |
|
Latitude of the center of each edge in degrees. |
|
Longitude of the center of each face in degrees. |
|
Latitude of the center of each face in degrees. |
Cartesian Coordinates#
Cartesian x location of each node in meters. |
|
Cartesian y location of each node in meters. |
|
Cartesian z location of each node in meters. |
|
Cartesian x location of the center of each edge in meters. |
|
Cartesian y location of the center of each edge in meters. |
|
Cartesian z location of the center of each edge in meters. |
|
Cartesian x location of the center of each face in meters. |
|
Cartesian y location of the center of each face in meters. |
|
Cartesian z location of the center of each face in meters. |
Connectivity#
Indices of the nodes that make up each face. |
|
Indices of the edges that surround each face. |
|
Indices of the faces that surround each face. |
|
Indices of the two nodes that make up each edge. |
|
Indices of the edges that surround each edge. |
|
Indices of the faces that saddle each edge. |
|
Indices of the edges that surround each node. |
|
Indices of the faces that surround each node. |
Grid Descriptors#
The area of each face. |
|
Index of each face that crosses the antimeridian. |
|
Latitude Longitude Bounds for each Face in degrees. |
Attributes#
Dictionary of parsed attributes from the source grid. |
Plotting#
Plotting Accessor for Grid, accessed through |
|
Vector Point Plot of Nodes (latitude & longitude of the nodes that define the corners of each face) |
|
Vector Point Plot of Nodes (latitude & longitude of the nodes that define the corners of each face) |
|
Vector Point Plot of Face Coordinates (latitude & longitude of the centroid of each face) |
|
Vector Point Plot of Face Coordinates (latitude & longitude of the centroid of each face) |
|
Vector Point Plot of Edge Coordinates (latitude & longitude of the center of each edge) |
|
Vector Point Plot of Edge Coordinates (latitude & longitude of the center of each edge) |
|
Vector Line Plot of the edges that make up each face. |
|
Vector Line Plot of the edges that make up each face. |
Subsetting#
Accessor for performing unstructured grid subsetting, accessed through |
|
Subsets an unstructured grid by returning the |
|
Subsets an unstructured grid by returning all elements within some radius (in degrees) from a center coord. |
|
Subsets an unstructured grid between two latitude and longitude points which form a bounding box. |
Nearest Neighbor Data Structures#
KDTree#
|
Custom KDTree data structure written around the |
|
Queries the tree for the |
|
Queries the tree for all neighbors within a radius |
BallTree#
|
Custom BallTree data structure written around the |
|
Queries the tree for the |
Queries the tree for all neighbors within a radius |
Helpers#
Face Area#
|
Calculate area of a face on sphere. |
Given coords, connectivity and other area calculation params, this routine loop over all faces and return an numpy array with areas of each face. |
|
Calculate Jacobian of a spherical triangle. |
|
|
Calculate Jacobian of a spherical triangle. |
|
Gauss Quadrature Points for integration. |
|
Triangular Quadrature Points for integration. |
Connectivity#
Closes ( |
Coordinates#
Helper function to Convert the node coordinate from 2D longitude/latitude to normalized 3D xyz. |
|
Calculate the latitude and longitude in radiance for a node represented in the [x, y, z] 3D Cartesian coordinates. |
|
Helper function to project an arbitrary node in 3D coordinates [x, y, z] on the unit sphere. |
Arcs#
|
Determines whether the number q is between p and r. |
|
Check if a point lies on a given Great Circle Arc (GCA). |
|
Calculate the maximum or minimum latitude of a great circle arc defined by two 3D points. |
Intersections#
Calculate the intersection point(s) of two Great Circle Arcs (GCAs) in a Cartesian coordinate system. |
|
Calculate the intersection point(s) of a Great Circle Arc (GCA) and a constant latitude line in a Cartesian coordinate system. |
Accurate Computing Utils#
|
Calculate the cross product of two 3D vectors utilizing the fused multiply-add operation. |
|
Calculate the dot product of two vectors using the FMA (fused multiply- add) operation. |