mirror of
https://github.com/smittix/intercept.git
synced 2026-06-18 10:29:46 -07:00
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:
@@ -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
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user