本文整理匯總了Python中poliastro.twobody.orbit.Orbit.frozen方法的典型用法代碼示例。如果您正苦於以下問題:Python Orbit.frozen方法的具體用法?Python Orbit.frozen怎麽用?Python Orbit.frozen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類poliastro.twobody.orbit.Orbit
的用法示例。
在下文中一共展示了Orbit.frozen方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_frozen_orbit_altitude
# 需要導入模塊: from poliastro.twobody.orbit import Orbit [as 別名]
# 或者: from poliastro.twobody.orbit.Orbit import frozen [as 別名]
def test_frozen_orbit_altitude():
with pytest.raises(ValueError) as excinfo:
Orbit.frozen(Earth, -1 * u.m)
assert excinfo.type == ValueError
assert (
str(excinfo.value)
== "The semimajor axis may not be smaller that Earth's radius"
)
示例2: test_frozen_orbit_non_spherical_arguments
# 需要導入模塊: from poliastro.twobody.orbit import Orbit [as 別名]
# 或者: from poliastro.twobody.orbit.Orbit import frozen [as 別名]
def test_frozen_orbit_non_spherical_arguments():
with pytest.raises(AttributeError) as excinfo:
Orbit.frozen(Jupiter, 1 * u.m)
assert excinfo.type == AttributeError
assert (
str(excinfo.value)
== "Attractor Jupiter has not spherical harmonics implemented"
)
示例3: test_frozen_orbit_venus_special_case
# 需要導入模塊: from poliastro.twobody.orbit import Orbit [as 別名]
# 或者: from poliastro.twobody.orbit.Orbit import frozen [as 別名]
def test_frozen_orbit_venus_special_case():
with pytest.raises(NotImplementedError) as excinfo:
Orbit.frozen(Venus, 1 * u.m)
assert excinfo.type == NotImplementedError
assert str(excinfo.value) == "This has not been implemented for Venus"
示例4: test_frozen_orbit_non_critical_inclination
# 需要導入模塊: from poliastro.twobody.orbit import Orbit [as 別名]
# 或者: from poliastro.twobody.orbit.Orbit import frozen [as 別名]
def test_frozen_orbit_non_critical_inclination():
orbit = Orbit.frozen(Earth, 1e3 * u.km, inc=0 * u.deg) # Non-critical value
assert orbit.argp in [np.pi / 2, 3 * np.pi / 2] * u.rad
示例5: test_frozen_orbit_with_non_critical_argp
# 需要導入模塊: from poliastro.twobody.orbit import Orbit [as 別名]
# 或者: from poliastro.twobody.orbit.Orbit import frozen [as 別名]
def test_frozen_orbit_with_non_critical_argp(
attractor, alt, argp, expected_inc, ecc, expected_ecc
):
orbit = Orbit.frozen(attractor, alt, argp=argp, ecc=ecc) # Non-critical value
assert_allclose(orbit.inc, expected_inc)
assert_allclose(orbit.ecc, expected_ecc)
示例6: test_frozen_orbit_no_args
# 需要導入模塊: from poliastro.twobody.orbit import Orbit [as 別名]
# 或者: from poliastro.twobody.orbit.Orbit import frozen [as 別名]
def test_frozen_orbit_no_args(attractor, alt, expected_inc, expected_argp):
orbit = Orbit.frozen(attractor, alt)
argp = orbit.argp
inc = orbit.inc
assert_allclose(argp, expected_argp)
assert_allclose(inc, expected_inc)
示例7: test_frozen_orbit_with_critical_argp_and_critical_inc
# 需要導入模塊: from poliastro.twobody.orbit import Orbit [as 別名]
# 或者: from poliastro.twobody.orbit.Orbit import frozen [as 別名]
def test_frozen_orbit_with_critical_argp_and_critical_inc(
attractor, alt, inc, argp, expected_inc, expected_argp
):
orbit = Orbit.frozen(attractor, alt, inc=inc, argp=argp)
assert_allclose(orbit.argp, expected_argp)
assert_allclose(orbit.inc, expected_inc)
示例8: test_frozen_orbit_argp
# 需要導入模塊: from poliastro.twobody.orbit import Orbit [as 別名]
# 或者: from poliastro.twobody.orbit.Orbit import frozen [as 別名]
def test_frozen_orbit_argp(attractor, alt, argp, expected_argp, expected_inc):
orbit = Orbit.frozen(attractor, alt, argp=argp)
assert_allclose(orbit.argp, expected_argp)
assert_allclose(orbit.inc, expected_inc)