Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update celestrak urls #138

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions pyorbital/tlefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@
from xml.etree import ElementTree as ET
from itertools import zip_longest


TLE_URLS = ('https://celestrak.org/NORAD/elements/active.txt',
'https://celestrak.org/NORAD/elements/weather.txt',
'https://celestrak.org/NORAD/elements/resource.txt',
'https://celestrak.org/NORAD/elements/cubesat.txt',
'https://celestrak.org/NORAD/elements/stations.txt',
'https://celestrak.org/NORAD/elements/sarsat.txt',
'https://celestrak.org/NORAD/elements/noaa.txt',
'https://celestrak.org/NORAD/elements/amateur.txt',
'https://celestrak.org/NORAD/elements/engineering.txt')
TLE_GROUPS = ('active',
'weather',
'resource',
'cubesat',
'stations',
'sarsat',
'noaa',
'amateur',
'engineering')

TLE_URLS = [f'https://celestrak.org/NORAD/elements/gp.php?GROUP={group}&FORMAT=tle'
for group in TLE_GROUPS]


LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -321,7 +323,7 @@
uris = (tle_file,)
open_func = _open
elif local_tle_path:
# TODO: get the TLE file closest in time to the actual satellite

Check notice on line 326 in pyorbital/tlefile.py

View check run for this annotation

codefactor.io / CodeFactor

pyorbital/tlefile.py#L326

unresolved comment '# TODO: get the TLE file closest in time to the actual satellite' (C100)
# overpass, NOT the latest!
list_of_tle_files = glob.glob(os.path.join(local_tle_path, '*'))
uris = (max(list_of_tle_files, key=os.path.getctime), )
Expand Down