pyephem next_pass不匹配heavensab

2024-03-28 20:43:03 发布

您现在位置:Python中文网/ 问答频道 /正文

下一步我用以弗所的坐标来计算,但我用上面的坐标来计算

我可能犯了个愚蠢的错误,但我想不通

我下面的代码返回结果: 上升时间: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]))

Tags: importinfodatetimetimesitelatitudeisstle
1条回答
网友
1楼 · 发布于 2024-03-28 20:43:03

编辑问题后更新了答案:

唉,我现在在上面的问题上给你的服务器一个错误。所以我重新访问了这个网站,输入了你的脚本中的坐标,并得到了一些预测。为了避免丢失,下面是一个快速截图:

enter image description here

当我把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)

输出是:

^{pr2}$

这和你在截图中看到的一样,用世界时来表示,而不是上面的天堂使用的都柏林的UTC+1时区,所以PyEphem给出的1:37的最高点时间变成了都柏林当地时区的2:37。在

我又检查了一两个通行证,他们似乎都非常一致——时区可能是造成混乱的根源吗?在

原始答案:

您指定的经度为东经53.2842°,南纬6.2282°,这在世界地图上似乎位于印度洋的西边缘。你是不是打算用负数-53.2842°,把地点改在巴西?在

相关问题 更多 >