xugrid.Ugrid2d.from_structured#

static Ugrid2d.from_structured(data: DataArray | Dataset, x: str | None = None, y: str | None = None) Ugrid2d[source]#

Create a Ugrid2d topology from an axis-aligned rectilinear structured topology.

This method assumes the coordinates are 1D.

Use from_structured_multicoord for 2D x and y coordinates, e.g. for (approximated) curvilinear and rotated structured topologies.

Parameters:
  • data (xr.DataArray or xr.Dataset) –

  • x (str, optional) – Name of the 1D coordinate to use as the UGRID x-coordinate.

  • y (str, optional) – Name of the 1D coordinate to use as the UGRID y-coordinate.

Returns:

grid

Return type:

Ugrid2d