imod.util.to_ugrid2d#

imod.util.to_ugrid2d(data: Union[xarray.core.dataarray.DataArray, xarray.core.dataset.Dataset]) xarray.core.dataset.Dataset[source]#

Convert a structured DataArray or Dataset into its UGRID-2D quadrilateral equivalent.

See: https://ugrid-conventions.github.io/ugrid-conventions/#2d-flexible-mesh-mixed-triangles-quadrilaterals-etc-topology

Parameters

data (Union[xr.DataArray, xr.Dataset]) – Dataset or DataArray with last two dimensions (“y”, “x”). In case of a Dataset, the 2D topology is defined once and variables are added one by one. In case of a DataArray, a name is required; a name can be set with: da.name = "..."

Returns

ugrid2d_dataset – The equivalent data, in UGRID-2D quadrilateral form.

Return type

xr.Dataset