refactor: agent satellite predictor reads TLEs from unified store

Removes the agent's own CelesTrak download (the source of the stray
gp.php artifact) — the store is now the single TLE source for app and
agent alike.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
James Smith
2026-06-11 17:31:00 +01:00
parent 07887b7c99
commit a202c9dd94
2 changed files with 3 additions and 12 deletions
-3
View File
@@ -57,9 +57,6 @@ data/weather_sat/
# Radiosonde runtime data (station config, logs)
data/radiosonde/
# Downloaded TLE files (intercept_agent satellite predictor)
data/tle/
# SDR capture files (large IQ recordings)
data/subghz/captures/
+3 -9
View File
@@ -3449,18 +3449,12 @@ class ModeManager:
stop_event = self.stop_events.get(mode)
try:
from skyfield.api import Loader, Topos
from skyfield.api import EarthSatellite, Topos, load
# Use a dedicated TLE directory — the default loader downloads into
# the current working directory, littering it with 'gp.php'
tle_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data", "tle")
os.makedirs(tle_dir, exist_ok=True)
load = Loader(tle_dir, verbose=False)
stations_url = "https://celestrak.org/NORAD/elements/gp.php?GROUP=weather&FORMAT=tle"
satellites = load.tle_file(stations_url)
from utils import tle_store
ts = load.timescale(builtin=True)
satellites = [EarthSatellite(l1, l2, name, ts) for name, l1, l2 in tle_store.all_tles().values()]
observer = Topos(latitude_degrees=lat, longitude_degrees=lon)
logger.info(f"Satellite predictor: {len(satellites)} satellites loaded")