jplephem处理数据类型21的支持模块
spktype21的Python项目详细描述
spktype21
用于jplephem处理数据类型21的支持模块(版本0.1.0)
该模块从美国宇航局spice-spk星历核心文件(扩展修正差分阵列)中计算天体的位置和速度。见http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/req/spk.html
你可以从NASA/JPL的HORIZONS系统获得许多太阳系小天体的SPK文件见https://ssd.jpl.nasa.gov/?horizons
此模块读取数据类型为21的SPK文件,这是二进制SPK文件的类型之一截至2018年10月,HORIZONS系统默认将21类文件作为二进制SPK文件提供你可以通过telnet接口通过回答“spk文件格式”的“b”,得到21型天体二进制spk文件。也可以从以下位置获取类型21二进制SPK文件: https://ssd.jpl.nasa.gov/x/spk.html
所需模块
- jplephem(2.6版或更高版本)
- 努比
使用量
from spktype21 import SPKType21
kernel = SPKType21.open('path')
position, velocity = kernel.compute_type21(center, target, jd)
print(kernel) ---- this line prints information of all segments
kernel.close()
where:
path - path to the SPK file
center - SPKID of central body (0 for SSB, 10 for Sun, etc.)
target - SPKID of target body
jd - time for computation (Julian date)
position - a numpy array (x, y, z)
velocity - a numpy array (xd, yd, zd)