xugrid.UgridDataset#

class xugrid.UgridDataset(obj: Dataset = None, grids: Type[AbstractUgrid] | Sequence[Type[AbstractUgrid]] = None)[source]#
__init__(obj: Dataset = None, grids: Type[AbstractUgrid] | Sequence[Type[AbstractUgrid]] = None)[source]#

Methods

__init__([obj, grids])

all([dim, keep_attrs])

Reduce this Dataset's data by applying all along some dimension(s).

any([dim, keep_attrs])

Reduce this Dataset's data by applying any along some dimension(s).

apply(func[, keep_attrs, args])

Backward compatible implementation of map

argmax([dim])

Indices of the maxima of the member variables.

argmin([dim])

Indices of the minima of the member variables.

argsort([axis, kind, order])

Returns the indices that would sort this array.

as_numpy()

Coerces wrapped data and coordinates into numpy arrays, returning a Dataset.

assign([variables])

Assign new data variables to a Dataset, returning a new object with all the original variables in addition to the new ones.

assign_attrs(*args, **kwargs)

Assign new attrs to this object.

assign_coords([coords])

Assign new coordinates to this object.

astype(dtype, *[, order, casting, subok, ...])

Copy of the xarray object, with data cast to a specified type.

bfill(dim[, limit])

Fill NaN values by propagating values backward

broadcast_equals(other)

Two Datasets are broadcast equal if they are equal after broadcasting all variables against each other.

broadcast_like(other[, exclude])

Broadcast this DataArray against another Dataset or DataArray.

chunk([chunks, name_prefix, token, lock, ...])

Coerce all arrays in this dataset into dask arrays with the given chunks.

clip([min, max, keep_attrs])

Return an array whose values are limited to [min, max].

close()

Release any resources linked to this object.

coarsen([dim, boundary, side, coord_func])

Coarsen object for Datasets.

combine_first(other)

Combine two Datasets, default to data_vars of self.

compute(**kwargs)

Manually trigger loading and/or computation of this dataset's data from disk or a remote source into memory and return a new dataset.

conj()

Complex-conjugate all elements.

conjugate()

Return the complex conjugate, element-wise.

convert_calendar(calendar[, dim, align_on, ...])

Convert the Dataset to another calendar.

copy([deep, data])

Returns a copy of this dataset.

count([dim, keep_attrs])

Reduce this Dataset's data by applying count along some dimension(s).

cumprod([dim, skipna, keep_attrs])

Reduce this Dataset's data by applying cumprod along some dimension(s).

cumsum([dim, skipna, keep_attrs])

Reduce this Dataset's data by applying cumsum along some dimension(s).

cumulative(dim[, min_periods])

Accumulating object for Datasets

cumulative_integrate(coord[, datetime_unit])

Integrate along the given coordinate using the trapezoidal rule.

curvefit(coords, func[, reduce_dims, ...])

Curve fitting optimization for arbitrary functions.

diff(dim[, n, label])

Calculate the n-th order discrete difference along given axis.

differentiate(coord[, edge_order, datetime_unit])

Differentiate with the second order accurate central differences.

drop([labels, dim, errors])

Backward compatible method based on drop_vars and drop_sel

drop_dims(drop_dims, *[, errors])

Drop dimensions and associated variables from this dataset.

drop_duplicates(dim, *[, keep])

Returns a new Dataset with duplicate dimension values removed.

drop_encoding()

Return a new Dataset without encoding on the dataset or any of its variables/coords.

drop_indexes(coord_names, *[, errors])

Drop the indexes assigned to the given coordinates.

drop_isel([indexers])

Drop index positions from this Dataset.

drop_sel([labels, errors])

Drop index labels from this dataset.

drop_vars(names, *[, errors])

Drop variables from this dataset.

dropna(dim, *[, how, thresh, subset])

Returns a new dataset with dropped labels for missing values along the provided dimension.

dump_to_store(store, **kwargs)

Store dataset contents to a backends.*DataStore object.

equals(other)

Two Datasets are equal if they have matching variables and coordinates, all of which are equal.

eval(statement, *[, parser])

Calculate an expression supplied as a string in the context of the dataset.

expand_dims([dim, axis])

Return a new object with an additional axis (or axes) inserted at the corresponding position in the array shape.

ffill(dim[, limit])

Fill NaN values by propagating values forward

fillna(value)

Fill missing values in this object.

filter_by_attrs(**kwargs)

