xugrid.Ugrid2d.rasterize#

Ugrid2d.rasterize(resolution: float, bounds: Tuple[float, float, float, float] | None = None) Tuple[ndarray, ndarray, ndarray][source]#

Rasterize unstructured grid by sampling.

x and y coordinates are generated from the bounds of the UGRID2D topology and the provided resolution.

Parameters:
  • resolution (float) – Spacing in x and y.

  • bounds (tuple of four floats, optional) – xmin, ymin, xmax, ymax

Returns:

  • x (1d array of floats with shape (ncol,))

  • y (1d array of floats with shape (nrow,))

  • face_index (1d array of integers with shape (nrow * ncol,))