ldeo-glaciology / REMAWaterRouting

Using REMA tiles to simulate water routing on Antarctic ice shelf surfaces
1 stars 0 forks source link

Possible reasons why python's drainagebasins are not identical to Matlab's TopoToolbox drainagebasin function #1

Open jjspergel opened 4 years ago

jjspergel commented 4 years ago

There are two reasons the drainage basins are different, as far as I can tell:

  1. A subset will create separations between drainage basins at the boundaries where the connecting nodes are outside the cropped image. This makes sense if you think about drawing a rectangle on a drainage map.

We can see this phenomenon by subsetting a DEM in Matlab: Zooming in on the area we subsetted, and the "original" drainage basin separations: DBsubset

Drainage Basins from a subsetted rectangle: DBfromcroppedDEM

This is a problem that can be avoided by not subsetting too much.

  1. Python's flow direction algorithm still does not connect drainage networks over long distances. Matlab's flow direction algorithm, even at very coarse resolutionm, produces stream networks that are long and continuous, while Python produces stream networks that are not continuous.

python_accumulationstreams

Because of this, python produces many more drainage basins than Matlab: Python: python_drainagebasins

Matlab: matlab_DB

jjspergel commented 4 years ago

Clear difference between current Python weighted distance transform and Matlab weighted distance transform:

Matlab: matlab_wdttesting

Python: python_wdttesting