本文整理匯總了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]