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#

UxDataset(*args[, uxgrid, source_datasets])

A xarray.Dataset-like, multi-dimensional, in memory, array database.

Attributes#

Methods#

UxDataArray#

The uxarray.UxDataArray class inherits from xarray.DataArray. Below is a list of features explicitly added to work on Unstructured Grids.

Class#

UxDataArray(*args[, uxgrid])

N-dimensional xarray.DataArray-like array.

Attributes#

UxDataArray._uxgrid

Methods#

Grid#

Class#

Grid(input_obj, **kwargs)

Unstructured grid topology definition.

IO#

io._exodus._read_exodus(ext_ds, grid_var_names)

Exodus file reader.

io._exodus._encode_exodus(ds, grid_var_names)

Encodes an Exodus file.

io._exodus._get_element_type(num_nodes)

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

io._mpas._dual_to_ugrid(in_ds, out_ds)

Encodes the MPAS Dual-Mesh in the UGRID conventions.

io._mpas._primal_to_ugrid(in_ds, out_ds)

Encodes the MPAS Primal-Mesh in the UGRID conventions.

io._mpas._replace_padding(verticesOnCell, ...)

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

io._mpas._replace_zeros(grid_var)

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

io._mpas._to_zero_index(grid_var)

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

io._mpas._set_global_attrs(in_ds, out_ds)

Helper to set MPAS global attributes.

io._mpas._read_mpas(ext_ds[, use_dual])

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

io._ugrid._encode_ugrid(ds)

Encodes UGRID file .

io._ugrid._read_ugrid(xr_ds, var_names_dict)

UGRID file reader.

io._scrip._read_scrip(ext_ds)

Function to reassign lat/lon variables to mesh2_node variables.

io._scrip._encode_scrip(mesh2_face_nodes, ...)

Function to reassign UGRID formatted variables to SCRIP formatted variables.

io._scrip._to_ugrid(in_ds, out_ds)

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

Methods#

Attributes#

Grid._Mesh2_node_z

Coordinate Variable _Mesh2_node_z, which contains the level of each node.

Operators#

Helpers#

utils.helpers._is_ugrid(ds)

Check mesh topology and dimension.

utils.helpers._replace_fill_values(grid_var, ...)

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)