2

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

如下;

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

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

以下代码重现了结果。

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)

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

先感谢您。

4

1 回答 1

2

在玩了一段时间并使用了其他 TLE 之后,我的一个想法是 neverup 没有正确考虑你的视野。也许它正在使用 00:00:00 来定义布尔值;如果将地平线更改为 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)

为了进一步调试,我们可以在此处显示的下一次通过时打印卫星的高度。IE

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 是。

于 2014-09-22T04:41:17.867 回答