xugrid.UgridDatasetAccessor#

class xugrid.UgridDatasetAccessor(obj: Dataset, grids: Sequence[Type[AbstractUgrid]])[source]#
__init__(obj: Dataset, grids: Sequence[Type[AbstractUgrid]])[source]#

Methods

__init__(obj, grids)

assign_edge_coords()

Assign edge coordinates from the grid to the object.

assign_face_coords()

Assign face coordinates from the grid to the object.

assign_node_coords()

Assign node coordinates from the grid to the object.

clip_box(xmin, ymin, xmax, ymax)

Clip the DataArray or Dataset by a bounding box.

intersect_line(start, end)

Intersect a line with the grid of this data, and fetch the values of the intersected faces.

intersect_linestring(linestring)

Intersect the grid along a collection of linestrings.

partition(n_part)

Partition a grid into a given number of parts.

partition_by_label(labels)

Partition a grid by labels.

rasterize(resolution)

Rasterize all face data on 2D unstructured grids by sampling.

rasterize_like(other)

Rasterize unstructured all face data on 2D unstructured grids by sampling on the x and y coordinates of other.

reindex_like(other[, tolerance])

Conform this object to match the topology of another object.

rename(new_name_or_name_dict)

Give a new name to the UGRID topology and update the associated coordinate and dimension names in the Dataset.

sel([x, y])

sel_points(x, y[, out_of_bounds, fill_value])

Select points in the unstructured grid.

set_crs([crs, epsg, allow_override, topology])

Set the Coordinate Reference System (CRS) of a UGRID topology.

set_node_coords(node_x, node_y[, topology])

Given names of x and y coordinates of the nodes of an object, set them as the coordinates in the grid.

to_crs([crs, epsg, topology])

Transform geometries to a new coordinate reference system.

to_dataset([optional_attributes])

Convert this UgridDataset into a standard xarray.Dataset.

to_geodataframe([dim_order])

Convert data and topology of one facet (node, edge, face) of the grid to a geopandas GeoDataFrame.

to_netcdf(*args, **kwargs)

Write dataset contents to a UGRID compliant netCDF file.

to_nonperiodic(xmax)

Convert the grid from a periodic grid (where the rightmost boundary shares its nodes with the leftmost boundary) to an aperiodic grid, where the leftmost nodes are separate from the rightmost nodes.

to_periodic()

Convert every grid to a periodic grid, where the rightmost boundary shares its nodes with the leftmost boundary.

to_zarr(*args, **kwargs)

Write dataset contents to a UGRID compliant Zarr file.

Attributes

bounds

Mapping from grid name to tuple containing minx, miny, maxx, maxy values of the grid's node coordinates for every grid in the dataset.

crs

The Coordinate Reference System (CRS) represented as a pyproj.CRS object.

grid

Returns the single UGRID topology in this dataset.

name

Returns name of the single UGRID topology in this dataset.

names

Names of all the UGRID topologies in the dataset.

topology

Mapping from names to UGRID topologies.

total_bounds

Returns a tuple containing minx, miny, maxx, maxy values for the bounds of the dataset as a whole.