skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.41k stars 211 forks source link

Mean motion value get from an EarthSatellite instance does not match the one in the input TLE #180

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi,

For me, EarthSatellite instances are returning a mean motion value that is slightly different from the one in the input TLE.

I've tried this code (the TLE is the first one from python-sgp4/sgp4/SGP4-VER.TLE),

import math
import skyfield.api

# set TLE
TLE = '''
1 00005U 58002B   00179.78495062  .00000023  00000-0  28098-4 0  4753
2 00005  34.2682 348.7242 1859667 331.7664  19.3264 10.82419157413667     0.00      4320.0        360.00
'''.strip()
line1, line2 = TLE.splitlines()

# print input TLE
print 'Input TLE:'
print line1
print line2
print

# create satellite object
satellite = skyfield.api.EarthSatellite(line1, line2)

# print values of orbital elements from satellite object
print
print 'TLE data from satellite object:'
print '    - Inclination: {} degrees'.format(math.degrees(satellite.model.inclo))
print '    - Right ascension of ascending node: {} degrees'.format(math.degrees(satellite.model.nodeo))
print '    - Argument of perigee: {} degrees'.format(math.degrees(satellite.model.argpo))
print '    - Mean anomaly: {} degrees'.format(math.degrees(satellite.model.mo))
print '    - Mean motion: {} rads/min'.format(satellite.model.no)
print

# print but
print
print 'but for me {} rads/min = {} revs/day'.format(satellite.model.no, (satellite.model.no*24*60)/(2.0*math.pi))
print

that outputs

Input TLE:
1 00005U 58002B   00179.78495062  .00000023  00000-0  28098-4 0  4753
2 00005  34.2682 348.7242 1859667 331.7664  19.3264 10.82419157413667     0.00      4320.0        360.00

[#################################] 100% deltat.preds

TLE data from satellite object:
    - Inclination: 34.2682 degrees
    - Right ascension of ascending node: 348.7242 degrees
    - Argument of perigee: 331.7664 degrees
    - Mean anomaly: 19.3264 degrees
    - Mean motion: 0.0472063015592 rads/min

but for me 0.0472063015592 rads/min = 10.8188873831 revs/day

Am I missing something here?

THX

cbassa commented 6 years ago

Have a look at section 6 of Project SpaceTrack Report #3, which describes the start of the SGP4 algorithm. It recovers the 'original' mean motion and semi-major axis from the TLE by computing corrections based on the inclination and eccentricity of the orbit. I am not 100% sure, but the delta1 factor seems to correct for the precession effects due the J2 term of the geopotential.

ghost commented 6 years ago

@cbassa yes, you're right. I did the calculations and the TLE mean motion is recovered if you compute

satellite.model.no / (1 + delta0)

as indicated in section 6 of Project SpaceTrack Report #3.



Now that I read the documentation again, API Reference - Earth Satellites is clear about this

If you are interested in the catalog entry details, the SGP4 model parameters for a particular satellite can be accessed through its model attribute: