asp-plot 3.6.1__tar.gz → 3.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. asp_plot-3.7.0/.github/workflows/run-tests.yml +38 -0
  2. {asp_plot-3.6.1 → asp_plot-3.7.0}/AGENTS.md +1 -0
  3. {asp_plot-3.6.1 → asp_plot-3.7.0}/ARCHITECTURE.md +17 -6
  4. {asp_plot-3.6.1 → asp_plot-3.7.0}/CHANGELOG.md +27 -0
  5. {asp_plot-3.6.1 → asp_plot-3.7.0}/PKG-INFO +1 -1
  6. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/altimetry.py +36 -0
  7. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/altimetry_plots.py +377 -36
  8. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/bundle_adjust.py +2 -3
  9. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/cli/asp_report.py +18 -2
  10. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/cli/dem_benchmark.py +77 -4
  11. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/cli/request_planetary_altimetry.py +4 -4
  12. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/dem_benchmark.py +505 -71
  13. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/icesat2_source.py +161 -16
  14. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/report_captions.py +57 -22
  15. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/report_pipeline.py +195 -208
  16. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/stereo.py +64 -24
  17. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/stereo_geometry.py +6 -9
  18. asp_plot-3.7.0/asp_plot/terrain.py +261 -0
  19. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/utils.py +193 -18
  20. {asp_plot-3.6.1 → asp_plot-3.7.0}/environment.yml +1 -1
  21. {asp_plot-3.6.1 → asp_plot-3.7.0}/pyproject.toml +1 -1
  22. asp_plot-3.6.1/.github/workflows/run-tests.yml +0 -39
  23. {asp_plot-3.6.1 → asp_plot-3.7.0}/.flake8 +0 -0
  24. {asp_plot-3.6.1 → asp_plot-3.7.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  25. {asp_plot-3.6.1 → asp_plot-3.7.0}/.github/ISSUE_TEMPLATE/problem-report.yml +0 -0
  26. {asp_plot-3.6.1 → asp_plot-3.7.0}/.github/workflows/claude-code-review.yml +0 -0
  27. {asp_plot-3.6.1 → asp_plot-3.7.0}/.github/workflows/claude.yml +0 -0
  28. {asp_plot-3.6.1 → asp_plot-3.7.0}/.github/workflows/release.yml +0 -0
  29. {asp_plot-3.6.1 → asp_plot-3.7.0}/.gitignore +0 -0
  30. {asp_plot-3.6.1 → asp_plot-3.7.0}/.pre-commit-config.yaml +0 -0
  31. {asp_plot-3.6.1 → asp_plot-3.7.0}/.readthedocs.yaml +0 -0
  32. {asp_plot-3.6.1 → asp_plot-3.7.0}/CLAUDE.md +0 -0
  33. {asp_plot-3.6.1 → asp_plot-3.7.0}/LICENSE +0 -0
  34. {asp_plot-3.6.1 → asp_plot-3.7.0}/README.md +0 -0
  35. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/__init__.py +0 -0
  36. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/alignment.py +0 -0
  37. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/altimetry_source.py +0 -0
  38. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/asp_log.py +0 -0
  39. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/bodies.py +0 -0
  40. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/cli/__init__.py +0 -0
  41. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/cli/bundle_adjust_cameras.py +0 -0
  42. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/cli/csm_camera_plot.py +0 -0
  43. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/cli/gallery.py +0 -0
  44. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/cli/stereo_geom.py +0 -0
  45. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/csm_analysis.py +0 -0
  46. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/csm_camera.py +0 -0
  47. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/csm_io.py +0 -0
  48. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/gallery.py +0 -0
  49. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/mapproject.py +0 -0
  50. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/planetary_source.py +0 -0
  51. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/processing_parameters.py +0 -0
  52. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/report.py +0 -0
  53. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/scenes.py +0 -0
  54. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/selections.py +0 -0
  55. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/sensors/__init__.py +0 -0
  56. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/sensors/aster.py +0 -0
  57. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/sensors/base.py +0 -0
  58. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/sensors/dimap.py +0 -0
  59. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/sensors/dimap_v1.py +0 -0
  60. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/sensors/rpc.py +0 -0
  61. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/sensors/worldview.py +0 -0
  62. {asp_plot-3.6.1 → asp_plot-3.7.0}/asp_plot/stereopair_metadata_parser.py +0 -0
  63. {asp_plot-3.6.1 → asp_plot-3.7.0}/conda-forge-recipe/meta.yaml +0 -0
@@ -0,0 +1,38 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Run tests
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ permissions:
13
+ contents: read
14
+ pull-requests: write
15
+
16
+ jobs:
17
+ build:
18
+
19
+ runs-on: ubuntu-latest
20
+
21
+ # Login shell so the conda env activated by setup-miniconda is on PATH
22
+ defaults:
23
+ run:
24
+ shell: bash -el {0}
25
+
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ # Install Miniforge rather than relying on a conda bundled with the
29
+ # runner image: ubuntu-26.04 ships none, so $CONDA is empty there.
30
+ - name: Set up conda environment
31
+ uses: conda-incubator/setup-miniconda@v3
32
+ with:
33
+ miniforge-version: latest
34
+ environment-file: environment.yml
35
+ activate-environment: asp_plot
36
+ conda-remove-defaults: "true"
37
+ - name: Test with pytest
38
+ run: pytest
@@ -112,6 +112,7 @@ what keeps the assets small.
112
112
  - **CSM camera *differences* deliberately diverge from ASP's `orbit_plot.py`** (#53): `csm_analysis.read_angles_common_frame()` puts both cameras in one satellite body frame estimated from the *original* ephemeris, instead of estimating a frame per camera from its own positions the way `csm_io.read_angles()` (the ASP mirror) does. A solver perturbs positions *and* resamples the ephemeris finer, and over the resulting ~140 m central-difference baseline a 2 m perturbation tilts a per-camera frame by ~0.8° — which is what made the example figure look full of outliers. Angle diffs are also wrapped to [-180, 180). Don't "re-sync" either back to `read_angles()`; `csm_io.py` stays a verbatim ASP mirror and is not where this belongs.
113
113
  - **Airbus DIMAP quaternions are scalar-first** (`Q0` = scalar); they are reordered to the scalar-last `q1..q4` layout the roll/pitch/yaw code expects in `PleiadesMetadata.getAtt_df()`. Don't "fix" the reorder.
114
114
  - **The altimetry outlier cut is a 30-NMAD gate plus 3σ; both values are deliberate.** A whole ICESat-2 pass can be cloud (over UCSD one pass was a marine-layer return 150–210 m above ground, 21 % of the sample), which defeats a plain mean ± 3σ cut by inflating σ; the gate removes it. Don't "simplify" the cut to median ± 3 NMAD: on the heavy-tailed residuals a DSM has against ICESat-2 in a city that removes a fifth of the real points and lowers every reported NMAD by a third (`_outlier_mask` in `altimetry_source.py`). If a benchmark or report shows an RMSE far above its NMAD, look for a cloud pass in the residual map before touching the DEM.
115
+ - **Docs pages and example notebooks do not send readers to GitHub issues or PRs.** Issues get closed, and their threads mix results with discussion, so state what the reader needs in the text itself. Issue references are fine where developers read them: code comments, docstrings, CHANGELOG entries, PR descriptions and commit messages. A link to the problem-report form is fine too.
115
116
  - **`asp_plot.sensors.rpc.read_rpc()` refuses any raster that carries a CRS**, on purpose: an RPC describes the raw image grid, and ASP's `mapproject` copies RPC metadata onto its outputs.
116
117
  - **SpaceNet CORE3D NITF scenes are JPEG2000, and the ASP 3.8.0-alpha build ships GDAL's JP2OpenJPEG driver as a plugin it never loads**: `gdalinfo` and rasterio both fail with *No JPEG2000 capable driver is available*. `GDAL_DRIVER_PATH=<ASP root>/lib` for one `gdal_translate` to GeoTIFF is enough; the older 3.7.0 build had the driver built in, which is why earlier UCSD runs never hit this. The conda-forge `asp-3.7.0` env on NAS ships it as a plugin too, under `$ASP_ROOT/lib/gdalplugins`.
117
118
  - **ASP multiview triangulation of mapprojected images needs `ISISROOT`** (observed with ASP 3.8.0-alpha, non-ISIS `-t pleiades` session): the joint triangulation aborts with an uncatchable `Isis::IException` (`$ISISROOT/IsisPreferences was not found`) that surfaces as a generic "Failed to run"/killed job. Workaround: `export ISISROOT=<ASP install root>` (the release bundles `IsisPreferences` there). Pair runs and raw-image multiview runs are unaffected; full write-up in a PR #155 comment.
@@ -20,6 +20,7 @@ The package is organized by functionality, with each module focused on a specifi
20
20
  - `transform` property returns `None` for non-georeferenced data (identity transform)
21
21
  - `get_epsg_code()`: Returns the EPSG code of the raster's CRS. Falls back to the horizontal (2D) component's EPSG via `pyproj` `CRS.to_2d()` when there is no exact match (compound / 3D-promoted CRSs like `"EPSG:32610+EPSG:4979"`, e.g. COP30 DEMs with ellipsoid heights asserted)
22
22
  - `get_utm_epsg_code()`: Estimates UTM EPSG code from raster center coordinates
23
+ - `paired_block_bootstrap()`: median/NMAD of several residual series on the same points, resampling whole blocks (beam tracks); shared by `DEMBenchmark` and `AltimetryPlotter.dh_by_slope()`
23
24
  - `get_gsd()`: Returns ground sample distance in meters
24
25
  - `get_bounds()`: Returns bounds using `self.ds.bounds` (rasterio), with optional lat/lon transform
25
26
  - `_mask_nodata()`: Private helper that handles both undeclared nodata (inferred from pixel data) and invalid values (inf/nan) — needed because rasterio's `masked=True` alone doesn't catch undeclared nodata in ASP outputs
@@ -27,6 +28,7 @@ The package is organized by functionality, with each module focused on a specifi
27
28
  - `Plotter`: Base class for all plotting classes with common matplotlib setup. The scaffold added in #129 centralizes the boilerplate that was copy-pasted across plot methods: `save(fig, save_dir, fig_fn, ...)` (the `tight_layout()` + conditional-save tail), `plot_missing(ax, message)` (the "required files are missing" placeholder), and `plot_array(..., copyright=True)` which draws the rights-holder overlay from `self.attribution` (a string like `"Vantor"` or `"Airbus DS"`, or None) so the check no longer threads through every call site
28
29
  - `ColorBar`: Handles colorbar creation and formatting. `get_norm(clim=...)` takes an explicit clim so callers (e.g. `plot_geodataframe`) keep clim local instead of mutating `self.cb.clim`
29
30
  - File utilities: `glob_file()` (with `quiet=` for lookups whose absence is an expected layout), `save_figure()`, `show_existing_figure()`
31
+ - `resolve_logged_path(path, directory)` (#223): resolves a path recorded in an ASP log. ASP logs record commands as typed, relative to a working directory the log does not name, so a relative path is tried as given (from the current working directory) and then joined to `--directory`. Used for the reference DEM in the bundle_adjust and stereo logs and for the camera tokens in `camera_files_from_stereo_run()`
30
32
  - Multi-view layout helpers (issue #160): `find_pair_directories()` finds the `<prefix>-pairN/` subdirectories an ASP multi-view run keeps its per-pair products in; `get_pair_images()` recovers a pair's left/right image names from its `N-stereo.default` config copy (the `N-info.txt` lists *all* images of the joint run, so it is deliberately not used); `describe_pair()` builds the `"Pair N: <left> ↔ <right>"` label used on per-pair figures
31
33
  - Coordinate utilities: `get_utm_epsg()` for determining UTM EPSG from lon/lat, `get_planetary_bounds()` for DEM bounds in planetocentric 0-360 lon/lat
32
34
  - Planetary body detection: `detect_planetary_body(dem_fn)` returns `"earth"`, `"moon"`, or `"mars"` by inspecting CRS WKT DATUM/ELLIPSOID fields
@@ -53,13 +55,13 @@ The package is organized by functionality, with each module focused on a specifi
53
55
  - `_add_processing_parameters_page()`: helper that renders the runtime summary table plus the bundle_adjust / stereo / point2dem / report commands on page 2 (moved from the trailing page as of v1.13.0). Also renders the reconstructed `mapproject` command(s) (from the optional `mapproject` list key; see `mapproject.py`) with a "reconstructed from output metadata" note.
54
56
  - `_fmt_sig()`: formats a number compactly — 2 decimals for |x| < 10, 1 decimal for 10 ≤ |x| < 100, 0 decimals above, "n/a" for non-finite. Used for alignment stats.
55
57
  - Title page displays: processing date, ASP version (from logs), asp_plot version (from package metadata)
56
- - Page order: title + DEM summary → Processing Parameters → diagnostic figures → (if the `pc_align` step ran) alignment report page + aligned-DEM figures.
58
+ - Page order: title + DEM summary → Processing Parameters → diagnostic figures → (if the `pc_align` step ran) alignment report page → altimetry figures, each drawn once (#236): with both DEMs when the alignment succeeded, otherwise unaligned.
57
59
  - `report.py` is fed declaratively by `report_pipeline.py`; it was **not** rewritten in #128.
58
60
 
59
61
  **`report_pipeline.py`** - Declarative report pipeline behind the `asp_report` CLI (issue #128)
60
62
  - `ReportConfig`: dataclass packing the ~18 CLI options into one Click-free object (field names/defaults mirror the options one-for-one, guarded by a test)
61
63
  - `run_report(config)`: importable/callable from notebooks and tests with no Click context; returns the written PDF path
62
- - A declarative section registry (`REPORT_SECTIONS`) of `ReportSpec`s replaces the old inline plot-and-append wall: each spec pairs an `enabled(ctx)` predicate with a `build(ctx)` function returning the sections to append. `--no-geometry` / `--no-altimetry` / `--no-pc-align` gating are predicates; figure numbering comes from a per-run counter on the shared `ReportContext`, so section order and numbering are data, not source-line position. The alignment "Page B/C/D" follow-ups are one spec emitting several sections
64
+ - A declarative section registry (`REPORT_SECTIONS`) of `ReportSpec`s replaces the old inline plot-and-append wall: each spec pairs an `enabled(ctx)` predicate with a `build(ctx)` function returning the sections to append. `--no-geometry` / `--no-altimetry` / `--no-pc-align` gating are predicates; figure numbering comes from a per-run counter on the shared `ReportContext`, so section order and numbering are data, not source-line position. The altimetry pages are one spec emitting several sections: `_build_altimetry_earth` / `_build_altimetry_planetary` run the alignment first and then draw each figure once, with `plot_aligned` set from the alignment status (#236)
63
65
  - Section builders: `_build_input_scenes`, `_build_stereo_geometry`, `_build_match_points`, `_build_bundle_adjust`, `_build_disparity`, `_build_dem_results`, `_build_detailed_hillshade`, `_build_altimetry` (→ `_build_altimetry_earth` / `_build_altimetry_planetary`)
64
66
  - `_numbered_sections()`: shared helper turning a plotter's saved-filename list into one `ReportSection` per figure (first gets the caption, continuations are titled "... (continued)") — used by the scenes/geometry/match/disparity builders, whose plotters save one figure per pair on multi-view runs (issue #160)
65
67
  - `_keep_figures()`: with `--figures-directory`, copies each section's PNG out of `tmp_asp_report_plots/` as `NN_<title-slug>.png` after `compile_report()` has numbered the sections, and before the plots directory is deleted. The title is in the name because figure numbers shift when a section is gated off
@@ -161,6 +163,7 @@ The package is organized by functionality, with each module focused on a specifi
161
163
  - Requests/processes ICESat-2 ATL06-SR via the SlideRule x-series API (`sliderule_api.run("atl03x")`) with lazy init (`_ensure_sliderule()` — connects only when ICESat-2 methods run). SlideRule logging silenced (`verbose=False`, WARNING, explicit filter on `sliderule.session`)
162
164
  - `request_atl06sr_multi_processing()` decomposed (#140) into a short request/cache/ingest loop over helpers: `_print_time_filter_summary`, `_build_level_parms`, `_load_cached_atl06sr`, `_params_match_cache`, `_request_atl06sr_level`, `_ingest_atl06sr`. Parquet cache saved to `self.alt.directory` (not CWD); the param comparison strips the `output` key (SlideRule injects a random temp path into `parms` during `run()`) and only the comparison is wrapped in `try/except` so SlideRule API errors propagate
163
165
  - **Granule limit**: the server rejects an `atl03x` request matching more than 300 granules. `_request_atl06sr_level()` lists them first (`_list_granules()`, one query, which raises `max_resources` because the server applies the same limit to listings) and, above `MAX_GRANULES_PER_REQUEST` (250, a margin because the client's count can differ from the server's), `_run_granule_batches()` sends them as `resources` batches and concatenates. Batching by granule rather than by date means no point is returned twice. The parquet records the overall `parms`, so `_params_match_cache()` still recognizes a repeat. If the listing fails, the request goes as one, as before.
166
+ - **Geolocation correction (#217)**: `geoloc_corr` (None or a name in `GEOLOC_CORRECTIONS`, currently `"conus"`) adds `{"geoloc_corr": {"correction": ...}}` to the shared request envelope in `_build_level_parms()`. With None the key is left out, so uncorrected requests and their caches are unchanged. The server drops photons on beams without a correction entry; `_describe_request()` names the correction in errors, and the no-points warning explains the drop
164
167
  - Server-side time filtering via `_resolve_time_range(...)`: default `"all"` = full mission (2018-10-14 → today UTC midnight); `"buffered"` cascades explicit `t0`/`t1` > `scene_date` ± `time_buffer_days` > XML metadata ± buffer > `"all"`. `t1` truncated to midnight UTC for stable caching
165
168
  - ESA WorldCover sampling: `sample_esa_worldcover()` / `_sample_worldcover_into_gdf()` read 10m values directly from public AWS S3 COGs (`esa-worldcover.s3.amazonaws.com/v200/2021/map/`) via `rasterio` vsicurl, batched per tile, persisted into the parquet cache (much faster than SlideRule's server-side `samples`). `_worldcover_tile_url(lat, lon)` maps a coord to the 3×3° tile URL (flat layout). Anonymous reads (unsigned AWS session) so SSO configs don't crash
166
169
  - `filter_outliers(n_sigma=3)`: drops dh beyond `n_sigma × std` from the mean (true std, not NMAD) after the 30-NMAD gross-outlier gate (`_outlier_mask`); called automatically by `atl06sr_to_dem_dh()`; pass `None` to skip. When an aligned DEM is set, `icesat_minus_aligned_dem` is blanked wherever `icesat_minus_dem` is NaN (same in `planetary_to_dem_dh()`): `pc_align`'s translation moves the DEM's holes, so a point that sampled NaN before alignment — and therefore passed the cut untested — must not enter the aligned residuals when it lands on data afterwards
@@ -177,10 +180,16 @@ The package is organized by functionality, with each module focused on a specifi
177
180
  - Module-level `gds_query_async()` + `GDS_BASE_URL` (`https://oderest.rsl.wustl.edu/livegds`), re-exported from `asp_plot.altimetry` so the CLI import is unchanged; constants `MARS_IAU_SPHERE_RADIUS` / `MOON_IAU_SPHERE_RADIUS` (sourced from `BODIES`). `LolaSource` / `MolaSource` / `PlanetarySource` are also re-exported from `asp_plot.altimetry`
178
181
 
179
182
  **`altimetry_plots.py`** - `AltimetryPlotter` (issue #130)
180
- - All figure rendering, operating on already-prepared dataframes. `histogram_by_landcover()`, `plot_atl06sr_dem_profile()` (2×2: stacked elevation + dh on the left, DEM hillshade map spanning both rows on the right), `plot_best_worst_segments()` (scoring `3·|median(dh)| + NMAD(dh)`, weighting bias 3× over dispersion; requires >75% DEM coverage per segment), `mapview_plot_planetary_to_dem()` / `histogram_planetary_to_dem()`, plus the over-long profile/segment methods decomposed into panel helpers (`_profile_elevation_panel`, `_profile_dh_panel`, `_draw_segment_panel`, `_plot_hillshade_map`, `_add_segment_spans`, `_build_landcover_stats_text`)
183
+ - All figure rendering, operating on already-prepared dataframes. `histogram_by_landcover()`, `plot_atl06sr_dem_profile()` (2×2: stacked elevation + dh on the left, DEM hillshade map spanning both rows on the right), `plot_best_worst_segments()` (scoring `3·|median(dh)| + NMAD(dh)`, weighting bias 3× over dispersion; requires >75% DEM coverage per segment), `mapview_plot_atl06sr_to_dem()` (with `plot_aligned`, `_mapview_before_after()`: before/after panels, each on its own symmetric color scale, since one shared scale would wash out the post-alignment residuals), `mapview_plot_planetary_to_dem()` / `histogram_planetary_to_dem()`, plus the over-long profile/segment methods decomposed into panel helpers (`_profile_elevation_panel`, `_profile_dh_panel`, `_draw_segment_panel`, `_plot_hillshade_map`, `_add_segment_spans`, `_build_landcover_stats_text`)
181
184
  - `plot_aligned=True` overlays pre/post-alignment data on shared color/bin scales; dh maps + histograms use symmetric ±|3σ min/max| clim centered on 0 (labeled `[±3σ]`); all data is still plotted and used for Median/NMAD stats. Module constant `WORLDCOVER_NAMES`; the shared `nmad` helper now lives in `utils.py`
185
+ - `dh_by_slope()` (issue #211): median (top panel; with `plot_aligned` the aligned series only, since an unaligned DEM is often offset by meters) and NMAD (bottom) of dh per slope class from the `slope_deg` column that `Icesat2Source.sample_slope(slope_dem=None, scale=SLOPE_SCALE_M)` adds (default source: the validated DEM); 95 % intervals on both from `utils.paired_block_bootstrap` over beam tracks (`ICESAT2_BLOCK_COLUMNS`) within each class; classes under `min_points` (default `terrain.SLOPE_MIN_POINTS` = 10) counted, not plotted; returns the per-class table. The report draws it once (`report_pipeline._slope_section`): with the aligned series after a successful alignment, else unaligned, after the land-cover histogram either way; slope DEM = `--slope-dem`, else the reference DEM if it exists, else the report DEM
182
186
  - Requires internet for data requests (SlideRule + AWS S3 WorldCover COGs)
183
187
 
188
+ **`terrain.py`** - Terrain attributes of a DEM at points (issue #211)
189
+ - `slope_at_points(dem_fn, points, scale=None)`: Horn's method as `gdaldem slope`, NaN at edge/nodata. With `scale`, a DEM whose pixels are at most half of it is first averaged over whole-pixel blocks (`_block_means`: GDAL average resampling during the read, blocks anchored to the raster's corner so a point's slope does not depend on the other points, partial far-edge blocks left out; only the block means are held in memory, but every pixel of the points' bounding box is read when the DEM has no overviews)
190
+ - `slope_pixel_size()` / `slope_source_label()`: the pixel size actually used and the axis label naming it ("Slope from cop30.tif (30 m)", "... (averaged to 30 m)")
191
+ - Constants `SLOPE_BINS` (0/5/10/20/30/90°), `SLOPE_SCALE_M` (30), `SLOPE_COLUMN` (`slope_deg`); `slope_bin_edges()` validates edges, `slope_bin_labels()` names classes. Used by `DEMBenchmark` and `Altimetry`
192
+
184
193
  **`alignment.py`** - `Alignment` class
185
194
  - Performs DEM alignment using ASP's `pc_align` tool
186
195
  - `pc_align_dem_to_atl06sr()`: ICESat-2 path, csv-format `1:lon 2:lat 3:height_above_datum`
@@ -221,6 +230,7 @@ The package is organized by functionality, with each module focused on a specifi
221
230
  - Scores *many* DEMs against *one* altimetry sample so scene combinations, processing flows (joint MVS vs. pairwise + `dem_mosaic`) and parameter sweeps are compared on the same points. Replaces the ad hoc loop in the Atlanta MVS notebook: one `Altimetry` per DEM (kept in `self.altimetry[label]` for follow-up per-DEM figures), the same parquet replayed via `load_atl06sr_from_parquet` (or `load_planetary_csv`), the report's WorldCover water filter (`filter_out`, a group name or a list such as `["water", "trees"]` for stable terrain; validated against `icesat2_source.WORLDCOVER_GROUPS`, CLI `--filter-out`, repeatable) and outlier cut (30-NMAD gate + 3σ)
222
231
  - `run()` → `stats_df`, one row per DEM, columns `STATS_COLUMNS`: coverage (`valid_pct` / `valid_area_km2`) inside a common AOI (default the **intersection** of all DEM extents in the first DEM's CRS, so differing crop windows compare fairly; falls back to own extents with a warning when footprints don't all overlap), IntersectionErr median/NMAD from the `point2dem` sibling raster (`intersection_error_path()`; NaN for mosaics), altimetry-minus-DEM n/median/NMAD/RMSE before and after a per-DEM `pc_align --compute-translation-only` (translation + N-E-D shifts from `Alignment.pc_align_report`), and optional DEM-minus-reference stats via `Raster.compute_difference`
223
232
  - **Shared point set and paired block bootstrap** (issue #199). Each DEM keeps different points (voids, per-DEM outlier cut), and scoring on them changes the ranking, so after the per-DEM loop `_shared_stats()` intersects the point ids every DEM kept (`shared_ids`) and rescores all of them there (`*_shared_*` columns; the figure and the sort use these, the per-DEM `dh_*` columns stay as secondary numbers). Points are identified across the per-DEM `Altimetry` objects by a positional `benchmark_point_id` column stamped right after the parquet/CSV load (`_tag_points` / `_tag_planetary_points`; the tables share a non-unique time index, and every DEM replays the same file through the same ingest so row order is identical). `paired_block_bootstrap()` then resamples whole blocks — ICESat-2 beam tracks `(rgt, cycle, spot)`, MOLA `ORBIT`; LOLA has no track id and falls back to points with a warning — and evaluates every DEM on the same replicate, giving `median_ci_*` / `nmad_ci_*` (95 %), `nmad_vs_best_ci_*` (paired difference to the lowest-NMAD DEM; includes 0 = not separable) and `p_best` at the ranked stage (`bootstrap["stage"]`: aligned when any DEM has it). Track blocks, not points, because ATL06-SR segments overlap (40 m posted at 20 m) and residuals cluster with terrain; paired differences, not overlapping per-DEM intervals, because DEMs on the same points share most of their sampling variation
233
+ - **Slope classes** (issue #211). `slope_dem` defaults to `"auto"`: `_reference_dem_for_slope()` reads the stereo logs beside each DEM with `reference_dem_from_logs()` (the `ProcessingParameters.from_stereo_log` / `resolve_logged_path` lookup `StereoFiles` uses) and takes the reference DEM when the logs found agree on one existing file; otherwise the `reference` label when one was given, else no breakdown, reason printed. A candidate's label or a path (e.g. COP30 or a lidar DTM) overrides it, `None` (`--slope-dem none`) turns it off. `_slope_stats()` samples slope once per shared point with `terrain.slope_at_points(scale=slope_scale)` (default `SLOPE_SCALE_M` = 30 m, `--slope-scale`; Horn's method, as `gdaldem slope`, from the 3×3 pixels around the point, no interpolation; one bounding-box read, or per-point 3×3 reads past `MAX_WINDOW_PIXELS` rather than a downsampled box; pixel sizes in degrees converted to meters from the CRS's ellipsoid; edge/nodata neighbourhoods → NaN) and bins it with `slope_bins` (default `SLOPE_BINS` = 0/5/10/20/30/90°, lower edge inclusive). One common slope source so a point lands in the same class for every DEM. `stats_by_slope_df` (`SLOPE_STATS_COLUMNS`: n points and blocks per class, shared-point median/NMAD before and after alignment, median and NMAD intervals from `paired_block_bootstrap` rerun within the class at the ranked stage; classes under `SLOPE_MIN_POINTS` = 10 counted with NaN statistics), written by `save_stats` as `<stem>_by_slope.csv`; `slope_plot()` draws median (top) and NMAD (bottom) per class, one line per DEM, thin classes marked "too few", class counts in the tick labels, the horizontal pc_align shift range in the subtitle (Δx · tan(slope) inflates steep classes)
224
234
  - Window reads (`_window_for_bounds` / `_read_window`) are downsampled past `MAX_WINDOW_PIXELS` so a 1 m 20k×20k DEM stays at ~16 M samples (valid fraction becomes a subsample estimate; area scales from it)
225
235
  - pc_align products and the translated DEM go under `<directory>/dem_benchmark/<label>/` (via `Alignment.apply_dem_translation(output_fn=...)`), never next to the candidate DEMs; an existing `*-transform.txt` there is reused (a re-run makes no pc_align call and works offline); a missing `pc_align` binary (`FileNotFoundError`) degrades to pre-alignment scoring with one warning
226
236
  - Figures: `summary_plot()` (rows = DEMs sorted best-first by post-alignment shared-point NMAD; panels coverage / dh median / dh NMAD as before→after dumbbells (IntersectionErr is table-only: across geometries it ranks opposite to accuracy, #199) with the bootstrap interval as an error bar on the ranked marker and printed in brackets, `best` / `≈ best` labels in the NMAD panel; the NMAD panel is anchored at zero and its markers coincide by construction for a translation-only alignment) and `histogram_plot()` (overlaid residual outlines on the shared points). `label_from_dem_path()` / `parse_dem_specs()` back the CLI's `LABEL=PATH` specs (an ASP `run-DEM.tif` is labelled by its folder)
@@ -235,7 +245,7 @@ All CLI tools are in `asp_plot/cli/` and use Click for argument parsing:
235
245
  - A **thin Click wrapper** (issue #128): parses the ~18 options into a `ReportConfig` and calls `report_pipeline.run_report(config)`. All orchestration lives in `report_pipeline.py` (see the module structure section); the CLI file itself is now just option definitions + the `ReportConfig` build
236
246
  - Accepts a directory for stereo outputs and a directory or ASP-style prefix for bundle_adjust outputs; trailing slashes are tolerated (issue #60)
237
247
  - Options for reference DEMs, ICESat-2 comparisons, basemaps
238
- - Report section order: Input Scenes → Stereo Geometry → Match Points → Bundle Adjust panels (Log/Linear Residuals, Map-Projected Residuals, Geodiff) → Disparity → DEM Results → Detailed Hillshade → Altimetry panels. Disparity follows Bundle Adjust (not Hillshade) and DEM Results precedes Hillshade, so the title page → inputs → per-step diagnostics → final DEM products narrative reads top-down.
248
+ - Report section order: Input Scenes → Stereo Geometry → Match Points → Bundle Adjust panels (Residuals on a linear scale, Map-Projected Residuals, Geodiff) → Disparity → DEM Results → Detailed Hillshade → Altimetry panels. Disparity follows Bundle Adjust (not Hillshade) and DEM Results precedes Hillshade, so the title page → inputs → per-step diagnostics → final DEM products narrative reads top-down.
239
249
  - Title-page `ReportMetadata` is populated here; `get_acquisition_dates()` is called with the main directory plus stereo/BA subdirs as `extra_dirs` so the Acquisition Date(s) row appears on both raw-input layouts (WV XMLs at top level) and layouts where XMLs live one level deep.
240
250
  - `--directory`: Root ASP processing directory (default: `./`)
241
251
  - `--stereo-directory`: Stereo output subdirectory (default: `stereo`)
@@ -244,10 +254,11 @@ All CLI tools are in `asp_plot/cli/` and use Click for argument parsing:
244
254
  - `--dem-gsd`: Custom DEM ground sample distance
245
255
  - `--map-crs`: Projection as `EPSG:XXXX` (default: auto-detect from DEM, fallback `EPSG:4326`)
246
256
  - `--reference-dem`: Reference DEM path (auto-detected from logs if not supplied)
257
+ - `--slope-dem`: DEM to take slope from for the ICESat-2 statistics by slope class (default: the reference DEM, else the report DEM; always at a 30 m scale)
247
258
  - `--no-basemap`: Skip the Esri WorldImagery basemaps added by default (which require internet)
248
259
  - `--no-altimetry`: Skip the altimetry comparisons plotted by default. Auto-detects planetary body from DEM CRS: Earth → ICESat-2 (requires internet), Moon → LOLA, Mars → MOLA. For planetary DEMs, requires `--altimetry-csv`.
249
260
  - `--altimetry-csv`: Path to a LOLA/MOLA CSV from the ODE GDS API. **Mars: must be the `*_pts_csv.csv` (not `*_topo_csv.csv`) — the loader requires the `PLANET_RAD` column to avoid the oblate-areoid offset.** Moon accepts either the `*_topo_simple_csv.csv` (results=u) or the `*_pts_csv.csv` (results=p). Obtained via the `request_planetary_altimetry` CLI tool.
250
- - `--no-pc-align`: Skips the `pc_align` step; by default (when altimetry is on) the report runs `pc_align` against the reference altimetry (ICESat-2 for Earth, MOLA for Mars, LOLA for Moon) after the existing altimetry plots and appends an alignment report. **Earth success path**: adds four pages (alignment report page, pre/post landcover histogram, aligned profile, aligned best/worst segments). **Planetary success path**: adds three pages (alignment report page, pre/post mapview, pre/post histogram). `insufficient_points` and `no_improvement` outcomes emit a single alignment report page on either branch. Skipped automatically when `--no-altimetry` is set.
261
+ - `--no-pc-align`: Skips the `pc_align` step; by default (when altimetry is on) the report runs `pc_align` against the reference altimetry (ICESat-2 for Earth, MOLA for Mars, LOLA for Moon) before the altimetry figures, and its alignment report page opens them. Each altimetry figure is then drawn once (#236): with both DEMs on success (Earth: map, landcover histogram, slope, profile, segments; planetary: map, histogram), otherwise unaligned. `insufficient_points` and `no_improvement` outcomes add only the alignment report page. Skipped automatically when `--no-altimetry` is set.
251
262
  - `--pc-align-min-points`: Fewest altimetry points on the DEM for the `pc_align` step to run (`ReportConfig.pc_align_min_points`); `None`, the default, keeps the alignment methods' own minimums (500 ICESat-2 points, 20 LOLA/MOLA points). Below the minimum the alignment page says the step was skipped.
252
263
  - `--no-geometry`: Skip the stereo geometry plots drawn by default (used for planetary missions)
253
264
  - `--subset-km`: Hillshade subset size in km (default: 1.0)
@@ -291,7 +302,7 @@ All CLI tools are in `asp_plot/cli/` and use Click for argument parsing:
291
302
 
292
303
  **`dem_benchmark.py`** - Multi-DEM altimetry benchmark tool (`dem_benchmark` command)
293
304
  - Wrapper for `DEMBenchmark`; positional `DEMS` as paths or `LABEL=PATH`
294
- - `--parquet` (Earth, the ATL06-SR cache) or `--altimetry-csv` (Moon/Mars); `--directory` (where `dem_benchmark/<label>/` products go), `--reference`, `--no-pc-align`, `--own-extent`, `--n-bootstrap` (0 skips), `--title`, `--output-directory/--output-filename`
305
+ - `--parquet` (Earth, the ATL06-SR cache) or `--altimetry-csv` (Moon/Mars); `--directory` (where `dem_benchmark/<label>/` products go), `--reference`, `--no-pc-align`, `--own-extent`, `--n-bootstrap` (0 skips), `--slope-dem` (default `auto`, the reference DEM in the stereo logs, else the `--reference` DEM; `none` for no breakdown) / `--slope-bins` / `--slope-scale` (default 30 m, 0 = native) (`<stem>_slope.png` and `<stem>_by_slope.csv`), `--title`, `--output-directory/--output-filename`
295
306
  - Writes the summary figure, a `_histogram.png` twin, and the stats table as `.csv` with the same stem, and prints the headline (shared-point) columns of the table
296
307
 
297
308
  ## Documentation Website
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.7.0] - 2026-11-19
11
+
12
+ In this release:
13
+
14
+ - `dem_benchmark` and `asp_report` break the altimetry-minus-DEM median and NMAD down by terrain slope class, with 95 % intervals.
15
+ - `asp_report --geoloc-corr conus` requests ICESat-2 points with SlideRule's draft geolocation correction; it is off by default.
16
+ - The report draws each altimetry figure once, with both DEMs when `pc_align` succeeds, and gains a before-and-after ICESat-2 map. The bundle adjustment residuals are shown once, on a linear scale. With bundle adjustment and a successful alignment, a report is four pages shorter.
17
+ - The planetary instructions name the `*_pts_csv.csv` file, which the Mars loader requires.
18
+ - `asp_report` finishes without the ICESat-2 pages when SlideRule is unavailable, finds relative paths in ASP logs written from another directory, and `StereoPlotter` works on a stereo directory without a DEM.
19
+
20
+ ### Added
21
+ - **`DEMBenchmark` breaks the shared-point median and NMAD down by slope class** ([#211](https://github.com/uw-cryo/asp_plot/issues/211)); on the command line, `dem_benchmark [--slope-dem auto|none|LABEL|PATH] [--slope-bins 0,5,10,20,30,90]`. On steep sites accuracy changes with slope, and the #207 full-scene work had to compute this outside the library. By default slope comes from the reference DEM of the stereo runs, read from the stereo logs beside the DEMs as `asp_report` does; when the logs name no reference DEM, disagree, or name a missing file, it comes from the `--reference` DEM if one is given, and otherwise the breakdown is skipped with the reason printed. `slope_dem` / `--slope-dem` names another DEM, either one of the candidates or a path such as a lidar DTM, and `None` / `none` turns the breakdown off. Slope is computed as `gdaldem slope` does (Horn's method) at a scale of about 30 m, one ICESat-2 segment (`slope_scale` / `--slope-scale`): a finer DEM is averaged over whole-pixel blocks first, since a 1 m DSM at its own resolution gives the slope of roofs and canopy edges. It is sampled once per point, so every candidate puts a point in the same class. `stats_by_slope_df` gives, for each DEM and class, the number of points and beam tracks, the median and NMAD before and after alignment, and 95 % intervals on both from the paired block bootstrap rerun within the class. A class with fewer than 10 points is counted but not scored. `save_stats` writes it as `<stem>_by_slope.csv`, and `slope_plot()` draws the median and the NMAD by class, one line per DEM. The median shows a bias that changes with slope, which one `pc_align` translation cannot remove: at Atlanta, after alignment, the 0–5° class median is +0.2 m for all four DEMs tested and the steeper classes are near 0. Steep classes are often thin, and a horizontal offset between DEM and altimetry, from ICESat-2 geolocation error or from the horizontal part of a `pc_align` translation, inflates their NMAD by about Δx · tan(slope); the docstring, the docs page and the figure's subtitle say so.
22
+ - **`asp_report` adds a page with the ICESat-2 median and NMAD by terrain slope class** ([#211](https://github.com/uw-cryo/asp_plot/issues/211)), next to the existing breakdown by land cover; in Python, `Altimetry.sample_slope()` and `Altimetry.dh_by_slope()`. Slope comes from `--slope-dem` if given, else the reference DEM, else the report's own DEM, in every case at a scale of about 30 m. Error bars are 95 % intervals from a bootstrap that resamples beam tracks within each class, and the tick labels give the points and tracks per class. The page is drawn once: before and after alignment when `pc_align` succeeds, otherwise for the unaligned DEM. The slope code is in the new `asp_plot/terrain.py`, and `paired_block_bootstrap` moved to `asp_plot/utils.py` (still importable from `asp_plot.dem_benchmark`).
23
+ - **`asp_report --geoloc-corr conus` requests ICESat-2 points with SlideRule's geolocation correction** ([#217](https://github.com/uw-cryo/asp_plot/issues/217)); in Python, `request_atl06sr_multi_processing(geoloc_corr="conus")`. SlideRule 5.7.0 added a correction for ATL03 photons: one north/east/up shift per granule and beam, from a table that covers the continental US and is labelled a draft. SlideRule applies it before the ATL06-SR fit, so the segments come out corrected. Photons on a beam with no entry in the table are dropped, which changes the set of points a DEM is compared against; outside the continental US no points come back. For that reason the correction is off by default. The setting is stored with the request in the parquet cache, so corrected and uncorrected points are cached separately, and parquets cached before this release still match an uncorrected request. It is also recorded in the request section of the figure-selections file.
24
+
25
+ ### Changed
26
+ - **`asp_report` draws each altimetry figure once** ([#236](https://github.com/uw-cryo/asp_plot/issues/236)). When `pc_align` succeeded, the ICESat-2 histogram, profile and agreement segments appeared twice, before the alignment page against the DEM and after it against both DEMs, and the LOLA/MOLA map and histogram did the same; the second page of each pair contained the first. The alignment now runs before the altimetry figures, and the alignment page opens them. When it succeeds, only the version with both DEMs is drawn, titled "(Aligned DEM)"; otherwise only the unaligned version. A report with a successful alignment is three pages shorter on Earth and two on the Moon or Mars. The aligned profile, which plots only the differences against the aligned DEM, now also gives the median and NMAD before alignment in its legend, since on a track the alignment can raise the NMAD (1.25 to 1.53 m on one UCSD track). The two-panel LOLA/MOLA map is now sized to the DEM's shape instead of a fixed 16 × 6 in strip that shrank a square DEM to thumbnails. The aligned captions are rewritten to stand on their own.
27
+ - **The ICESat-2 map shows the differences before and after alignment** ([#236](https://github.com/uw-cryo/asp_plot/issues/236)). The report had no map of the differences against the aligned DEM. When `pc_align` succeeds the map now has two panels, before (left) and after (right), as the LOLA/MOLA map already did, and each title gives its number of points, median and NMAD. Each panel has its own color scale symmetric about 0: before alignment a DEM is often offset by meters (7.6 m at UCSD), and one scale for both would wash out the differences left after it. In Python, `Altimetry.mapview_plot_atl06sr_to_dem(plot_aligned=True)` now draws both panels instead of the aligned differences alone.
28
+ - **The report shows the bundle adjustment residuals once, on a linear scale** ([#236](https://github.com/uw-cryo/asp_plot/issues/236)). It drew the same initial and final residual maps twice, on a logarithmic and on a linear color scale. The log-scale page is dropped; the remaining page, "Bundle Adjust Residuals", keeps a separate color scale for the initial and the final residuals.
29
+
30
+ ### Fixed
31
+ - **The planetary altimetry instructions name the `*_pts_csv.csv` file.** The `asp_report --altimetry-csv` help, the instructions `request_planetary_altimetry` prints, both docs pages, and the HiRISE example notebook said to pass the `*_topo_csv.csv` of an ODE download. For Mars that file is rejected with `MOLA CSV is missing the PLANET_RAD column`, since its heights are above the MOLA areoid rather than the spherical datum of ASP's Mars DEMs, a difference of up to about 10 km. Both LOLA and MOLA downloads include a `*_pts_csv.csv`, which the loaders accept, and the instructions now name it.
32
+ - **`asp_report` finishes when SlideRule is unavailable** ([#214](https://github.com/uw-cryo/asp_plot/issues/214)). When the server stayed busy after the client's retries, the client raised `TypeError: 'NoneType' object is not iterable` from its own response handling, and the report stopped without writing a PDF. Every SlideRule failure now raises `SlideRuleRequestError` (a `RuntimeError`), which names the request and says that it may succeed later: a failed connection check at startup, an exception from `run()`, or a `None` result. The report catches it, prints the cause, and writes a page in place of the ICESat-2 and alignment pages that gives the cause and how to retry. When the connection check fails, no request is sent, so the report does not wait through a second round of retries. A level already in the parquet cache no longer contacts SlideRule at all.
33
+ - **Relative paths in ASP logs are found when the ASP command ran outside `--directory`** ([#223](https://github.com/uw-cryo/asp_plot/issues/223)). ASP records each command as typed, so a relative path in its log is relative to the directory the command ran in. asp_plot joined these paths to `--directory`, so a run started from another directory gave doubled paths such as `../data/run/../data/run/ref/dem.tif`: the geodiff of the bundle adjustment residuals was skipped, the reference DEM from the stereo log got the same doubled path, and the stereo geometry page fell back to every XML file in `--directory` with the warning `Camera file ... not found; falling back to directory-based scene discovery`. A relative path is now tried as given, from the current working directory, before it is joined to `--directory`.
34
+ - **Two example notebooks pass `nbformat.validate`** ([#220](https://github.com/uw-cryo/asp_plot/issues/220), [#221](https://github.com/uw-cryo/asp_plot/issues/221)). `aster_with_bundle_adjust_and_jitter_correction.ipynb` (nbformat 4.2) and `worldview_spacenet_ucsd_stereo.ipynb` (4.4) had cell ids on some cells, but ids are only allowed from nbformat 4.5, so strict validators (`nbformat.validate`, `nbval`, some pre-commit hooks) rejected both files. Both are now 4.5 with an id on every cell; outputs are unchanged. A new test validates every notebook under `notebooks/`.
35
+ - **`StereoPlotter` works on a stereo directory without a DEM** ([#224](https://github.com/uw-cryo/asp_plot/issues/224)). `StereoFiles` raised `ValueError: DEM file not found in <directory>/stereo` when it found no DEM, so a run before `point2dem`, or one whose DEM is elsewhere, could not be plotted at all, although `plot_match_points()` and `plot_disparity()` do not read the DEM. `StereoFiles.dem_fn` is now None in that case, those two plots work, and the same error comes from the methods that read the DEM: `plot_dem_results()`, `plot_detailed_hillshade()`, and `get_diff_vs_reference()` when it has to compute the difference. `asp_report` still stops with this error, since most of its pages need the DEM.
36
+
10
37
  ## [3.6.1] - 2026-11-06
11
38
 
12
39
  In this release:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: asp_plot
3
- Version: 3.6.1
3
+ Version: 3.7.0
4
4
  Summary: Package for plotting outputs Ames Stereo Pipeline processing
5
5
  Project-URL: Homepage, https://github.com/uw-cryo/asp_plot
6
6
  Project-URL: Documentation, https://asp-plot.readthedocs.io
@@ -40,6 +40,7 @@ from asp_plot.planetary_source import ( # noqa: F401
40
40
  PlanetarySource,
41
41
  gds_query_async,
42
42
  )
43
+ from asp_plot.terrain import SLOPE_BINS, SLOPE_COLUMN, SLOPE_MIN_POINTS
43
44
  from asp_plot.utils import Raster, detect_planetary_body, glob_file
44
45
 
45
46
  logging.basicConfig(level=logging.WARNING)
@@ -235,6 +236,9 @@ class Altimetry:
235
236
  def filter_outliers(self, *args, **kwargs):
236
237
  return self.icesat2.filter_outliers(*args, **kwargs)
237
238
 
239
+ def sample_slope(self, *args, **kwargs):
240
+ return self.icesat2.sample_slope(*args, **kwargs)
241
+
238
242
  def predefined_temporal_filter_atl06sr(self, *args, **kwargs):
239
243
  return self.icesat2.predefined_temporal_filter_atl06sr(*args, **kwargs)
240
244
 
@@ -361,6 +365,38 @@ class Altimetry:
361
365
  fig_fn=fig_fn,
362
366
  )
363
367
 
368
+ def dh_by_slope(
369
+ self,
370
+ key="all",
371
+ bins=SLOPE_BINS,
372
+ min_points=SLOPE_MIN_POINTS,
373
+ n_bootstrap=1000,
374
+ seed=0,
375
+ title="ICESat-2 ATL06-SR vs DEM by slope",
376
+ plot_aligned=False,
377
+ save_dir=None,
378
+ fig_fn=None,
379
+ ):
380
+ atl06sr = self.icesat2.atl06sr_processing_levels_filtered[key]
381
+ if "icesat_minus_dem" not in atl06sr.columns:
382
+ self.atl06sr_to_dem_dh()
383
+ atl06sr = self.icesat2.atl06sr_processing_levels_filtered[key]
384
+ if SLOPE_COLUMN not in atl06sr.columns:
385
+ self.sample_slope()
386
+ atl06sr = self.icesat2.atl06sr_processing_levels_filtered[key]
387
+ return self.plotter.dh_by_slope(
388
+ atl06sr,
389
+ key=key,
390
+ bins=bins,
391
+ min_points=min_points,
392
+ n_bootstrap=n_bootstrap,
393
+ seed=seed,
394
+ title=title,
395
+ plot_aligned=plot_aligned,
396
+ save_dir=save_dir,
397
+ fig_fn=fig_fn,
398
+ )
399
+
364
400
  def plot_atl06sr_dem_profile(
365
401
  self,
366
402
  key="all",