xrspatial.hydro.stream_order_mfd.stream_order_mfd#
- xrspatial.hydro.stream_order_mfd.stream_order_mfd(fractions: DataArray, flow_accum: DataArray, threshold: float = 100, method: str = 'strahler', name: str = 'stream_order_mfd') DataArray[source]#
Compute stream order from MFD flow direction and accumulation grids.
- Parameters:
fractions (xarray.DataArray or xr.Dataset) – 3-D MFD flow direction array of shape
(8, H, W)as returned byflow_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.flow_accum (xarray.DataArray) – 2-D flow accumulation grid. Cells with
flow_accum >= thresholdare considered stream cells.threshold (float, default 100) – Minimum accumulation to classify a cell as part of the stream network.
method (str, default 'strahler') –
'strahler'for Strahler branching hierarchy or'shreve'for Shreve cumulative magnitude.name (str, default 'stream_order_mfd') – Name of output DataArray.
- Returns:
2-D float64 array of stream order values. Non-stream cells (accumulation below threshold) are NaN.
- Return type:
xarray.DataArray or xr.Dataset
References
Strahler, A.N. (1957). Quantitative analysis of watershed geomorphology. Transactions of the American Geophysical Union, 38(6), 913-920.
Shreve, R.L. (1966). Statistical law of stream numbers. Journal of Geology, 74(1), 17-37.