asp-plot 3.1.0__tar.gz → 3.2.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 (60) hide show
  1. {asp_plot-3.1.0 → asp_plot-3.2.0}/ARCHITECTURE.md +10 -1
  2. {asp_plot-3.1.0 → asp_plot-3.2.0}/CHANGELOG.md +7 -0
  3. {asp_plot-3.1.0 → asp_plot-3.2.0}/PKG-INFO +2 -2
  4. {asp_plot-3.1.0 → asp_plot-3.2.0}/README.md +1 -1
  5. asp_plot-3.2.0/asp_plot/bundle_adjust.py +1716 -0
  6. asp_plot-3.2.0/asp_plot/cli/bundle_adjust_cameras.py +93 -0
  7. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/report_captions.py +19 -0
  8. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/report_pipeline.py +47 -1
  9. {asp_plot-3.1.0 → asp_plot-3.2.0}/conda-forge-recipe/meta.yaml +2 -0
  10. {asp_plot-3.1.0 → asp_plot-3.2.0}/pyproject.toml +2 -1
  11. asp_plot-3.1.0/asp_plot/bundle_adjust.py +0 -643
  12. {asp_plot-3.1.0 → asp_plot-3.2.0}/.flake8 +0 -0
  13. {asp_plot-3.1.0 → asp_plot-3.2.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  14. {asp_plot-3.1.0 → asp_plot-3.2.0}/.github/ISSUE_TEMPLATE/problem-report.yml +0 -0
  15. {asp_plot-3.1.0 → asp_plot-3.2.0}/.github/workflows/claude-code-review.yml +0 -0
  16. {asp_plot-3.1.0 → asp_plot-3.2.0}/.github/workflows/claude.yml +0 -0
  17. {asp_plot-3.1.0 → asp_plot-3.2.0}/.github/workflows/release.yml +0 -0
  18. {asp_plot-3.1.0 → asp_plot-3.2.0}/.github/workflows/run-tests.yml +0 -0
  19. {asp_plot-3.1.0 → asp_plot-3.2.0}/.gitignore +0 -0
  20. {asp_plot-3.1.0 → asp_plot-3.2.0}/.pre-commit-config.yaml +0 -0
  21. {asp_plot-3.1.0 → asp_plot-3.2.0}/.readthedocs.yaml +0 -0
  22. {asp_plot-3.1.0 → asp_plot-3.2.0}/AGENTS.md +0 -0
  23. {asp_plot-3.1.0 → asp_plot-3.2.0}/CLAUDE.md +0 -0
  24. {asp_plot-3.1.0 → asp_plot-3.2.0}/LICENSE +0 -0
  25. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/__init__.py +0 -0
  26. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/alignment.py +0 -0
  27. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/altimetry.py +0 -0
  28. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/altimetry_plots.py +0 -0
  29. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/altimetry_source.py +0 -0
  30. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/asp_log.py +0 -0
  31. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/bodies.py +0 -0
  32. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/cli/__init__.py +0 -0
  33. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/cli/asp_report.py +0 -0
  34. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/cli/csm_camera_plot.py +0 -0
  35. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/cli/gallery.py +0 -0
  36. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/cli/request_planetary_altimetry.py +0 -0
  37. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/cli/stereo_geom.py +0 -0
  38. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/csm_analysis.py +0 -0
  39. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/csm_camera.py +0 -0
  40. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/csm_io.py +0 -0
  41. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/gallery.py +0 -0
  42. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/icesat2_source.py +0 -0
  43. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/mapproject.py +0 -0
  44. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/planetary_source.py +0 -0
  45. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/processing_parameters.py +0 -0
  46. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/report.py +0 -0
  47. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/scenes.py +0 -0
  48. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/selections.py +0 -0
  49. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/sensors/__init__.py +0 -0
  50. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/sensors/aster.py +0 -0
  51. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/sensors/base.py +0 -0
  52. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/sensors/dimap.py +0 -0
  53. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/sensors/dimap_v1.py +0 -0
  54. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/sensors/rpc.py +0 -0
  55. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/sensors/worldview.py +0 -0
  56. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/stereo.py +0 -0
  57. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/stereo_geometry.py +0 -0
  58. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/stereopair_metadata_parser.py +0 -0
  59. {asp_plot-3.1.0 → asp_plot-3.2.0}/asp_plot/utils.py +0 -0
  60. {asp_plot-3.1.0 → asp_plot-3.2.0}/environment.yml +0 -0
@@ -115,13 +115,16 @@ The package is organized by functionality, with each module focused on a specifi
115
115
  - `plot_detailed_hillshade()` auto-selects three subset clips from intersection-error variance (low/medium/high) via `_auto_hillshade_clip_offsets()`. Accepts `clip_windows` (DEM-CRS bboxes) + `clip_windows_crs` to pin/replay clips for run-to-run comparison (issue #121); records the boxes it drew on `self.detailed_hillshade_clips`. Out-of-bounds pinned boxes warn and fall back to auto.
116
116
  - Key methods: `plot_dem_results()`, `plot_disparity()`, `plot_match_points()`, `plot_detailed_hillshade()`
117
117
 
118
- **`bundle_adjust.py`** - Two main classes
118
+ **`bundle_adjust.py`** - Four main classes
119
119
  - `ReadBundleAdjustFiles`: Reads bundle adjustment CSV outputs (residual pointmaps)
120
120
  - `get_initial_final_residuals_gdfs()`: Returns initial and final residual GeoDataFrames
121
121
  - `get_initial_final_geodiff_gdfs()`: Returns geodiff comparison GeoDataFrames (requires `--mapproj-dem` flag in bundle_adjust)
122
122
  - `get_mapproj_residuals_gdf()`: Returns map-projected residual GeoDataFrame
123
123
  - `PlotBundleAdjustFiles` (inherits from `Plotter`): Visualizes bundle adjustment residuals before/after optimization
124
124
  - Plots include map views of residuals, histograms, and geodiff comparisons
125
+ - **Camera before/after position and orientation (issues #95, #43)** — shows where each camera *moved* in the solve, not just the ground residuals. Unlike `csm_camera.py` (which needs the user to pass original + optimized cameras), this is **self-contained on a bundle_adjust output folder**: the pre-BA cameras are not co-located there, and ASP writes no "unadjusted" state (see the AGENTS.md gotcha).
126
+ - `ReadBundleAdjustCameras`: discovery is driven by the `*.adjust` files (rigid ECEF translation `T` + rotation quaternion; matched as both `<base>.adjust` and `<base>.adjusted_state.adjust`, the ASTER jitter naming). Per ASP's `.adjust` convention (a world point projects the same in the original camera as `R*(P−C)+C+T` in the adjusted one, `C` = camera center for pixel (0,0)), `T` is the exact bulk camera-center shift at the anchor pixel; the rotation only adds a lever-arm shift for other lines. Each camera's absolute center is anchored at the **center image line** (sub-satellite point at mid-acquisition, more meaningful than the trajectory mean when the ephemeris is padded beyond the image; falls back to the mean if the timing can't be computed): from `*.adjusted_state.json` (CSM runs; `getTimeAtLine` + ephemeris interpolation) or, for DigitalGlobe runs that write only `.adjust` deltas, from the original camera `.xml` ephemeris (`<EPHEMLIST>` interpolated at `FIRSTLINETIME + (NUMROWS/2)/AVGLINERATE`), auto-found in the BA dir and its parent or via `original_cameras_directory`. The two paths agree to <1 m on the same scenes. `get_camera_optimization_gdf(map_crs, original_cameras_directory)` returns one row per camera: the translation in local ENU (`t_east/t_north/t_up`, `t_horizontal`), the adjustment `adj_roll/adj_pitch/adj_yaw`, and `horizontal_offset_m/vertical_offset_m` — from `camera_offsets.txt` when present (authoritative: folds in the rotation lever-arm; associated to cameras positionally by zipping with `camera_list.txt`, both written per input image in the same order), else derived from `T`; `offsets_from_asp` flags which. Cameras whose center cannot be located, or whose `.adjust`/state file fails to parse, are warned and skipped. `triangulation_offsets.txt` (ASP >= 3.6; per-image mean/median/count of the initial-vs-final triangulated-point distance) is read the same positional way into `tri_mean_m/tri_median_m/tri_count`, NaN when absent — both reports go through `_rows_by_camera_basename()`.
127
+ - `PlotBundleAdjustCameras` (inherits from `Plotter`): per-camera bar rows sharing the camera order — `plot_center_offset_bars()` (horizontal and vertical center change, m), `plot_orientation_bars()` (signed roll/pitch/yaw in degrees with the value printed on every bar; `_draw_satellite()` draws one satellite cartoon beside the row as the legend for the body axes and rotation sense — deliberately not scaled, the numbers carry the magnitude), and `plot_triangulation_offset_bars()` (median/mean triangulated-point change with the point count), which `summary_plot()` adds as a third row only when `has_triangulation_offsets`. An all-zero run (identity `--initial-transform`) still draws the panels, with a "no camera change (identity adjustment)" note overlaid; signed zeros print as `+0` (`_fmt_deg`). Earlier map-view/orientation quivers and the per-camera cartoon grid were dropped: sub-meter shifts can't be drawn to scale on a ~400 km map, and fixed-size arcs looked identical at 1e-7° and 0.016°.
125
128
 
126
129
  **CSM camera model comparison** — split into three layers by issue #131 (was one 1541-LOC `csm_camera.py`):
127
130
 
@@ -246,6 +249,12 @@ All CLI tools are in `asp_plot/cli/` and use Click for argument parsing:
246
249
  - Compares original and optimized CSM camera models
247
250
  - Visualizes position/angle differences and camera footprints
248
251
 
252
+ **`bundle_adjust_cameras.py`** - Self-contained camera before/after tool (`bundle_adjust_cameras` command)
253
+ - Wrapper for `ReadBundleAdjustCameras` + `PlotBundleAdjustCameras` in `bundle_adjust.py`
254
+ - `--directory` is the bundle_adjust output folder itself (split internally into the reader's root + subdirectory); no original cameras needed, except `--original-cameras-directory` for DigitalGlobe runs whose XMLs are in neither the BA folder nor its parent
255
+ - `--map-crs`, `--title`, `--output-directory` (defaults to the BA folder, so a bare call always writes a figure) / `--output-filename`
256
+ - Renders `summary_plot()`: center-offset bars, orientation bars (with the legend cartoon), and the triangulated-point row when the run wrote `triangulation_offsets.txt`
257
+
249
258
  **`request_planetary_altimetry.py`** - Planetary altimetry data request tool (`request_planetary_altimetry` command)
250
259
  - Submits async LOLA (Moon) or MOLA (Mars) queries to the ODE GDS REST API
251
260
  - Auto-detects planetary body from DEM CRS via `detect_planetary_body()`
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.2.0] - 2026-08-27
9
+
10
+ A new view of what `bundle_adjust` did to the cameras — read from the run's own output folder, so no original camera files are needed — as a `bundle_adjust_cameras` command, a page of the `asp_report` PDF, and four notebook examples. The figure was reviewed on ten local runs (two to fourteen cameras, ASP 3.4 through 3.8); the row that earned its place is the ground effect from `triangulation_offsets.txt`, which is what tells a real camera error apart from a position/orientation trade in the solve. No new dependencies; one new entry point, so the conda-forge feedstock recipe needs the `bundle_adjust_cameras` entry point and test command added by hand this release.
11
+
12
+ ### Added
13
+ - **A camera-change figure for `bundle_adjust` runs, self-contained on the run's output folder** (issues [#95](https://github.com/uw-cryo/asp_plot/issues/95) and [#43](https://github.com/uw-cryo/asp_plot/issues/43)). The bundle adjustment residual pages show how well the *tie points* reproject; the new figure shows what the solve did to the *cameras*: per-camera bars of the horizontal and vertical camera-center change (meters), per-camera bars of the roll / pitch / yaw orientation change (degrees, the value printed on every bar, with one unscaled satellite cartoon as the legend for the body axes), and — when ASP >= 3.6 wrote `triangulation_offsets.txt` — a third row of the median and mean change of each image's triangulated points, the effect of the camera change on the ground. Everything is read from the `bundle_adjust` folder itself: the per-camera `*.adjust` translation + rotation, `camera_offsets.txt` (ASP 3.7.0's "change in camera positions" report) and `triangulation_offsets.txt` associated to cameras positionally through `camera_list.txt`, and each camera's absolute position from its `*.adjusted_state.json` or, for DigitalGlobe runs that write only `.adjust` deltas, from the original `.xml` ephemeris. No original camera files are needed, unlike `csm_camera_plot`. New `ReadBundleAdjustCameras` and `PlotBundleAdjustCameras` in `bundle_adjust.py`, a new **`bundle_adjust_cameras` command** (`--directory` = the BA folder; `--map-crs`, `--original-cameras-directory`, `--title`, `--output-directory`, `--output-filename`), and a new **"Camera Changes from Bundle Adjustment" page in the `asp_report` PDF** right after the residual pages whenever `--bundle-adjust-prefix` is given (a prefix with a run stem narrows the files to that run, as for the residuals). A run that applied only an identity transform draws the panels with a "no camera change" note. Reviewed on ten local runs — two to fourteen cameras, ASP 3.4 through 3.8, CSM and DigitalGlobe cameras, ASTER, WorldView and Pléiades — which is also where the ground-change row came from: in the five-scene Atlanta solve the cameras moved 24–70 m while the ground points moved under 1 m, a position/orientation trade that the camera bars alone would misrepresent. The WorldView UCSD and Atlanta, Pléiades Marseille, and ASTER notebooks gain the figure with a write-up, the two committed WorldView reports gain the page, and the CLI is documented in `docs/cli/bundle_adjust_cameras.md`. The conda-forge recipe entry points and test commands are updated for the new command (the autotick bot does not sync those).
14
+
8
15
  ## [3.1.0] - 2026-08-27
9
16
 
10
17
  A compatibility release for two things ASP 3.7.0 changed in the files the report reads. `pc_align` now writes Mean/StdDev/RMSE/Median/NMAD error statistics to its log, and the alignment page shows Median, NMAD and RMSE before and after alignment in place of the 16/50/84 percentiles ([#146](https://github.com/uw-cryo/asp_plot/issues/146)); older logs keep the percentiles, with no version sniffing. And a `parallel_stereo`/`bundle_adjust` run made with `--matches-as-txt` writes plain-text match files instead of binary `.match`, which previously left the match-point page with a "missing match file" placeholder — both formats are now discovered and parsed into the same DataFrame ([#147](https://github.com/uw-cryo/asp_plot/issues/147)). No new dependencies and no entry-point changes.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: asp_plot
3
- Version: 3.1.0
3
+ Version: 3.2.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
@@ -77,7 +77,7 @@ Generate a PDF report from an ASP processing directory:
77
77
  asp_report --directory ./ --stereo-directory stereo
78
78
  ```
79
79
 
80
- See the [CLI documentation](https://asp-plot.readthedocs.io/en/latest/cli/index.html) for all options and additional tools (`stereo_geom`, `csm_camera_plot`).
80
+ See the [CLI documentation](https://asp-plot.readthedocs.io/en/latest/cli/index.html) for all options and additional tools (`stereo_geom`, `csm_camera_plot`, `bundle_adjust_cameras`, `request_planetary_altimetry`, `gallery`).
81
81
 
82
82
  ## Examples
83
83
 
@@ -33,7 +33,7 @@ Generate a PDF report from an ASP processing directory:
33
33
  asp_report --directory ./ --stereo-directory stereo
34
34
  ```
35
35
 
36
- See the [CLI documentation](https://asp-plot.readthedocs.io/en/latest/cli/index.html) for all options and additional tools (`stereo_geom`, `csm_camera_plot`).
36
+ See the [CLI documentation](https://asp-plot.readthedocs.io/en/latest/cli/index.html) for all options and additional tools (`stereo_geom`, `csm_camera_plot`, `bundle_adjust_cameras`, `request_planetary_altimetry`, `gallery`).
37
37
 
38
38
  ## Examples
39
39