python使用skyfiled进行轨道计算
2022/1/8 22:04:14
本文主要是介绍python使用skyfiled进行轨道计算,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
python 使用skyfield进行轨道计算
/*====安装 ======*/
pip install skyfield
依赖numpy,scipy, 建议安装anaconda
/*====使用======*/
计算火星在天空中的位置:
from skyfield.api import load # Create a timescale and ask the current time. ts = load.timescale() t = ts.now() # Load the JPL ephemeris DE421 (covers 1900-2050). planets = load('de421.bsp') earth, mars = planets['earth'], planets['mars'] # What's the position of Mars, viewed from Earth? astrometric = earth.at(t).observe(mars) ra, dec, distance = astrometric.radec() print(ra) print(dec) print(distance)
输出为:
10h 47m 56.24s +09deg 03' 23.1" 2.33251 au
/*====推荐======*/
相比较PyEphem 而言,skyfiled 全部由python编写,更容易发挥python的优势,在后续的版本升级和迭代支持优于PyEphem,毕竟PyEphem的官网也写了,如果是新研发的项目,建议使用skyfield。
参见Skyfield — documentationhttps://rhodesmill.org/skyfield/
这篇关于python使用skyfiled进行轨道计算的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-08有遇到过吗?同样的规则 Excel 中 比Python 结果大
- 2024-03-30开始python成长之路
- 2024-03-29python optparse
- 2024-03-29python map 函数
- 2024-03-20invalid format specifier python
- 2024-03-18pool.map python
- 2024-03-18threads in python
- 2024-03-14python Ai 应用开发基础训练,字符串,字典,文件
- 2024-03-13id3 algorithm python
- 2024-03-13sum array elements python