xugrid.UgridRolesAccessor#

class xugrid.UgridRolesAccessor(ds: Dataset)[source]#

Xarray Dataset “accessor” to retrieve the names of UGRID variables.

Examples

To get a list of the UGRID dummy variables in the dataset:

>>> dataset.ugrid_roles.topology

To get the names of the connectivity variables in the dataset:

>>> dataset.ugrid_roles.connectivity

Names can also be accessed directly through the topology:

>>> dataset.ugrid_roles["mesh2d"]["node_dimension"]
__init__(ds: Dataset)[source]#

Methods

__init__(ds)

Attributes

connectivity

Get the names of the variables containing the UGRID connectivity data.

coordinates

Get the names of the coordinate variables from the topology attributes.

dimensions

Get the dimension names from the topology attributes and infer them from connectivity arrays or coordinates.

topology

Get the names of the topology dummy variables, marked by a CF-role of mesh_topology.