xrspatial.hydro.flow_accumulation_mfd.flow_accumulation_mfd#

xrspatial.hydro.flow_accumulation_mfd.flow_accumulation_mfd(flow_dir_mfd: DataArray, name: str = 'flow_accumulation_mfd') DataArray[source]#

Compute flow accumulation from an MFD flow direction grid.

Takes the 3-D fractional output of flow_direction_mfd and accumulates upstream contributing area through all downslope paths simultaneously. Each cell starts with a value of 1 (itself) and passes fractions of its accumulated value to each downstream neighbor.

Parameters:
  • flow_dir_mfd (xarray.DataArray or xr.Dataset) – 3-D MFD flow direction array of shape (8, H, W) as returned by flow_direction_mfd. Values are flow fractions in [0, 1] that sum to 1.0 at each cell (0.0 at pits/flats, NaN at edges or nodata cells). 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_mfd') – 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 MFD fractions. NaN where the input has NaN.

Return type:

xarray.DataArray or xr.Dataset

References

Qin, C., Zhu, A.X., Pei, T., Li, B., Zhou, C., and Yang, L. (2007). An adaptive approach to selecting a flow-partition exponent for a multiple-flow-direction algorithm. International Journal of Geographical Information Science, 21(4), 443-458.

Quinn, P., Beven, K., Chevallier, P., and Planchon, O. (1991). The prediction of hillslope flow paths for distributed hydrological modelling using digital terrain models. Hydrological Processes, 5(1), 59-79.