Returns a Dataset with variables that match specific conditions.

from_dataframe([sparse])

Convert a pandas.DataFrame into an xarray.Dataset

from_dict()

Convert a dictionary into an xarray.Dataset.

from_geodataframe(geodataframe)

Convert a geodataframe into the appropriate Ugrid topology and dataset.

get(k[,d])

get_index(key)

Get an index for a dimension, with fall-back to a default RangeIndex

groupby(group[, squeeze, restore_coord_dims])

Returns a DatasetGroupBy object for performing grouped operations.

groupby_bins(group, bins[, right, labels, ...])

Returns a DatasetGroupBy object for performing grouped operations.

head([indexers])

Returns a new dataset with the first n values of each array for the specified dimension(s).

identical(other)

Like equals, but also checks all dataset attributes and the attributes on all variables and coordinates.

idxmax([dim, skipna, fill_value, keep_attrs])

Return the coordinate label of the maximum value along a dimension.

idxmin([dim, skipna, fill_value, keep_attrs])

Return the coordinate label of the minimum value along a dimension.

info([buf])

Concise summary of a Dataset variables and attributes.

integrate(coord[, datetime_unit])

Integrate along the given coordinate using the trapezoidal rule.

interp([coords, method, assume_sorted, ...])

Interpolate a Dataset onto new coordinates

interp_calendar(target[, dim])

Interpolates the Dataset to another calendar based on decimal year measure.

interp_like(other[, method, assume_sorted, ...])

Interpolate this object onto the coordinates of another object, filling the out of range values with NaN.

interpolate_na([dim, method, limit, ...])

Fill in NaNs by interpolating according to different methods.

isel([indexers, drop, missing_dims])

Returns a new dataset with each array indexed along the specified dimension(s).

isin(test_elements)

Tests each value in the array for whether it is in test elements.

isnull([keep_attrs])

Test each value in the array for whether it is a missing value.

items()

keys()

load(**kwargs)

Manually trigger loading and/or computation of this dataset's data from disk or a remote source into memory and return this dataset.

load_store([decoder])

Create a new dataset from the contents of a backends.*DataStore object

map(func[, keep_attrs, args])

Apply a function to each data variable in this dataset

map_blocks(func[, args, kwargs, template])

Apply a function to each block of this Dataset.

max([dim, skipna, keep_attrs])

Reduce this Dataset's data by applying max along some dimension(s).

mean([dim, skipna, keep_attrs])

Reduce this Dataset's data by applying mean along some dimension(s).

median([dim, skipna, keep_attrs])

Reduce this Dataset's data by applying median along some dimension(s).

merge(other[, overwrite_vars, compat, join, ...])

Merge the arrays of two datasets into a single dataset.

min([dim, skipna, keep_attrs])

Reduce this Dataset's data by applying min along some dimension(s).

notnull([keep_attrs])

Test each value in the array for whether it is not a missing value.

pad([pad_width, mode, stat_length, ...])

Pad this dataset along one or more dimensions.

persist(**kwargs)

Trigger computation, keeping data as dask arrays

pipe(func, *args, **kwargs)

Apply func(self, *args, **kwargs)

polyfit(dim, deg[, skipna, rcond, w, full, cov])

Least squares polynomial fit.

prod([dim, skipna, min_count, keep_attrs])

Reduce this Dataset's data by applying prod along some dimension(s).

quantile(q[, dim, method, numeric_only, ...])

Compute the qth quantile of the data along the specified dimension.

query([queries, parser, engine, missing_dims])

Return a new dataset with each array indexed along the specified dimension(s), where the indexers are given as strings containing Python expressions to be evaluated against the data variables in the dataset.

rank(dim, *[, pct, keep_attrs])

Ranks the data.

reduce(func[, dim, keep_attrs, keepdims, ...])

Reduce this dataset by applying func along some dimension(s).

reindex([indexers, method, tolerance, copy, ...])

Conform this object onto a new set of indexes, filling in missing values with fill_value.

reindex_like(other[, method, tolerance, ...])

Conform this object onto the indexes of another object, for indexes which the objects share.

rename([name_dict])

Returns a new object with renamed variables, coordinates and dimensions.

rename_dims([dims_dict])

Returns a new object with renamed dimensions only.

rename_vars([name_dict])

Returns a new object with renamed variables including coordinates

reorder_levels([dim_order])

Rearrange index levels using input order.

resample([indexer, skipna, closed, label, ...])

