Repository navigation
Terrain on the line of sight: one ray, one sight angle, snapped DEM windows - #19
Merged
Merged
Conversation
…indows - geom.ray_latlon: ground points under the camera's straight line of sight, exact on WGS84. Every terrain march stepped in lat/lon with fixed metres-per-degree, which drifts off the ray by up to 0.33 deg at 80 km on diagonal azimuths; bearings were made exact in PR #17, the terrain wasn't. - terrain.sight_angles / eye_height / sightline: the curvature + refraction formula was copied in six places (horizon, ridges, terrain_range.profile, landmarks.visible, ridge_feet.sightline, fig_sea_horizon); all now share it. geom.enu_grid replaces the flat dn/de in terrain_range.terrain_loglik. - Dem.window snaps to the tiles' pixel grid and Dem.sample reads a pixel's value at its centre. Before, every sample was shifted by up to half a pixel, differently per window; now samples don't depend on the window. - Dem.site_problem: horizon/ridges warn and terrain_range skips when a camera's height disagrees with the DSM at its own site (elev 0, or no agl). No ledger camera is affected. - terrain_range.profile: optional min_km (off), horizon_km in validate rows. - test_geolocation pins the calibrated camera model instead of inheriting it from whichever module set FIGLIB_LENS at import; it failed when run alone. - tests/test_terrain.py: ray, sight angle, pixel centre, site check and sightline on a synthetic raster (numpy only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- NOTES "Terrain on the line of sight": the review of every DEM use, the skyline-check experiment (march 6.36 -> 6.32 px mean |res|; refraction k=0.13 undecided; an unexplained +1.2 px per 10 km range trend, likely haze in the edge search), and the re-run deltas. - terrain_range validate/solve, fig_bearing and skyline_check re-run from c841ee3. Containment is identical (60/73); confirmed medians unchanged. Rainbow's 30 px region is 5.0 km2 (was 4.8), 7.5 at 60 px (was 7.7). - README, docs/star-calibration.md (precession only +1.8 / 3.2 px) and the Rainbow and skyline figures updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows a review of how the DEM is used (NOTES.md, "Terrain on the line of sight").
Geometry
geom.ray_latlon: terrain is marched along the camera's real line of sight, exact on WGS84. The old lat/lon stepping drifted up to 0.33° off the ray at 80 km on diagonal azimuths, the same kind of error PR Geolocation re-run on the precessed ledger #17 removed from bearings.terrain.sight_angles/eye_height/sightline: one copy of the curvature + refraction formula instead of seven. All tracked call sites use it (horizon,ridges,terrain_range,landmarks.visible,ridge_feet.sightline,fig_sea_horizon).Dem.windowsnaps to the tiles' pixel grid, andDem.samplereads a pixel at its centre. Samples are now independent of the window.Dem.site_problem: warns about or skips cameras whose height disagrees with the DSM (elev 0 or no agl). None of them are ledger cameras.test_geolocationpins the calibrated camera model. It failed when run alone.Measured before adopting (skyline check, 39 cameras): the line-of-sight march is real but sub-pixel on the skyline (mean |res| 6.36 → 6.32 px). Refraction k=0.13 vs 4/3 isn't decided by the data, so the terrain stays at 4/3. There is an unexplained +1.2 px per 10 km range trend, likely haze in the edge search.
Re-run: terrain-range containment is identical (60/73) and confirmed medians are unchanged. Rainbow's 30 px region is 5.0 km² (was 4.8). The skyline check is unchanged at +0.3 / 2.8 px.
Tests: new
tests/test_terrain.py(numpy only). The full suite passes, and so does each module run alone.🤖 Generated with Claude Code