xugrid.UgridDatasetAccessor.sel_points#

UgridDatasetAccessor.sel_points(x, y, out_of_bounds='warn', fill_value=nan)[source]#

Select points in the unstructured grid.

Out-of-bounds points are ignored. They may be identified via the index coordinate of the returned selection.

Parameters:
  • x (ndarray of floats with shape (n_points,))

  • y (ndarray of floats with shape (n_points,))

  • out_of_bounds (str, default "warn") –

    What to do when points are located outside of any feature:

    • raise: raise a ValueError.

    • ignore: return fill_value for the out of bounds points.

    • warn: give a warning and return NaN for the out of bounds points.

    • drop: drop the out of bounds points. They may be identified via the index coordinate of the returned selection.

  • fill_value (scalar, DataArray, Dataset, or callable, optional, default: np.nan) – Value to assign to out-of-bounds points if out_of_bounds is warn or ignore. Forwarded to xarray’s .where() method.

Returns:

points – The name of the topology is prefixed in the x, y coordinates.

Return type:

Union[xr.DataArray, xr.Dataset]