Skip to content

Add coverage summary stats and --minimum-coverage-pct filter to validate - #50

Merged
mmacferrin merged 2 commits into
mainfrom
minimum-coverage-pct-filter
Jul 19, 2026
Merged

Add coverage summary stats and --minimum-coverage-pct filter to validate#50
mmacferrin merged 2 commits into
mainfrom
minimum-coverage-pct-filter

Conversation

@mmacferrin

Copy link
Copy Markdown
Collaborator

Summary

Adds coverage-aware reporting and filtering to ivert validate, plus a couple of small _summary_stats.txt improvements.

Coverage summary statistics

When -mc/--measure-coverage is used, _summary_stats.txt now includes a decile section reporting the RMSE of grid cells above each coverage threshold (from 100% of cells down to the best-covered 10%). This shows how ICESat-2 coverage — and thus sampling bias — affects reported DEM accuracy.

--minimum-coverage-pct / -mcp filter

New option on ivert validate that drops grid cells whose measured coverage is below a given percentage (0-100) from all outputs: the _results.h5 dataframe, _summary_stats.txt, error exports, and plots.

  • Requires -mc/--measure-coverage; using it without that flag raises a clear usage error.
  • Value is constrained to the 0-100 range.
  • Threaded through the single-DEM, multi-DEM (collection), and DEM-subdivision code paths. Because coverage is a per-cell property, per-subset filtering yields identical merged results.

_summary_stats.txt polish

  • Reduced excessive float precision to 2 decimal places (at least 2 significant digits for magnitudes below 0.10).
  • Reordered so the "Number of cells with bathymetry photons" and "Mean roughness" lines appear above the "== Decile ranges of errors" section.

Testing

  • All three edited modules compile; ruff check/format pass.
  • CLI verified: option appears in --help, the -mc-required guard fires, and out-of-range values are rejected.
  • Filtering verified end-to-end against a synthetic results dataframe (a ≥50% threshold retained exactly the expected cells).
  • No existing unit tests cover this path (the src/tests/ files are integration download scripts).

Summarize coverage/accuracy in _summary_stats.txt when -mc/--measure-coverage
is used: a decile section reporting RMSE for grid cells above each coverage
threshold, showing how coverage and sampling bias affect DEM accuracy.

Reduce excessive float precision in _summary_stats.txt to 2 decimal places
(at least 2 significant digits for magnitudes below 0.10).

Add --minimum-coverage-pct / -mcp to 'ivert validate' to drop grid cells
below a coverage threshold from all results, statistics, and plots. Requires
-mc/--measure-coverage; errors clearly if used without it.
…ciles

Move the "Number of cells with bathymetry photons" and "Mean roughness" lines
above the "== Decile ranges of errors" section in _summary_stats.txt.
@mmacferrin
mmacferrin merged commit b0fb678 into main Jul 19, 2026
3 checks passed
@mmacferrin
mmacferrin deleted the minimum-coverage-pct-filter branch July 19, 2026 06:37
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.

1 participant