pyflwdir.FlwdirRaster.subbasins_streamorder#

FlwdirRaster.subbasins_streamorder(strord: ndarray | None = None, mask: ndarray | None = None, min_sto: int = -2) → tuple[ndarray, ndarray][source]#

Return subbasins defined by stream-order changes and their outlet indices.

Subbasins are defined based on confluences where a lower order stream segment enters a higher order segment.

Parameters:
  • strord (2D array of uint8, optional) – Stream-order map. Calculated from the flow directions if omitted.

  • mask (2D array of bool, optional) – Mask restricting valid stream cells.

  • min_sto (int, optional) – Minimum stream order for subbasins. By default, uses two orders below the global maximum stream order.

Returns:

  • subbas (2D-array of int32) – Raster of unique IDs for subbasins meeting min_sto.

  • idxs_out (1D array of int) – Linear indices of subbasin outlet cells.