uxarray.Grid.from_topology

uxarray.Grid.from_topology#

classmethod Grid.from_topology(node_lon, node_lat, face_node_connectivity, fill_value=None, start_index=0, dims_dict=None, **kwargs)#

Constructs a Grid object from user-defined topology variables provided in the UGRID conventions.

Note

To construct a UGRID-compliant grid, the user must provide at least node_lon, node_lat and face_node_connectivity

Parameters:
  • node_lon (np.ndarray) – Longitude of node coordinates

  • node_lat (np.ndarray) – Latitude of node coordinates

  • face_node_connectivity (np.ndarray) – Face node connectivity, mapping each face to the nodes that surround them

  • fill_value (Optional) – Value used for padding connectivity variables when the maximum number of elements in a row is less than the maximum.

  • start_index (Optional, default=0) – Start index (typically 0 or 1)

  • dims_dict (Optional, dict) – Dictionary of dimension names mapped to the ugrid conventions (i.e. {“nVertices”: “n_node})

  • **kwargs

Examples

>>> import uxarray as ux
>>> node_lon, node_lat, face_node_connectivity, fill_value = ...
>>> uxgrid = ux.Grid.from_ugrid(
...     node_lon, node_lat, face_node_connectivity, fill_value
... )