python - Skyfield:在给定的时间间隔内以 1 秒的周期获得 sgp4 结果

标签 python skyfield sgp4

我已经在 python 中使用 Skyfield 实现了 sgp4 算法。

我需要 1 天时间间隔的位置向量,周期为 1 秒。为此,我必须反复计算 sgp4,每次增加 1 秒。

有没有办法返回一个包含所有位置的向量?

最佳答案

幸运的是,Skyfield 是为 NumPy 数组的时间对象设计的,它将生成与数组中的对象一样多的位置。以下是描述该功能的文档部分:

http://rhodesmill.org/skyfield/time.html#date-arrays

这是一个完成您描述的任务的示例:

from numpy import arange
from skyfield.api import load, EarthSatellite

iss_tle0 = """\
1 25544U 98067A   18184.80969102  .00001614  00000-0  31745-4 0  9993
2 25544  51.6414 295.8524 0003435 262.6267 204.2868 15.54005638121106
"""
my_earthsat = EarthSatellite(*iss_tle0.splitlines())

tz_offset = -4

ts = load.timescale()
t = ts.utc(2018, 6, 21, tz_offset, 0, arange(24 * 60 * 60))
astrometrics = my_earthsat.at(t)

这段代码目前不是特别快,因为地球卫星计算尚未优化,但应该比在循环中手动构建多个时间对象更快。

关于python - Skyfield:在给定的时间间隔内以 1 秒的周期获得 sgp4 结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49494082/

相关文章:

python - 使光标无法在 Sprite pygame中移动

python - 如何通过按某个键盘键来关闭 tkinter 主循环

matlab - 为什么我得到 matlab 的 "lla2eci"和 "sgp4.propagate"之间的差异?

python - 随时间传播卫星目录的有效方法

python - 使用来自不同数据集的 for 循环进行绘图

python - python中被覆盖的变量会发生什么?

python - 为什么 scipy.optimize.minimize(默认)报告成功而不用 Skyfield 移动?

python - PyEphem:冬至和春分的日期及其在较长时间尺度上的有效性

python - 地球到木星距离与 Skyfield

python - 如何使用 skyfied 将 SGP4 TEME 坐标转换为 ECEF?