pyflwdir.FlwdirRaster.subbasins_area#

FlwdirRaster.subbasins_area(area_min, uparea=None)[source]#

Returns map with basin IDs, with a minimal area of area_min. Moving upstream from the basin outlets a new subbasin starts at tributaries with a contributing area larger than area_min and new interbasins when its area exceeds the area_min.

Parameters:
  • area_min (float) – subbasin area theshold; same unit as uparea, by default km2.

  • uparea (2D array of float, optional) – 2D raster with upstream area, by default None; calculated on the fly.

Returns:

  • subbas (2D array of int32) – subbasin map with pfafstetter coding

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