I've seen a few threads referencing Python scripting for automating Arc Hydro processes, but I haven't seen much focused on the DEM Reconditioning step. I have seen this presentation (Automating Arc Hydro with Python by Philip Griffith on Prezi ), which is the only script example I've seen that attempts the reconditioning step; however, there's a great deal about Philip's script that I do not understand.
This is what I've tried:
import arcpy
import ArcHydroTools
#I did not try to set Target Locations as Philip did in his script. I set those through ApUtilities in the ArcMap window, in the hopes of simplifying my script. I also did not check out the Spatial Analyst license because it is already checked out to me.
raster_dem = "G:/Python/ScriptTests/ArcHydro/ArcHydroTestScripts.gdb/r36002225PAS"
geomorph_stream = "G:/Python/ScriptTests/ArcHydro/ArcHydroTestScripts.gdb/geomorph_36002225PAS"
output = "G:/Python/ScriptTests/ArcHydro/DEM_tiles/out"
ArcHydroTools.DEMReconditioning(raster_dem, geomorph_stream, "5", "10", "10", output)
When I use this script, it takes far too long to process and the Agree DEM produced is clearly not accurate.
Any suggestions? There are just so few examples online, I'm really struggling here.
Any recommendations for resources would be greatly appreciated.
Could this help you? Maybe you could test
arcpy.gp.DEMReconditioning_archydro
(tested with ArcGIS 10.5)
Same issue. Processing takes forever compared to manual Arc Hydro processing (as opposed to scripted automation), and the output is not what it should be.
We have just posted a document "Arc Hydro - Calling Arc Hydro Tools in Python" that presents the recommended approach to calling Arc Hydro functions in your Python script. Please review the doc and see if that helps. You would be importing "demreconditioning" and would be using "execute" method approach. The sequence of parameters is (in_dem_raster, in_stream_raster, num_cells_buff, zsmooth, zsharp, out_agree_dem, raise_negative). raise_negative should be False. I suggest that you first run it on the ArcMap/Pro Python command line. Then once you get it working, move it into your code.
Would you please link to the document? I'm having a little trouble finding it. Thanks!
Arc Hydro - Calling Arc Hydro Tools in Python.pdf
In Arc Hydro GeoNet under "Recent Content".
This looks great, thank you!