API reference#
This page provides an auto-generated summary of UXarray’s API. For more details and examples, refer to the relevant chapters in the main part of the documentation.
Top Level Functions#
|
Constructs and returns a |
|
Wraps |
|
Wraps |
Grid#
Constructor#
|
Represents a two-dimensional unstructured grid encoded following the UGRID conventions and provides grid-specific functionality. |
I/O & Conversion#
|
Constructs a |
|
Constructs a |
|
Constructs a |
|
Converts a structured |
|
Create a grid from unstructured points. |
|
Returns an |
|
Constructs a |
|
Constructs a |
|
Constructs a |
Indexing#
|
Indexes an unstructured grid along a given dimension ( |
Dimensions#
Names of all unstructured grid dimensions. |
|
Names and values of all unstructured grid 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#
Names of all connectivity variables. |
|
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 nodes that surround each node. |
|
Indices of the edges that surround each node. |
|
Indices of the faces that surround each node. |
Descriptors#
Names of all descriptor variables. |
|
The area of each face. |
|
Latitude Longitude Bounds for each Face in degrees. |
|
Distances between the two nodes that surround each edge in degrees. |
|
Distances between the centers of the faces that saddle each edge in degrees. |
|
Index of each face that crosses the antimeridian. |
|
Indices of nodes that border regions not covered by any geometry (holes) in a partial grid. |
|
Indices of edges that border regions not covered by any geometry (holes) in a partial grid. |
|
Indices of faces that border regions not covered by any geometry (holes) in a partial grid. |
|
Boolean indicated whether the Grid partial covers the unit sphere (i.e. contains holes). |
|
Boolean indicated whether the Grid completely covers the unit sphere (i.e. contains no holes). |
|
Boolean indicated whether the Grid is strictly composed of triangular faces. |
Attributes#
Dictionary of parsed attributes from the source grid. |
Methods#
Returns a deep copy of this grid. |
|
|
Converts all arrays to dask arrays with given chunks across grid dimensions in-place. |
|
Validates the current |
|
Face areas calculation function for grid class, calculates area of all faces in the grid. |
Function to calculate the total surface area of all the faces in a mesh. |
|
Normalizes Cartesian coordinates. |
|
|
Constructs face centers, this method provides users direct control of the method for constructing the face centers, the default method is "cartesian average", but a more accurate method is "welzl" that is based on the recursive Welzl algorithm. |
Inheritance of Xarray Functionality#
The primary data structures in UXarray, uxarray.UxDataArray
and uxarray.UxDataset
inherit from xarray.DataArray
and
xarray.Dataset
respectively. This means that they contain the same methods and attributes that are present in Xarray, with
new additions and some overloaded as discussed in the next sections. For a detailed list of Xarray specific behavior
and functionality, please refer to Xarray’s documentation.
UxDataArray#
Constructor#
|
Grid informed |
Grid Accessor#
Linked |
I/O & Conversion#
|
Constructs a |
Constructs a |
|
|
Convert a |
UxDataset#
Constructor#
|
Grid informed |
Grid Accessor#
Linked |
I/O & Conversion#
|
Converts a structured |
Plotting#
UXarray’s plotting API is written using hvPlot.
See also
Grid#
Plotting accessor for |
|
|
Plots the edges of a Grid. |
|
Plots the edges of a Grid. |
|
Generate a point plot for the grid corner nodes. |
|
Generate a point plot for the grid corner nodes. |
|
Wrapper for |
|
Wrapper for |
|
Wrapper for |
|
Wrapper for |
UxDataArray#
Plotting Accessor for |
|
|
Generated a shaded polygon plot. |
|
Generate a point plot based on the specified grid element type (nodes, faces, or edges) shaded with the data mapped to those elements. |
UxDataset#
Plotting accessor for |
Subsetting#
See also
Grid#
Accessor for performing unstructured grid subsetting, accessed through |
|
|
Subsets an unstructured grid by returning the |
|
Subsets an unstructured grid between two latitude and longitude points which form a bounding box. |
|
Subsets an unstructured grid by returning all elements within some radius (in degrees) from a center coord. |
UxDataArray#
Accessor for performing unstructured grid subsetting with a data variable, accessed through |
|
|
Subsets an unstructured grid by returning the |
|
Subsets an unstructured grid between two latitude and longitude points which form a bounding box. |
|
Subsets an unstructured grid by returning all elements within some radius (in degrees) from a center coord. |
Cross Sections#
Grid#
Accessor for cross-section operations on a |
|
|
Extracts a cross-section of the grid at a specified constant latitude. |
UxDataArray#
Accessor for cross-section operations on a |
|
Extracts a cross-section of the data array at a specified constant latitude. |
Remapping#
See also
UxDataArray#
Remapping accessor for |
|
|
Nearest Neighbor Remapping between a source |
Inverse Distance Weighted Remapping between a source |
UxDataset#
Remapping accessor for |
|
|
Nearest Neighbor Remapping between a source |
Inverse Distance Weighted Remapping between a source |
Mathematical Operators#
|
Computes the integral of a data variable. |
|
Computes the horizontal gradient of a data variable. |
|
Computes the absolute difference of a data variable. |
Dual Mesh Construction#
Compute the dual for a grid, which constructs a new grid centered around the nodes, where the nodes of the primal become the face centers of the dual, and the face centers of the primal become the nodes of the dual. |
|
Compute the dual mesh for a data array, returns a new data array object. |
|
Compute the dual mesh for a dataset, returns a new dataset object. |
Aggregations#
Topological#
Topological aggregations apply an aggregation (i.e. averaging) on a per-element basis. For example, instead of computing the average across all values, we can compute the average of all the nodes that surround each face and store the result on each face.
|
Performs a topological mean aggregation. |
|
Performs a topological min aggregation. |
|
Performs a topological max aggregation. |
|
Performs a topological median aggregation. |
|
Performs a topological std aggregation. |
|
Performs a topological var aggregation. |
|
Performs a topological sum aggregation. |
|
Performs a topological prod aggregation. |
|
Performs a topological all aggregation. |
|
Performs a topological any aggregation. |
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. |
Spherical Geometry#
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. |
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. |
Accurate Computing#
|
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. |