xrspatial.hydro.watershed_dinf.watershed_dinf#

xrspatial.hydro.watershed_dinf.watershed_dinf(flow_dir_dinf: DataArray, pour_points: DataArray, name: str = 'watershed_dinf') DataArray[source]#

Label each cell with the pour point it drains to (D-inf).

Parameters:
  • flow_dir_dinf (xarray.DataArray or xr.Dataset) – 2D D-infinity flow direction grid.

  • pour_points (xarray.DataArray) – 2D raster where non-NaN cells are pour points.

  • name (str, default='watershed_dinf') – Name of output DataArray.

Returns:

2D float64 array where each cell = label of its pour point. NaN for nodata or unreachable cells.

Return type:

xarray.DataArray or xr.Dataset