pyflwdir icon indicating copy to clipboard operation
pyflwdir copied to clipboard

refactor IHU upscaling code for readability

Open DirkEilander opened this issue 4 years ago • 2 comments

  • streams array can be simplified, no need to save cell indices
  • lots of duplicate code between upscale_check and upscale_error methods
  • remove unused code
  • improve comments. consistent use of pixel vs cell in terminology.

DirkEilander avatar Sep 24 '21 20:09 DirkEilander

Hi Dirk Eliander,

Thanks for pyflwdir python library! I am Phd student at University of Bucharest, Romania. My plan is to use pyflwdir in my activity. I have tested for wateshed delineation and is great and usefull. I found the zenodo DOI for citing this library in my future research.

I didn't understand exactly how the delimitation of watersheds works in the pyflwdir library. Please, could you help me with an article to understand the methodology? I suspect that the algorithms are created by you at Deltares or are taken from somewhere else. If you have a little time, please answer me too. I am at your disposal for other details!

Best, Florin Bilbie

flor187 avatar Nov 03 '25 14:11 flor187

Hi @flor187

The delineation is based on a flow direction grid which basically defines a downstream direction for each grid cell. Hence the basin boundaries are fixed given this data.

Flow direction can be derived from DEMs, see this examle. Here we use the algorithm implemented by Wang & Liu (2006) as mentioned in the example.

Hope this helps.

PS. this question is a bit off topic here. Please reach with on-topic issues for bugs / new feature requests or the discussion forum for general questions.

DirkEilander avatar Nov 12 '25 13:11 DirkEilander