本文整理匯總了Python中poliastro.twobody.orbit.Orbit.from_horizons方法的典型用法代碼示例。如果您正苦於以下問題:Python Orbit.from_horizons方法的具體用法?Python Orbit.from_horizons怎麽用?Python Orbit.from_horizons使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類poliastro.twobody.orbit.Orbit
的用法示例。
在下文中一共展示了Orbit.from_horizons方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_from_horizons_raise_valueerror
# 需要導入模塊: from poliastro.twobody.orbit import Orbit [as 別名]
# 或者: from poliastro.twobody.orbit.Orbit import from_horizons [as 別名]
def test_from_horizons_raise_valueerror():
with pytest.raises(ValueError) as exep:
Orbit.from_horizons(name="Dummy")
assert (
"ValueError: Unknown target (Dummy). Maybe try different id_type?"
in exep.exconly()
)
示例2: test_orbits_are_same
# 需要導入模塊: from poliastro.twobody.orbit import Orbit [as 別名]
# 或者: from poliastro.twobody.orbit.Orbit import from_horizons [as 別名]
def test_orbits_are_same():
epoch = Time("2018-07-23")
# Orbit Parameters of Ceres
# Taken from https://ssd.jpl.nasa.gov/horizons.cgi
ss = Orbit.from_classical(
Sun,
2.767107584017257 * u.au,
0.07554802949294502 * u.one,
27.18502520750381 * u.deg,
23.36913256044832 * u.deg,
132.2919806192451 * u.deg,
21.28958091587153 * u.deg,
epoch,
)
ss1 = Orbit.from_horizons(name="Ceres", epoch=epoch)
assert ss.pqw()[0].value.all() == ss1.pqw()[0].value.all()
assert ss.r_a == ss1.r_a
assert ss.a == ss1.a
示例3: test_plane_is_set_in_horizons
# 需要導入模塊: from poliastro.twobody.orbit import Orbit [as 別名]
# 或者: from poliastro.twobody.orbit.Orbit import from_horizons [as 別名]
def test_plane_is_set_in_horizons():
plane = Planes.EARTH_ECLIPTIC
ss = Orbit.from_horizons(name="Ceres", plane=plane)
assert ss.plane == plane