本文整理汇总了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)