xdem
xdem copied to clipboard
Silent richdem's messages in xdem.terrain?
When calculating terrain attributes with richdem, the function prints the reference to Horn et al each time. Is there a way to silent it? I don't think it's straightforward as from what I remember it's a print statement from the C code underneath...
Actually, here's a solution that I implemented in some personal code, using a piece of @rhugonnet's code here and then:
with stdout_redirected(), merged_stderr_stdout():
slope, maxc = xdem.terrain.get_terrain_attribute(dem=refdem_proj, attribute=["slope", "maximum_curvature"], use_richdem=True)
In case the previous solution does not work, here is another one from the richdem issues: https://github.com/r-barnes/richdem/issues/57