skyview/internal
Ole-Morten Duesund cb79e0b3b7 Fix CPR zone ambiguity causing systematic eastward position bias
This addresses Issue #18 by correcting the CPR global decoding algorithm
implementation that was causing aircraft to appear tens of kilometers
east of their actual positions.

Root Cause:
- CPR longitude zone calculation always used NL-1 regardless of frame type
- Specification requires: even frames use NL zones, odd frames use NL-1 zones
- This caused systematic eastward displacement for all aircraft positions

Changes:
- Implement frame-consistent zone calculations per RTCA DO-260B specification
- Even frame (i=0): ni = max(1, NL - 0) = max(1, NL)
- Odd frame (i=1): ni = max(1, NL - 1)
- Add comprehensive documentation with authoritative source references
- Ensure latitude and longitude use same frame choice for consistency

Testing:
- Aircraft south of Oslo now appears correctly (was near Skarlandsvatnet)
- Aircraft north of Oslo should now appear correctly (was east of Lillestrøm)
- Systematic eastward bias eliminated

References:
- RTCA DO-260B / EUROCAE ED-102A: ADS-B Performance Standards
- ICAO Annex 10, Volume IV: Surveillance Systems
- "Decoding ADS-B position" by Edward Lester
- PyModeS reference implementation

Fixes #18

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 23:07:56 +02:00
..
beast Clean up codebase and fix server host binding for IPv6 support 2025-08-24 18:36:14 +02:00
client Clean up codebase and fix server host binding for IPv6 support 2025-08-24 18:36:14 +02:00
icao Clean up codebase and fix server host binding for IPv6 support 2025-08-24 18:36:14 +02:00
merger Improve position validation logging and reduce spam 2025-08-24 20:39:57 +02:00
modes Fix CPR zone ambiguity causing systematic eastward position bias 2025-08-24 23:07:56 +02:00
server Add active WebSocket client tracking and display 2025-08-24 21:56:16 +02:00