diff --git a/routes/satellite.py b/routes/satellite.py index 717a955..c1ec78b 100644 --- a/routes/satellite.py +++ b/routes/satellite.py @@ -243,12 +243,13 @@ def _fetch_iss_realtime(observer_lat: float | None = None, observer_lon: float | if iss_lat is None: return None - result = { - 'satellite': 'ISS', - 'lat': iss_lat, - 'lon': iss_lon, - 'altitude': iss_alt, - 'source': source + result = { + 'satellite': 'ISS', + 'norad_id': 25544, + 'lat': iss_lat, + 'lon': iss_lon, + 'altitude': iss_alt, + 'source': source } # Calculate observer-relative data if location provided @@ -477,11 +478,12 @@ def get_satellite_position(): topocentric = diff.at(now) alt, az, distance = topocentric.altaz() - pos_data = { - 'satellite': sat_name, - 'lat': float(subpoint.latitude.degrees), - 'lon': float(subpoint.longitude.degrees), - 'altitude': float(geocentric.distance().km - 6371), + pos_data = { + 'satellite': sat_name, + 'norad_id': next((nid for nid, name in norad_to_name.items() if name == sat_name), None), + 'lat': float(subpoint.latitude.degrees), + 'lon': float(subpoint.longitude.degrees), + 'altitude': float(geocentric.distance().km - 6371), 'elevation': float(alt.degrees), 'azimuth': float(az.degrees), 'distance': float(distance.km),