Skip to content

Fix altitude unit mismatch in ADSB delay calculation#33

Open
jonnyspicer wants to merge 1 commit intomainfrom
fix/adsb-delay-altitude-units
Open

Fix altitude unit mismatch in ADSB delay calculation#33
jonnyspicer wants to merge 1 commit intomainfrom
fix/adsb-delay-altitude-units

Conversation

@jonnyspicer
Copy link

Summary

  • lib/geometry.js: Aircraft altitude from ADS-B (alt_geom) is in feet but was used directly alongside station altitudes in meters. Added * 0.3048 conversion. This caused delay errors of up to ~30 km for high-altitude aircraft.
  • lib/extrapolation.js: geom_rate (ft/min) was converted to m/s then added to alt_geom in feet. Changed to / 60 to stay in ft/s, keeping altitude consistently in feet — geometry.js now handles the ft→m conversion.

Test plan

  • Deployed patched files to staging via Docker volume mount
  • Verified delay values match independent haversine+ECEF calculation with 0.0000 km RMS error across 77 aircraft
  • Confirmed high-altitude aircraft (30,000–43,000 ft) no longer show 20–30 km delay inflation
  • Monitored over multiple checks — results stable
  • Run existing test suite (test_bistatic.js, etc.)

🤖 Generated with Claude Code

Aircraft altitude from ADS-B (alt_geom) is in feet, but
calculateBistaticDelay() used it directly alongside station altitudes
which are in meters from the config. This caused delay values to be
inflated — up to ~30 km error for aircraft at 40,000 ft.

Also fix extrapolation.js where geom_rate (ft/min) was converted to
m/s via * 0.00508 then added to alt_geom in feet. Changed to / 60
to stay in ft/s, keeping altitude consistently in feet. The ft→m
conversion is now handled solely in geometry.js.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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