pyflwdir.FlwdirRaster.upscale#

FlwdirRaster.upscale(scale_factor, method='ihu', uparea=None, **kwargs)[source]#

Upscale flow direction network to lower resolution. Available methods are Iterative hydrography upscaling method (IHU) [2], Effective Area Method (EAM) [3] and Double Maximum Method (DMM) [4].

Note: This method only works for D8 or LDD flow directon data.

Parameters:
  • scale_factor (int) – number gridcells in resulting upscaled gridcell

  • method ({'ihu', 'eam_plus', 'eam', 'dmm'}) – upscaling method, by default ‘ihu’

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

  • uparea – 2D raster with basin IDs, by default None. If provided it is used as an additional constrain to the IHU method to increase the upscaling speed.

Returns:

  • flw (FlwdirRaster) – upscaled Flow Direction Raster

  • idxs_out (2D array of int) – linear indices of subgrid outlets