pyflwdir.FlwdirRaster.stream_order#
- FlwdirRaster.stream_order(type: Literal['strahler', 'classic'] = 'strahler', mask: ndarray | None = None) ndarray#
Return the Strahler (default) or classic stream-order map.
In the classic bottom-up order, the main stem has order 1. Each tributary receives an order one greater than the stream it joins.
In the Strahler top-down order, first-order streams are the most upstream tributaries, or headwater cells. When two streams of the same order merge, the downstream stream has an order one higher. When streams of different orders merge, the downstream stream takes the higher order.
- Parameters:
type ({"strahler", "classic"}) – Stream-order type, by default ‘strahler’.
mask (array-like of bool, optional) – Mask of stream cells to consider. Use a 1D array for Flwdir and an array matching the raster shape for FlwdirRaster. Can restrict the calculation to streams above an upstream-area threshold or within a (sub)basin.
- Returns:
Stream-order values for each cell, with the same shape as the flow-direction data.
- Return type:
array of int