Allow different gravity model when parsing TLEs#3
Conversation
Implements an optional fourth parameter to `KeplerianElements.from_tle()` to enable using a different gravity model than the default `wgs72` one. Accepts any `namedtuple` with the same entries as the gravity models provided by SGP4. Example usage: ``` from sgp4.earth_gravity import wgs84 # ... other imports and definitions, incl. line1, line2, and earth ... ke = KeplerianElements.from_tle(line1, line2, earth, gravity_model=wgs84) ```
|
You're right, there should be a way to specify this. Saying that, the difference between wgs72 and wgs84 at epoch are on the order of 10 metres which is much less than the uncertainty in the TLE itself (which I mention since with this module we're just getting a mean keplerian orbit from the TLE). I would merge the PR if you default the new parameter to None with the current behaviour, and document that an In case you're interested, the intent was for python-astrodynamics/astrodynamics to be able to do what |
|
Sure thing, will do!
How/where should I do that? In the docstring? Or did I miss some other place? |
Sounds good, I will definitely check it out! I do have some other stuff you might be interested in, but I need to check if I am allowed to publish it there. Another idea I had when looking at the orbital code was that it lacks a bit of separation. E.g. in my project I have my own orbit propagation method and am just intersted in the Keplerian Elements itself (derived from TLEs) without any extra functionality. Would be nice if astrodynamics would allow greater flexibility in choosing which functionality I'd like to use. |
Yep, just the docstring. |
I'd like to use a more recent gravity model than the default one. Here's one trivial proposal, which enables passing any
namedtuplewith the same entries as the ones provided by SGP4, so you could basically hack together your own model. Long-term, this could probably be based on thebodyparameter.Speaking of which, I've never seen anything besides Earth satellites being defined by TLEs, so the
bodyshould probably default toearth.