question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why isn't this orbit on the equator?

See original GitHub issue

I have the following TLE which is a nearly circular orbit with no angle of inclination. I would expect the satellite to circle exactly around the equator:

1 70000U 99999ZZZ 21079.40069444 .00022359 00942-5 37766-3 0 1009 2 70000 0.0000 0.0000 0000100 0.0000 0.0000 14.87482098 12341

I am using the following code:

from skyfield.api import load, EarthSatellite
from datetime import timedelta

sat = EarthSatellite(tle1, tle2)
minutes = 0
ts = load.timescale(builtin=True)
time = ts.from_datetime(sat.epoch.utc_datetime() + minutes * timedelta(minutes = 1))
geocentric = sat.at(time)
print(geocentric.position.km)

Gives me the result of:

[6980.64196792 -33.11916156 -14.1663118 ]

I’m getting a z values of -14.1663118 when I expected it to be on the equator. If I continue to follow the orbit, it oscillates between this value and positive 14. When I use the sgp4 module (see following code), I get exactly 0.0 for the z coordinate. Are the two using different models of the Earth?

from sgp4.api import Satrec
from skyfield.api import load
from datetime import timedelta

sat = Satrec.twoline2rv(tle1, tle2)
minutes = 0
ts = load.timescale(builtin=True)
time = ts.from_datetime(sat.epoch.utc_datetime() + minutes * timedelta(minutes = 1))
jd = time.whole
fr = time.tai_fraction - times[k]._leap_seconds() / 86400.0
e_sat, pos_sat, v_sat = sat.sgp4(jd, fr)
print(pos_sat)

Gives me the result of: (6980.734907411272, 0.000136108758132057, 0.0)

In general, I would expect these numbers to be exactly the same.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
troyrockcommented, Sep 1, 2021

Thanks for your patience and help. I feel like I understand much better what I’m doing and how to proceed.

0reactions
troyrockcommented, Sep 2, 2021

Nearly all of the difficulty for me boiled down to understanding the different reference frames involved. I wouldn’t be surprised if I still wasn’t completely squared on everything. I’m fairly new to this so I fully expected to have a steep learning curve. For me a short tutorial of the different coordinate systems and where they appear would have been helpful. For instance, I found the following somewhere on the web that was helpful to me:

The difference between GCRF and TEME resides in the fact that in the GCRF frame, the X-axis and Z-axis are aligned respectively with the mean equinox and rotation axis of Earth at 12:00 Terrestrial Time on the 1st of January, 2000, while in the TEME frame they are aligned with the mean equinox and rotation axis at the time of the corresponding TLE. Due to the change of the direction of the vernal equinox and the rotation axis over time, coordinates in the two frames differ slightly.

It wasn’t clear to me that when you ask for x, y, z coordinates you get GCRF coordinates but when you ask for latitude and longitude, they are aligned to the ITRS coordinate system (so that you can plot them correctly). You are doing exactly the best thing but it wasn’t clear to me that there were all of these different coordinate systems involved.

If I had understood the difference between TEME and GCRF, I wouldn’t have been surprised that they give different answers for x, y, and z but I still needed to understand that asking for latitude and longitude is yet another reference frame and might have still been surprised that the latitude and longitude given from geocentric.frame_latlon(itrs) is not the same as you would get if you tried to convert x, y, z coordinates to latitude and longitude using the readily available formulas (i.e. https://web.archive.org/web/20080920155754/http://www.ferris.edu/faculty/burtchr/papers/cartesian_to_geodetic.pdf) because of the additional conversion from GCRF to ITRS.

You have been very careful about the code and all of the different reference systems. I have looked through several areas of the code that are both clean and very well documented. I’m very impressed with the tool: it’s a pleasure to have such annoying complexities completely taken care of in the correct way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is the Moon's orbit so complicated?
The Moon's orbit was likely equatorial until it migrated outwards across the Laplace radius, beyond which the perturbations from the Sun (which ...
Read more >
Why no equatorial Orbit? : r/Starlink - Reddit
This means neither uplink nor downlink can be used when the satelite is between the groundstation and anywhere along geostationary orbit. If you ......
Read more >
Space Station Orbit Tutorial
Thus, the orbit below, begins at the equator over the Pacific Ocean, and ends again at the equator but to the west of...
Read more >
Why don't we put a geosynchronous weather satellite in orbit ...
While a satellite in orbit above the 45th parallel might be more useful, it isn't possible. The center of a satellite orbit must...
Read more >
What Is the Ecliptic? - Sky & Telescope
The Moon isn't always on the plane, and that's because its orbit is ... circle from Earth's orbit around the Sun, the celestial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found