Returns a Resample object for performing resampling operations.

reset_coords([names, drop])

Given names of coordinates, reset them to become variables

reset_encoding()

reset_index(dims_or_levels, *[, drop])

Reset the specified index(es) or multi-index level(s).

roll([shifts, roll_coords])

Roll this dataset by an offset along one or more dimensions.

rolling([dim, min_periods, center])

Rolling window object for Datasets.

rolling_exp([window, window_type])

Exponentially-weighted moving window.

round(*args, **kwargs)

Round an array to the given number of decimals.

sel([indexers, method, tolerance, drop])

Returns a new dataset with each array indexed by tick labels along the specified dimension(s).

set_close(close)

Register the function that releases any resources linked to this object.

set_coords(names)

Given names of one or more variables, set them as coordinates

set_index([indexes, append])

Set Dataset (multi-)indexes using one or more existing coordinates or variables.

set_xindex(coord_names[, index_cls])

Set a new, Xarray-compatible index from one or more existing coordinate(s).

shift([shifts, fill_value])

Shift this dataset by an offset along one or more dimensions.

sortby(variables[, ascending])

Sort object by labels or values (along an axis).

squeeze([dim, drop, axis])

Return a new object with squeezed data.

stack([dimensions, create_index, index_cls])

Stack any number of existing dimensions into a single new dimension.

std([dim, skipna, ddof, keep_attrs])

Reduce this Dataset's data by applying std along some dimension(s).

sum([dim, skipna, min_count, keep_attrs])

Reduce this Dataset's data by applying sum along some dimension(s).

swap_dims([dims_dict])

Returns a new object with swapped dimensions.

tail([indexers])

Returns a new dataset with the last n values of each array for the specified dimension(s).

thin([indexers])

Returns a new dataset with each array indexed along every n-th value for the specified dimension(s)

to_array([dim, name])

Deprecated version of to_dataarray

to_dask_dataframe([dim_order, set_index])

Convert this dataset into a dask.dataframe.DataFrame.

to_dataarray([dim, name])

Convert this dataset into an xarray.DataArray

to_dataframe([dim_order])

Convert this dataset into a pandas.DataFrame.

to_dict([data, encoding])

Convert this dataset to a dictionary following xarray naming conventions.

to_netcdf([path, mode, format, group, ...])

Write dataset contents to a netCDF file.

to_pandas()

Convert this dataset into a pandas object without changing the number of dimensions.

to_stacked_array(new_dim, sample_dims[, ...])

Combine variables of differing dimensionality into a DataArray without broadcasting.

to_zarr([store, chunk_store, mode, ...])

Write dataset contents to a zarr group.

transpose(*dims[, missing_dims])

Return a new Dataset object with all array dimensions transposed.

unify_chunks()

Unify chunk size along all chunked dimensions of this Dataset.

unstack([dim, fill_value, sparse])

Unstack existing dimensions corresponding to MultiIndexes into multiple new dimensions.

update(other)

Update this dataset's variables with those from another dataset.

values()

var([dim, skipna, ddof, keep_attrs])

Reduce this Dataset's data by applying var along some dimension(s).

weighted(weights)

Weighted Dataset operations.

where(cond[, other, drop])

Filter elements from this object according to a condition.

Attributes

attrs

Dictionary of global attributes on this dataset

chunks

Mapping from dimension names to block lengths for this dataset's data, or None if the underlying data is not a dask array.

chunksizes

Mapping from dimension names to block lengths for this dataset's data, or None if the underlying data is not a dask array.

coords

Mapping of DataArray objects corresponding to coordinate variables.

data_vars

Dictionary of DataArray objects corresponding to data variables

dims

Mapping from dimension names to lengths.

dtypes

Mapping from data variable names to dtypes.

encoding

Dictionary of global encoding attributes on this dataset

grid

grids

imag

The imaginary part of each data variable.

indexes

Mapping of pandas.Index objects used for label based indexing.

loc

Attribute for location based indexing.

nbytes

Total bytes consumed by the data arrays of all variables in this dataset.

obj

plot

Enables use of xarray.plot functions as attributes on a Dataset.

real

The real part of each data variable.

sizes

Mapping from dimension names to lengths.

ugrid

UGRID Accessor.

ugrid_roles

Xarray Dataset "accessor" to retrieve the names of UGRID variables.

variables

Low level interface to Dataset contents as dict of Variable objects.

xindexes

Mapping of Index objects used for label based indexing.