Skip to content

Commit

Permalink
Logs the norad_id that are DECAYED since the API
Browse files Browse the repository at this point in the history
  • Loading branch information
smpiano committed Oct 24, 2024
1 parent a00f525 commit 5a728e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions pipe_satellite_data/process/sat_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ def process(self, date_ts, norad_ids):

# get TLEs for norad_ids for the date
tles = fetch_TLE(self.st_auth, norad_ids, dt)

# https://www.space-track.org/documentation#api-basicSpaceDataDecay
tles = filter(lambda x: int(x["DECAYED"]) not in [1, 2], tles)
tles, tles_4_sats = tee(tles)

#store in GCP
Expand Down
5 changes: 4 additions & 1 deletion pipe_satellite_data/utils/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def fetch_TLE(st_auth, norad_ids, dt):
for tles_list_by_norad in norad_dict.values():
first_tle=[tles_list_by_norad[0]]
for tle in first_tle:
yield tle
if int(tle["DECAYED"]) not in [1, 2]: # https://www.space-track.org/documentation#api-basicSpaceDataDecay
yield tle
else:
logging.info(f'>>> TLE already DECAYED: {tle["NORAD_CAT_ID"]}')



Expand Down

0 comments on commit 5a728e3

Please sign in to comment.