xdem icon indicating copy to clipboard operation
xdem copied to clipboard

xdem.terrain.profile_curvature takes ~100x longer than expected

Open adehecq opened this issue 1 year ago • 1 comments

import xdem
refdem = xdem.DEM(xdem.examples.get_path("longyearbyen_ref_dem"))
%time test = xdem.terrain._get_terrainattr_richdem(refdem, "profile_curvature")
%time test = xdem.terrain.profile_curvature(dem=refdem, use_richdem=True)
%time test = xdem.terrain.get_terrain_attribute(dem=refdem, attribute="profile_curvature", use_richdem=True)

The first option takes 67 ms while the second and third take 7.5 s ! But when running the commands a second time, they both speed-up by a factor 10. However, I did not see that effect with another larger DEM I tested.

adehecq avatar Sep 06 '22 14:09 adehecq

While looking at this issue, it would be great to add a silent argument to remove the outputs of richdem.

adehecq avatar Sep 06 '22 14:09 adehecq