pyflwdir.FlwdirRaster.subbasins_streamorder#

FlwdirRaster.subbasins_streamorder(strord=None, mask=None, min_sto=-2)[source]#

Returns a subbasin map with unique IDs and its outlet linear indices. Subbasins are defined based on a minimum stream order.

Parameters:
  • strord (1D-array of uint8) – stream order

  • mask (2D array of bool) – Mask of valid cells.

  • min_sto (int, optional) – minimum stream order of subbasins, by default the stream order is set to two under the global maximum stream order.

Returns:

  • subbas (2D-array of int32) – map with unique IDs for stream_order>=min_sto subbasins

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