dtarb / TauDEM

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

Is there a "simple" way to set a minimum value for AreaD8 or AreaDinf? #226

Closed chamesoul closed 3 years ago

chamesoul commented 3 years ago

Hi, I'm using TauDEM on RStudio, with the system command. AreaD8 allows to sum all values from upslope pixels , values that can be taken from an optionnal weight grid. My grid represents the balance between infiltration and runoff and can sometimes take negative values. As much as it makes sens for the runoff from upslope pixels to be diminished when going through pixels with high infiltration rate, my issue is that after going through numerous "negative" pixels, the runoff value calculated by AreaD8 becomes negative too, and then adds up to the next downslope pixel runoff value. I'm wondering if there is a way to force the value of the flowaccumulation not to go under 0.
Thanks!

dtarb commented 3 years ago

@chamesoul take a look at the retention limited runoff function. This is new (ish) and only implemented in the command line set of functions, not in ArcGIS toolbox and there is no documentation. It is sketched out in https://github.com/dtarb/TauDEM/issues/124

It is implemented in RetlimFlow.cpp and I think that line 175 effectively does what you want.

I think that if you provide this function with weight grid the grid that has positive and negative values, and retention capacity grid 0, that you will get what you want.

It may also be that the retention limited concept addresses your problem in a way that you like better. Rather than inputting a weight that is runoff minus infiltration capacity, you could input these as separate quantities (runoff as the weight and infiltration capacity as the retention capacity) and have the program do the differencing and only pass the positive quantity downslope.

Sadly, I have had limited time to keep the documentation of TauDEM up to date and have not had time to roll this function into the main release (and it has been years now). I've had others ask about this fundtion and my temporary distribution is at https://hydrology.usu.edu/docs/RetLimFlow.zip. You could also compile from source if you want to tweak it.

This is implemented in Dinfinity flow model (not D8) .

chamesoul commented 3 years ago

Thank you for your fast answer, I'll try to advance with what you told me (I wanted to compare AreaD8 with AreaDInf in my study but I guess it's a no-go then), I'll come back here if any issue arises or close the topic if all's good

dtarb commented 3 years ago

You could take the D8 flow directions (1, 2, ..., 8) and map them onto Dinfinity angles (0, pi/4, pi/2, ...7pi/4) and use these in the Dinfinity function to get what D8 would have given.

chamesoul commented 3 years ago

Thank you so much for your help!