[POC] dem_processing from demcompare
Context
The purpose of this ticket is to implement the dem_processing methods from demcompare into xdem. We propose following a similar approach as described in this ticket but this time by copying the dem_processing directory into xdem.
This directory includes the following calculations:
- The elevation difference between two DEMs
- The elevation difference according to the slope norm between two DEMs
- The angular difference between two DEMs
- The curvature of the reference DEM
- The curvature of the secondary DEM
Code
Once the directory is copied, the following changes need to be made:
- [ ] Replace DEM datasets with the
DEMclass fromxdem.- [ ] Pay attention to function parameters
- [ ] Update function signatures
- [ ] Adjust the methods for accessing attributes
- [ ] Replace the
create_demfunctions
Tests
Retrieve this file: https://github.com/CNES/demcompare/blob/master/tests/dem_processing/test_dem_processing_methods.py
and make the necessary modifications.
Documentation
Add a section to the xdem documentation inspired by demcompare: https://demcompare.readthedocs.io/en/latest/userguide/statistics/dem_processing.html
Estimation:
4 days
Sounds good for me!
Do you think these processing methods should be implemented similarly as other DEM class methods, like DEM.alti_diff(other_dem=*), DEM.alti_diff_norm(other_dem=*), DEM.angular_diff(other_dem=*), with a core method living in a different module?
This is what is currently done for terrain attributes like DEM.slope() which calls xdem.terrain.slope(). Our reasoning behind having these two options available was both structural (have an independent terrain module for organisation/testing) and to keep inputs flexible for users that might want to avoid relying on the DEM class yet still want to use these algorithms (as one can simply pass a NumPy array + transform/resolution value when calling xdem.terrain.slope()).
And, for the curvature, it seems like the existing DEM.curvature() could do the job!