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

Allow different gravity model when parsing TLEs #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions orbital/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ def from_state_vector(cls, r, v, body, ref_epoch=J2000):
return self

@classmethod
def from_tle(cls, line1, line2, body):
def from_tle(cls, line1, line2, body, gravity_model=wgs72):
"""Create object by parsing TLE using SGP4."""

# Get state vector at TLE epoch
sat = sgp4.io.twoline2rv(line1, line2, wgs72)
sat = sgp4.io.twoline2rv(line1, line2, gravity_model)
r, v = sgp4.propagation.sgp4(sat, 0)
ref_epoch = time.Time(sat.epoch, scale='utc')

Expand Down