我正在使用 pyEphem 从我的位置获取国际空间站的下一次飞越,但我得到的结果与我在天堂上方使用相同坐标看到的结果不匹配
我可能犯了一个愚蠢的错误,但我想不通
我下面的代码返回结果: 上升时间:2017/5/25 20:34:39 方位:193:28:04.0
虽然距离最近的天空有将近 3 小时的路程,上升时间为:23:09:40
http://www.heavens-above.com/passdetails.aspx?&satid=25544&mjd=57898.9270155034&type=V
from datetime import datetime
import ephem
import pytz
line1 = 'ISS (ZARYA)'
line2 = '1 25544U 98067A 17145.52800275 .00016717 00000-0 10270-3 0 9015'
line3 = '2 25544 51.6372 151.2656 0005033 192.5139 167.5889 15.53913304 18224'
tle = [line1, line2, line3]
iss = ephem.readtle(tle[0], tle[1], tle[2])
longitude = -6.2282
latitude = 53.2842
altitude = 20
site = ephem.Observer()
site.lat = str(latitude)
site.lon = str(longitude)
site.elevation = 20
current_time = datetime(2017, 5, 25, 12, 0, 0, tzinfo=pytz.utc)
site.date = current_time
info = site.next_pass(iss)
print("Rise time: %s azimuth: %s" % (info[0], info[1]))
最佳答案
问题编辑后的更新答案:
唉,当我点击您问题中的链接时,Heavens Above 现在会出现服务器错误。所以我重新访问了该站点,输入了您脚本中的坐标,并得到了一些预测。为了避免丢失它们,这里是一个快速截图:
当我将 ISS 的新 TLE 粘贴到您的脚本中并调整 current_time
时,我可以获得与他们的答案非常接近的答案。然后脚本如下所示:
from datetime import datetime
import ephem
import pytz
line1, line2, line3 = """\
ISS (ZARYA)
1 25544U 98067A 17198.89938657 .00000988 00000-0 22167-4 0 9998
2 25544 51.6416 245.2318 0005849 47.2823 302.7554 15.54170925 66526
""".splitlines()
tle = [line1, line2, line3]
iss = ephem.readtle(tle[0], tle[1], tle[2])
longitude = -6.2282
latitude = 53.2842
altitude = 20
site = ephem.Observer()
site.lat = str(latitude)
site.lon = str(longitude)
site.elevation = 20
current_time = datetime(2017, 7, 21, 1, 0, 0, tzinfo=pytz.utc)
site.date = current_time
info = site.next_pass(iss)
for item in info:
print(item)
输出是:
2017/7/21 01:32:01
263:02:11.2
2017/7/21 01:37:29
66:12:31.4
2017/7/21 01:42:58
93:15:48.0
这与您在屏幕截图中看到的相同,以世界时间表示,而不是 Heavens Above 使用的都柏林 UTC+1 时区——因此 PyEphem 给出的最高点时间 1:37am 变为 2:都柏林本地时间凌晨 37 点。
我又检查了一两次,它们似乎都非常一致——时区会不会是混淆的根源?
原答案:
您指定东经 53.2842° 和南纬 6.2282°,在世界地图上似乎位于印度洋西部边缘的某个地方。您是否可能打算使用负数 -53.2842°,将位置改为巴西?
关于python - pyephem next_pass 不匹配天堂之上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33587801/