我正在使用python SGP4 1.1模块来计算MEO卫星的位置和速度。我注意到与STK和JSatTrak进行比较时,位置和速度的返回值是不正确的。卫星应该有大约6个小时的地面重复轨道,但是这个节目显示了4:47:51的地面重复。有什么我做错了吗?
from sgp4.earth_gravity import wgs72
from sgp4.io import twoline2rv
from math import atan2, cos, pi, sin, sqrt, tan
from datetime import datetime
def calculate(options):
x = options[0]
y = options[1]
z = options[2]
# Constants (WGS ellipsoid)
a = 6378.137
e = 8.1819190842622e-2
# Calculation
b = sqrt(pow(a,2) * (1-pow(e,2)))
ep = sqrt((pow(a,2)-pow(b,2))/pow(b,2))
p = sqrt(pow(x,2)+pow(y,2))
th = atan2(a*z, b*p)
lon = atan2(y, x)
lat = atan2((z+ep*ep*b*pow(sin(th),3)), (p-e*e*a*pow(cos(th),3)))
n = a/sqrt(1-e*e*pow(sin(lat),2))
alt = str(p/cos(lat)-n)
lat = str((lat*180)/pi)
lon = str((lon*180)/pi)
#print "%s %s %s" % (lat, lon, alt)
return (lat, lon, alt)
line1 = '1 1U 001001 14001.00000000 .00000000 00000+0 00000+0 0 00022'
line2 = '2 1 0.0891 294.8098 0002843 64.8653 0.5014 5.00115502 09'
satellite = twoline2rv(line1, line2, wgs72)
position1, velocity1 = satellite.propagate(2013, 3, 1, 0, 0, 1)
position2, velocity2 = satellite.propagate(2013, 3, 1, 4, 47, 52)
lat1,lon1,alt1 = calculate(position1)
lat2,lon2,alt2 = calculate(position2)
print lat1 + " " + lon1 + " " + alt1
print lat2 + " " + lon2 + " " + alt2
print "\n\n"
print position1
print position2
答案 0 :(得分:3)
你问这个问题已经有三个星期了,所以我想它对你无论如何都会对你有所帮助......
我没有Python SGP4例程,我无法测试它们,但通常SGP4例程将在惯性(非旋转)参考帧中返回位置和速度,称为TEME(True Equator,Mean Equinox:{{3} })。您正在计算此参考系统中的地球的纬度/经度,它会给您错误的结果。您应该首先将TEME系统转换为与地球一起旋转的旋转系统(如ECEF:https://en.wikipedia.org/wiki/Earth-centered_inertial#TEME),然后您可以计算纬度/经度。
我希望有这个转换的库,因为它不是一个微不足道的。
问候。
答案 1 :(得分:3)
您需要在计算中允许旋转地球。而不是经度,你已经计算了地心权利提升。首先阅读维基百科上Hour Angle的文章。