xugrid.Ugrid2d.from_structured#
- static Ugrid2d.from_structured(data: DataArray | Dataset, x: str | None = None, y: str | None = None, name: str = 'mesh2d', return_dims: bool = False)[source]#
Create a Ugrid2d topology from a structured topology axis-aligned rectilinear, rotated or (approximated) curvilinear topologies.
By default, this method looks for:
"x"
and"y"
dimensions."longitude"
and"latitude"
dimensions."axis"
attributes of “X” or “Y” on coordinates."standard_name"
attributes of “longitude”, “latitude”, “projection_x_coordinate”, or “project_y_coordinate” on coordinate variables.
Specify the x and y coordinate names explicitly otherwise.
- Parameters:
data (xr.DataArray or xr.Dataset)
x (str, optional) – Name of the 1D or 2D coordinate to use as the UGRID x-coordinate.
y (str, optional) – Name of the 1D or 2D coordinate to use as the UGRID y-coordinate.
return_dims (bool) – If True, returns a tuple containing the name of the y and x dimensions.
- Returns:
grid (Ugrid2d)
dims (tuple of str, optional) – Provided if
return_dims
is True.