Skip to content

CLI improvement#906

Merged
belletva merged 37 commits into
GlacioHack:mainfrom
marinebcht:cli_improvement_intersection
Mar 5, 2026
Merged

CLI improvement#906
belletva merged 37 commits into
GlacioHack:mainfrom
marinebcht:cli_improvement_intersection

Conversation

@marinebcht
Copy link
Copy Markdown
Contributor

@marinebcht marinebcht commented Feb 4, 2026

Resolves #841 #922

ACCURACY

Default method in the doc vs method in the accuracy_config.yaml

Changed NuthKaab to LZD

Preprocessed datasat presentation

Save the projected/cropped DEM after data preparation if activated :

  • preprocessed_reference_elev_map.png if sampling_grid = to_be_aligned_elev
  • preprocessed_to_be_aligned_elev_map.png if sampling_grid = reference_elev

Show them in the report, in the section after inputs metadata information.

image

Turned statistics table

Before in HTML and PDF: image

After in HTML and PDF:
image

Elevation difference plot with the same scale

image

Mask management

Masked data were not plot and correctely handle

image image
  • in the stats now:
image

TOPO

Remove empty terrain attributes case : before/After

image image

BOTH

Dynamic unit

(m) is now taken from the CRS info (here: metre)

Same font size for each plot

Stats :

Format data in the stats :

  • if "count": int
  • if "percentage": '{:.2f}'.format(val) + "%"
  • if abs(val) > 10E4 or abs(val) < 10E-4: np.format_float_scientific(val, precision=3)
  • else '{:.3f}'.format(val)
  • Remove std/standarddeviation duplicate in each template and alias std gives "Standart deviation" too

See before for accuracy and topo :

image

Reduce default stats

image

@marinebcht marinebcht force-pushed the cli_improvement_intersection branch from ebb5513 to 9c6a49e Compare February 6, 2026 21:20
@marinebcht
Copy link
Copy Markdown
Contributor Author

@rhugonnet I see two additonnials places we could use the method you will choose for the Limit the number of decimal places when displaying floats with NumPy issue in your PR #759 :)

  • when we print the statistics in the accuracy especially and topo workflow

ex: would be more readable
image

  • when we print the stats in the difference elevation plot here and here

ex: here median after = 0.00064086914, maybe we can plot 0.00064 (display.precision 3) or with scientific format... or let it like this
image

@marinebcht marinebcht changed the title [WIP] CLI improvement CLI improvement Feb 12, 2026
@marinebcht marinebcht force-pushed the cli_improvement_intersection branch from c7c4783 to 9e3d9cc Compare February 13, 2026 13:02
@marinebcht marinebcht closed this Feb 16, 2026
@marinebcht marinebcht reopened this Feb 16, 2026
@marinebcht marinebcht marked this pull request as ready for review February 16, 2026 08:49
Comment thread xdem/workflows/accuracy.py
@marinebcht
Copy link
Copy Markdown
Contributor Author

@rhugonnet @belletva @adebardo ready for review :)

Comment thread doc/source/_workflows/accuracy_config.yaml Outdated
Comment thread doc/source/cli.md Outdated
Comment thread xdem/workflows/accuracy.py Outdated
@marinebcht
Copy link
Copy Markdown
Contributor Author

News !

  • added the missing section
image
  • change the generate_plot and others plot to have always the same font size (6) and choose to have all dem = 50% page for the visibility
  • reference_elev + to_be_aligned_elev (identical) documentation in the same tab
image

@rhugonnet
Copy link
Copy Markdown
Member

Great @marinebcht! 😄

For the mask, two remarks:
1/ As it is ultimately a boolean raster (but can be provided as a vector that gets rasterize inside or outside polygons), plotting the vector is ambiguous (are we masking inside or outside polygons?).
To remedy this, we could plot either the actual raster mask (0 where terrain is masked, 1 where it is not), or the DEM with gaps (NaNs) where the mask is equal to 1. Or we could keep the vector (when it is one), and print one the figure (masked = "inside" or "outside" geometries).
2/ A mask always refers only to the "reference" raster for coregistration (the other being misaligned, the masked terrain will not cover the same areas). This is something we should clarify also in the documentation/Coreg function descriptions, as I think it is implicit right now...

@rhugonnet
Copy link
Copy Markdown
Member

@marinebcht For displaying the masks: Perfect! It's a shame that the "terrain" colormap has white in it, because we can confuse nodata or the edge of the colormap. We could maybe cut the colorbar, or choose another one...
What do you think?

@marinebcht
Copy link
Copy Markdown
Contributor Author

marinebcht commented Feb 27, 2026

@rhugonnet @adehecq
Here another prop of cmap : gist_earth
image

version with mask = black

image image

What do you think ?

@rhugonnet
Copy link
Copy Markdown
Member

rhugonnet commented Feb 27, 2026

As you prefer, both work well I think! 🙂
(gist_earth + white, or terrain + black)

@belletva
Copy link
Copy Markdown
Contributor

belletva commented Mar 2, 2026

As you prefer, both work well I think! 🙂 (gist_earth + white, or terrain + black)

terrain + black :)

@marinebcht
Copy link
Copy Markdown
Contributor Author

@rhugonnet @adehecq @belletva ready for the reviews :)

@rhugonnet
Copy link
Copy Markdown
Member

Perfect, thanks! 😄

I don't have much to re-review.
My only two comments:

  • It would be nice to get a RTD link (following the Wiki) to see the new doc rendered, easier to read + get a sense of the changes + potentially help spot typos/issues.
  • Should we define default statistics? The full list is a bit long, we already discussed this... Maybe simply Min/Max/Mean/Median/STD/NMAD and Valid/Total/Percent counts is already plenty.

@adehecq
Copy link
Copy Markdown
Member

adehecq commented Mar 4, 2026

As you prefer, both work well I think! 🙂 (gist_earth + white, or terrain + black)

I'm happy with both, although I find terrain a little bit flashy 😉
Otherwise, happy with the current reports (once the rounding of statistics is fixed).

Copy link
Copy Markdown
Contributor

@belletva belletva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me!

@belletva belletva merged commit 2f85db9 into GlacioHack:main Mar 5, 2026
39 of 54 checks passed
@marinebcht marinebcht mentioned this pull request Apr 9, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI : plot intersection

4 participants