[POC] Report
Context
Now that we've created a CLI with coregistration and terrain attribute calculation steps, we can begin generating a report. For this, we'll take inspiration from what's done in demcompare and the README of demcoreg.
Configuration
What the user chooses to save or display will be specified in the configuration. For the report, we will try to generate it without saving the data.
[outputs]
path = "path/to/file"
save_terrain_attributes = true
save_coreg_results = true
plot_terrain_attributes = false
Code
-
[ ] Add parameter validation.
-
[ ] In the
runfor saving results:if cfg["attributes"]["save_results"]: terrain_attr.save(attr + ".tif") -
[ ] For plotting, wait for the merge of the new coregistration features.
Report Creation
The report should include:
- [ ] The reference DEM.
- [ ] The DEM to be aligned.
- [ ] In case of coregistration:
- [ ] The elevation difference before/after.
- [ ] The first and last iteration of Nuth & Kaab.
- [ ] The terrain attributes requested by the user.
Code
We are using sphinx. This functions may help :
- generate_report : https://github.com/CNES/demcompare/blob/master/demcompare/report.py#L405
- fill_report https://github.com/CNES/demcompare/blob/master/demcompare/report.py#L340
estimation
3d
This ticket is a proposal and is open for discussion.
Looks all good to me!
For the format: I really like the demcompare report template done with Jinja2.
For the content of the report: Adding the plots you list sounds perfect. For the method-specific plot (like the slopetan/dh plot with aspect of Nuth and Kääb you mention), we should be able to fairly easily generalize the plots that a given Coreg method produces since #530 that stores consistently all binning/fitting parameters, and same iteration metadata.
This way, there would be a fixed plot template (single method to implemnt) for a 1D bin/fit (like NuthKaab), or a 2D bin/fit (like Deramp) and this across all classes.
On the statistics, I agree on having less default columns as we mentioned in the call.
Also, we could consider adding some metrics of spatial correlation before/after coregistration. Those metrics are usually the ones that improve the most after a coregistration/correction compared to just the spread (NMAD/STD), and the functions to derive these spatial correlation metrics already exist in xDEM.
This is a topic we recently discussed for the pc_align (coregistration) functionality of the Ames Stereo Pipeline: https://github.com/NeoGeographyToolkit/StereoPipeline/issues/423#issuecomment-1913128417. Not a priority of course, but something we can move towards :slightly_smiling_face:
Hi @rhugonnet, demcompare do not use Jinja2, but sphinx, it was a debate on demcompare so I tried Jinja2 but I can do it with sphinx, that's not a problem for me.
It's great that we can generalize the plots !
About the statisitics, I think we will discuss how to show them after having them implementing for the CLI. But i keep your remarks in mind.