xrspatial.hydro.flow_accumulation_dinf.flow_accumulation_dinf#
- xrspatial.hydro.flow_accumulation_dinf.flow_accumulation_dinf(flow_dir: DataArray, name: str = 'flow_accumulation') DataArray[source]#
Compute flow accumulation from a D-infinity flow direction grid.
Takes a continuous-angle flow direction grid (as produced by
flow_direction_dinf) and accumulates upstream contributing area. Flow is split proportionally between two neighbors following Tarboton (1997).- Parameters:
flow_dir (xarray.DataArray or xr.Dataset) – 2-D D-infinity flow direction grid. Values are continuous angles in radians
[0, 2*pi), with-1.0for pits and NaN for nodata (as produced byflow_direction_dinf). Supported backends: NumPy, CuPy, NumPy-backed Dask, CuPy-backed Dask. If a Dataset is passed, the operation is applied to each data variable independently.name (str, default='flow_accumulation') – Name of output DataArray.
- Returns:
2-D float64 array of flow accumulation values. Each cell holds the total upstream contributing area (including itself) that drains through it, weighted by D-inf proportional splitting. NaN where the input has NaN.
- Return type:
xarray.DataArray or xr.Dataset
References
Tarboton, D.G. (1997). A new method for the determination of flow directions and upslope areas in grid digital elevation models. Water Resources Research, 33(2), 309-319.