gpt4 book ai didi

python - pyephem next_pass 函数返回不同的结果

转载 作者:太空宇宙 更新时间:2023-11-04 03:41:57 26 4
gpt4 key购买 nike

我正在创建一个应用程序来预测卫星的可见路径。在应用程序中,我使用“if”语句来决定卫星是否可见。

喜欢以下;

if satellite.neverup is False and satellite.circumpolar is False:
observer.next_pass(satellite)

此计算适用于大多数 LEO 卫星。但是,我发现了一些奇怪的结果。 satellite.compute(observer) 之前和之后使用的 next_pass 函数返回不同的值。

以下代码重现结果。

import ephem

line_0 = '0 SL-3 R/B'
line_1 = '1 12904U 81103B 14252.72400340 .00001812 00000-0 13444-3 0 5754'
line_2 = '2 12904 081.1813 349.2718 0030677 147.5032 212.8569 15.02708918340741'

target = ephem.readtle(line_0,line_1,line_2)

site = ephem.Observer()
site.lon = '151:43:00'
site.lat = '-27:26:00'
site.elevation = 400
site.name = 'test facility'
site.horizon = '40:00:00'
site.date = '2014/9/20 00:29:10'

print ephem.__version__

print site.next_pass(target)

target.compute(site)

print [target.neverup,target.circumpolar]

print site.next_pass(target)

结果如下;

3.7.5.3
(2014/9/20 01:55:43, 303:49:09.6, 2014/9/20 00:25:02, 30:44:01.7, 2014/9/20 00:30:10, 164:08:09.1)
[False, False]
(None, None, None, None, None, None)

我怎样才能避免这个结果发生变化?我哪里错了?

提前谢谢你。

最佳答案

在尝试了一段时间并使用了其他 TLE 后,我的一个想法是 neverup 没有正确说明您的视野。也许它使用 00:00:00 来定义 bool 值;如果将地平线更改为 30:00:00,则输出变为:

3.7.5.3
(2014/9/20 01:55:43, 303:49:09.6, 2014/9/20 00:25:02, 30:44:01.7, 2014/9/20 00:30:10,164:08:09.1)
[False, False]
(2014/9/20 12:06:25, 191:15:15.1, 2014/9/20 12:08:23, 82:43:37.8, 2014/9/20 12:10:20, 1:10:09.6)

为了进一步调试,我们可以在此处显示的下一轮打印卫星的高度。即

info = site.next_pass(target)
site.date = info[0]
target.compute(site)
print target.alt

这给出:

31:07:31.3

现在,如果我们将海拔高度更改为 34:00:00 之类的值,我们就会返回 None 列表。

我的猜测是 neverup 没有考虑您定义的范围,但 next_pass 是。

关于python - pyephem next_pass 函数返回不同的结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25966098/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com