Skip to content

Commit

Permalink
add norad_id to pass dict
Browse files Browse the repository at this point in the history
  • Loading branch information
redraw committed Jul 2, 2024
1 parent e7ce8f8 commit ce588d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ User-Agent: HTTPie/1.0.3
"is_sunlit": false,
"visible": false
},
"norad_id": 25544,
"visible": false
}
]
Expand Down
2 changes: 2 additions & 0 deletions app/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def __init__(self, lat, lon, norad_id=None, horizon=10.0):
self.eph = skyfield_load("de421.bsp")
self.timescale = skyfield_load.timescale()
self.horizon = horizon
self.norad_id = norad_id
tle = get_tle(norad_id)
self.observer = wgs84.latlon(lat, lon)
self.satellite = EarthSatellite(tle[1], tle[2], tle[0], self.timescale)
Expand All @@ -41,6 +42,7 @@ def next_passes(self, days=7, visible_only=False):
# Loop for each pass (3 events)
for pass_times, pass_events in zip(chunked(times, 3), chunked(events, 3)):
full_pass = self.serialize_pass(pass_times, pass_events)
full_pass["norad_id"] = self.norad_id
full_pass["visible"] = any(event["visible"] for event in full_pass.values())
passes.append(full_pass)

Expand Down

0 comments on commit ce588d3

Please sign in to comment.