Why isn't this orbit on the equator?
See original GitHub issueI 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:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Thanks for your patience and help. I feel like I understand much better what I’m doing and how to proceed.
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:
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.