Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silent richdem's messages in xdem.terrain? #373

Open
adehecq opened this issue May 3, 2023 · 2 comments
Open

Silent richdem's messages in xdem.terrain? #373

adehecq opened this issue May 3, 2023 · 2 comments
Labels
enhancement Feature improvement or request

Comments

@adehecq
Copy link
Member

adehecq commented May 3, 2023

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...

@adehecq adehecq added the enhancement Feature improvement or request label May 3, 2023
@adehecq
Copy link
Member Author

adehecq commented May 31, 2023

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) 

@adehecq
Copy link
Member Author

adehecq commented Dec 18, 2023

In case the previous solution does not work, here is another one from the richdem issues: r-barnes/richdem#57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature improvement or request
Projects
None yet
Development

No branches or pull requests

1 participant