dtarb / TauDEM

Terrain Analysis Using Digital Elevation Models (TauDEM) software for hydrologic terrain analysis and channel network extraction.
http://hydrology.usu.edu/taudem
Other
228 stars 116 forks source link

DropAnalysis #259

Open EricOGoodwin opened 1 year ago

EricOGoodwin commented 1 year ago

Hi,

I'm using TauDEM from an R environment, calling the standalone .exes using the system() call. I've been following your example R script from https://[hydrology.usu.edu/taudem/taudem5/TauDEMRScript.txt](https://hydrology.usu.edu/taudem/taudem5/TauDEMRScript.txt) and it all works fine except for the dropAnalysis step. I also noticed that where you "plot streams using stream order as width", they were coming out all the same width, until I changed the field name (from "snet$dbf$dbf$Order" to "snet$dbf$dbf$strmOrder". I wonder if these two are linked - given that the dropAnalysis is based on stream order, is it possible that it's trying to refer to the same "Order" field rather than the new name "strmOrder"? I had a wee look around the source code, but C++ looks less and less like R code every time ;-) Cheers, Eric

dtarb commented 1 year ago

Eric, This R script is pretty old (from CSDMS workshop in 2011). I suspect that at some point between then and now we changed the name of the column that Streamnet outputs from just "Order" to "strmOrder", likely in an attempt to make it more explicit. I suggest looking at the shapefile *net.shp to see what its columns are and using those in the plotting. I'm not sure that looking at the C++ code will really help. It would confirm for you what you can likely see in the shapefile. The help information on this function https://hydrology.usu.edu/taudem/taudem5/help53/StreamReachAndWatershed.html does indicate strmOrder as one of the output columns. I hope this helps. Dave

EricOGoodwin commented 1 year ago

Thanks for your quick response Dave! Amazing that the script was that old, and still (mostly!) works fine. Good stuff. I think I switched from use of raster to terra, and it all just worked smoothly. Thanks yes, I'd figured out the correct column name as strmOrder, and had got that working correctly, but I havent had any luck getting the drop analysis running. I just wondered if there was a hardcoded reference to the old column name in the C++, but that seems unlikely.

Calling dropanalysis returns the generic help output. Pretty hard to figure out what's going wrong there!

I had been hoping to be able to invert my DEM to identify ridgelines, but after a bit of reading I understand now why that can't be done with these flow methods. ("Non-monotonic continuous downhill slope in conjugate topographic surface"!). Still, happy with where I've got to less than a day after installing the software! Thanks again for the functionality.

dtarb commented 1 year ago

Given that ridgelines are generally the divides between watersheds, once you get to a shapefile that has watershed boundaries (e.g. from WaterShedGridToShapefile) it is perhaps just a few GIS operations to hone in on the ridgelines you want. There is a dependency on ArcGIS here the way TauDEM is implemented. The tool StreamNet (Stream Reach And Watershed) outputs watersheds as a raster, and then ArcGIS is used (in WaterShedGridToShapefile) to convert these to polygons. There is likely an R equivalent if you look hard enough.

The syntax of DropAnalysis is pretty tricky and if you are getting the generic help output it means you are not giving it the input it wants. See https://hydrology.usu.edu/taudem/taudem5/help53/StreamDropAnalysis.html where I have what documentation there is on this. I’d be happy to look at your specific input syntax to help if needed.