-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add parser to read TLEs from Multi Mission Administrative Messages #78
Conversation
Codecov Report
@@ Coverage Diff @@
## main #78 +/- ##
==========================================
+ Coverage 85.31% 86.32% +1.01%
==========================================
Files 13 13
Lines 1893 1967 +74
==========================================
+ Hits 1615 1698 +83
+ Misses 278 269 -9
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add the new xml reading to the TLE class?
DeepCode's analysis on #89d693 found:
Top issues
👉 View analysis in DeepCode’s Dashboard | Configure the bot |
I'll be ignoring the Deepcode warning about using |
…pyorbital into feature-tle-admin-messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding MMAM functionality and taking the time to refactor!
I think the tests are missing the case of passing the MMAM to the TLE class instance directly, right?
Otherwise, a few comments inline
platform = ' '.join(parts[:-1]) | ||
num = parts[-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work I think, examples from http://celestrak.com/NORAD/elements/weather.txt :
DMSP 5D-3 F16 (USA 172)
EWS-G1 (GOES 13)
I'm not saying it was working better before though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will. The parts[-1]
is the platform number defined in platforms.txt
.
return [Tle('', tle_file=io.StringIO(tle)) for tle in | ||
_get_tles_from_uris(item, open_func, platform='', only_first=False)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the call to StringIO here? isn't open_func taking care of that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the only way of distinguishing between a filename str
and data already read from the XML file as str
in _get_uris_and_open_func()
. Suggestions for a better way are wellcome.
pyorbital/tlefile.py
Outdated
return "\n".join(data) | ||
|
||
|
||
def _grouper(n, iterable, fillvalue=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name could be improved, maybe matching the docstring more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. The naming was taken from itertools
examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Like this one? 😁 pyorbital/pyorbital/tests/test_tlefile.py Lines 120 to 130 in 89d6935
|
Ah, sorry, missed it! |
This PR adds a parser that can read TLE data from MMAM XML files.
flake8 pyorbital