xrspatial.hydro.watershed_mfd.watershed_mfd#
- xrspatial.hydro.watershed_mfd.watershed_mfd(flow_dir_mfd: DataArray, pour_points: DataArray, name: str = 'watershed_mfd') DataArray[source]#
Label each cell with the pour point it drains to (MFD).
- Parameters:
flow_dir_mfd (xarray.DataArray or xr.Dataset) – 3D MFD flow direction array of shape (8, H, W).
pour_points (xarray.DataArray) – 2D raster where non-NaN cells are pour points.
name (str, default='watershed_mfd') – 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