[WIP] Enhancements CLI#948
Conversation
|
This PR is almost ready (question point 2 + its doc) :) Maybe another proposition for the point 2 (with all the dev simplification to do): Furthermore, the |
| │ │ └─ elev_with_mask_stats.csv (if mask_elev is given in input) | ||
| │ ├─ plots | ||
| │ │ ├─ elev_map.png | ||
| │ │ ├─ masked_elev_map.png (if mask_elev is given in input) |
There was a problem hiding this comment.
add [ ] for optional files
|
Thanks a lot @marinebcht! This is amazing (especially the direct CLI tests 😜) I can't review fully today, but my quick reaction on This is not specific to vertical CRS, but CRS in general, and there's two questions mixed in here: 1/ Do we provide support for edge cases where a user has a badly defined input, with potentially no CRS/VCRS written in the metadata, or not? Currently we don't, except for the VCRS. This is not an issue in Python, where the user can set it manually beforehand, but I can see how this could be limiting in the CLI. 2/ Do we allow users to reproject through xDEM for workflows on single-source data like I think the way forward could be simply: 1/ We always accept optional inputs In this context, we won't need |
|
Hello @rhugonnet :) Thank you for all of your comments ! Several questions/proposition :
|
|
@marinebcht Thanks! 🙂 Some quick answers:
|
|
@belletva @rhugonnet @adehecq Added:
|
|
|
||
| 1. Level 1 → aligned elevation only | ||
| 2. Level 2 → more detailed output | ||
| 1. Level 1 → save reports and stats and plots used in it |
There was a problem hiding this comment.
save reports (HTML and PDF formats) in parent directory, stats (CSV formats) in tables directory and plots (PNG formats) in plots directory
|
|
||
| :::{note} | ||
| For transforming between vertical CRS with ``from_vcrs``/``to_vcrs`` please refer to {ref}`vertical-ref`. | ||
| To set the vertical CRS with ``force_vcrs``, please refer to {ref}`vertical-ref`. |
There was a problem hiding this comment.
Maybe an additional note: "Overrides a vertical CRS that might exist in the metadata".
|
Hello, I took some time to understand the use of the param https://docs.google.com/spreadsheets/d/109xGCD0ILPQTy0bbZuMFch2qr7C-ZdZHpkOkSOmBe-8/edit?usp=sharing When To me, the main accuracy metric is really the difference between Corresponding PR: #767 |
belletva
left a comment
There was a problem hiding this comment.
For me this PR is OK. We need to open a new issue concerning the output_grid and sampling_grid.
|
Good for me too. On |
|
Hello @belletva Add the (visual) doc for the reprojection parameters in the topo workflow : |
|
Little note after f9c6d7c |



1. Inputs config in topo workflow
Resolves #854 (point 1)
Resolves #921
Now, we can run several Topo Workflows for several DEMs :
Corresponding tree of outputs for level 1:
If only one dem needed to be study, the input section can look like this :
And the outputs tables/plots(/raster) are now at the root directory (from outputs/path in the yml) as before.
2.A VCRS parameters simplification
Resolves #854 (point 2)
Currently, input elev have two parameters :

As VCRS becomes part of the CRS, the DEM can have already a VCRS. So, we can simplify to only one optional "force_vcrs" :
The possibility to offer this possibility for the CRS: CRS are mostly present and correct, unlike VCRS, which can be absent from the metadata or erroneous => NO add
2.B Attributes computaion in case of geographic CRS
For the topo workflow, as not projected elev can lead to wrong attributes outputs, we propose the following keys :
a. no reproject key, or
{reproject: None}, or{reproject: {crs: None}}=> reproject the elev to the corresponting CRS UTM (.get_metric_crs())b.
{reproject: {crs: None}}=> no reprojection => warningAs the CRS is a geographic CRS, the following surface fit attributes might be wrong. Please use a projected CRS or let it empty to reproject in default projected CRS.c. If we wan't to customize the projection :
- if CRS is projected => projection before atributes computation (and only!)
- CRS projected covering the area => OK
- Need to raises an error (GDAL EXCEPTION = > issues #955)
As the CRS is a geographic CRS and the "reproject/crs" either, the following surface fit attributes might be wrong.In two words :
{reproject: {crs: None}}{reproject: {crs: [CRS]}}If level > 1 and a reprojection is done, "elev_reprojected.tif" is saved in rasters
/!\ NEED TO USE THE NEW GEOUTIL WITH XARRAY AND VCRS IN CRS to complete validation #956
3. Add direct CLI tests (arguments + workflow) in test_cli.py
Resolves #864 (point 1)
4. Fixes other CLI problems/little change in it
In topo workflows:
extra_informationkey is not more neededfractal_roughnessattibutes was misscallfractal_dimensionResolve Fractal roughness error in topo workflow #949window_size> 5 and the other attributes contrary to window-needed-attributes, I added anotherwindow_size_fractalparameters in every function used to its computaion (especiallyget_terrain_attribute()*)In accuracy :
output_gridkey ( [WIP] Enhancements CLI #948 (comment))=> output_grid = reference_elev as default behaviour
=> new map aligned_dem - tba when level > 1
For both workflows :
create_htmlandgenerate_pdffunctions moved to [workflow] as we call it for each input in topo, same forcreation_output_dirfunction and_load_datatakes an input dict._validate_crscall for previousset_vcrsandto_vcrs, renamed_validate_vcrsforforce_vcrsand_validate_crsvalidatedCRS.from_user_input(value)(@ topo keyreproject/crs)(*) Added
test_attributes_default_callintest_terrain.pyto check if default parameters inget_terrain_attribute()and in[attribute]()are the same (and lead to same results for each terrain attributes).5. Documentation
6. Propositions for the now/future
[attributes]()(terrain.py/topo workflow)reproject/crsdoest not cover the input dem Catch error from GDAL and log it #955