From a202c9dd948e93d7150ef334a9154c94c0806b18 Mon Sep 17 00:00:00 2001 From: James Smith Date: Thu, 11 Jun 2026 17:31:00 +0100 Subject: [PATCH] refactor: agent satellite predictor reads TLEs from unified store MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .gitignore | 3 --- intercept_agent.py | 12 +++--------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index e002952..2af7fed 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/intercept_agent.py b/intercept_agent.py index 468ed72..d93fc1f 100644 --- a/intercept_agent.py +++ b/intercept_agent.py @@ -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")