When you give a DEM with NaNs to fillsinks, it will currently hang because the morphological reconstruction never converges, and the maximum iteration cutoff is handled incorrectly.
The MATLAB code handles NaNs by setting them to infinity in the marker image, doing the reconstruction, and then restoring them to NaNs after the reconstruction.
[x] Make sure the loop cutoff gets triggered, so that fillsinks doesn't run forever.
[ ] Handle NaNs the way the MATLAB library does it.
When you give a DEM with NaNs to
fillsinks
, it will currently hang because the morphological reconstruction never converges, and the maximum iteration cutoff is handled incorrectly.The MATLAB code handles NaNs by setting them to infinity in the marker image, doing the reconstruction, and then restoring them to NaNs after the reconstruction.
fillsinks
doesn't run forever.