amforte / Topographic-Analysis-Kit

Set of matlab based tools for topographic analysis, built on top of TopoToolbox.
GNU General Public License v3.0
42 stars 35 forks source link

KsnChiBatch: complete_only not working #18

Closed jessezondervan closed 4 years ago

jessezondervan commented 5 years ago

The Ksn map and chi maps that I generated using KsnChiBatch include incomplete catchments up to the edges of the DEM, even though complete_only should be on in default mode. Note that I used a minimum elevation of 1380 m.

[KSN_STREAM_GRID, ksn_ms , KSN_GRID , CHI_MAP, CHI_GRID]=KsnChiBatch (DEM,FD,A, S , 'all',...
    'ref_concavity', 0.44, 'ksn_method', 'trib', 'outlet_level_method', 'elevation',...
    'min_elevation', 1380,'output', true);
amforte commented 5 years ago

For debugging purposes, does complete_only set to true have the desired effect if no min elevation is set?

jessezondervan commented 5 years ago

Hi Adam , I have not tried this but I will when I next open Matlab again.

Best,

Jesse

amforte commented 5 years ago

Also, is this happening on the same DEM you were having issues with the interpolated ksn map? That seems to have a border of no data or equivalent. I would need to do more digging, but I think that complete networks will only test for rivers that drain from the physical edge of the rectangular domain, not necessarily the edge of the DEM if there is an arbitrary border of no data between the edge of the DEM and the edge of the image.

jessezondervan commented 5 years ago

That's right, it is the same DEM

amforte commented 5 years ago

This is going to take a while to sort out. The function should successfully remove edge effected streams if a minimum elevation is not specified whether the DEM even if the DEM is fringed by no data. However, when a minimum elevation is specified, a very different process is implemented that will not work with a DEM with fringing no data values. While not ideal, the quickest solution will be to provide a DEM that has data all the way to the edges. Fixing this will take a rewrite that I don't have time to complete at the moment, but will keep this open to remind me after I'm back from field work.