fix(satellite): populate currentPos with full telemetry in pass predictions

Previously currentPos only had lat/lon, so the updateTelemetry fallback
(used before first live position arrives) always showed '---' for
altitude/elevation/azimuth/distance. currentPos now includes all fields
computed from the request observer location. updateTelemetry simplified
to delegate to applyTelemetryPosition.
This commit is contained in:
James Smith
2026-03-19 21:48:33 +00:00
parent d84237dbb4
commit d240ae06e3
3 changed files with 34 additions and 15 deletions

View File

@@ -513,7 +513,19 @@ def predict_passes():
current_pos = {
'lat': float(sp.latitude.degrees),
'lon': float(sp.longitude.degrees),
'altitude': float(sp.elevation.km),
}
# Add observer-relative data using the request's observer location
try:
diff = satellite - observer
topo = diff.at(t0)
alt_deg, az_deg, dist_km = topo.altaz()
current_pos['elevation'] = round(float(alt_deg.degrees), 1)
current_pos['azimuth'] = round(float(az_deg.degrees), 1)
current_pos['distance'] = round(float(dist_km.km), 1)
current_pos['visible'] = bool(alt_deg.degrees > 0)
except Exception:
pass
except Exception:
pass