本文整理汇总了Python中poliastro.twobody.orbit.Orbit.from_sbdb方法的典型用法代码示例。如果您正苦于以下问题:Python Orbit.from_sbdb方法的具体用法?Python Orbit.from_sbdb怎么用?Python Orbit.from_sbdb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类poliastro.twobody.orbit.Orbit
的用法示例。
在下文中一共展示了Orbit.from_sbdb方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_from_sbdb_raise_valueerror
# 需要导入模块: from poliastro.twobody.orbit import Orbit [as 别名]
# 或者: from poliastro.twobody.orbit.Orbit import from_sbdb [as 别名]
def test_from_sbdb_raise_valueerror():
with pytest.raises(ValueError) as excinfo:
Orbit.from_sbdb(name="Halley")
assert (
str(excinfo.value)
== "2 different objects found: \n2688 Halley (1982 HG1)\n1P/Halley\n"
)
示例2: test_from_sbdb
# 需要导入模块: from poliastro.twobody.orbit import Orbit [as 别名]
# 或者: from poliastro.twobody.orbit.Orbit import from_sbdb [as 别名]
def test_from_sbdb():
# Dictionary with structure: 'Object': [a, e, i, raan, argp, nu, epoch]
# Notice JPL provides Mean anomaly, a conversion is needed to obtain nu
SBDB_DATA = {
"Ceres": (
2.769165146349478 * u.AU,
0.07600902762923671 * u.one,
10.59406732590292 * u.deg,
80.30553084093981 * u.deg,
73.59769486239257 * u.deg,
M_to_nu(77.37209773768207 * u.deg, 0.07600902762923671 * u.one),
)
}
for target_name in SBDB_DATA.keys():
ss_target = Orbit.from_sbdb(target_name)
ss_classical = ss_target.classical()
assert ss_classical == SBDB_DATA[target_name]