open-space-toolkit-astrodynamics 17.2.0__py312-none-manylinux2014_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- open_space_toolkit_astrodynamics-17.2.0.dist-info/METADATA +30 -0
- open_space_toolkit_astrodynamics-17.2.0.dist-info/RECORD +151 -0
- open_space_toolkit_astrodynamics-17.2.0.dist-info/WHEEL +5 -0
- open_space_toolkit_astrodynamics-17.2.0.dist-info/top_level.txt +1 -0
- open_space_toolkit_astrodynamics-17.2.0.dist-info/zip-safe +1 -0
- ostk/__init__.py +1 -0
- ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-312-x86_64-linux-gnu.so +0 -0
- ostk/astrodynamics/__init__.py +11 -0
- ostk/astrodynamics/__init__.pyi +720 -0
- ostk/astrodynamics/access.pyi +577 -0
- ostk/astrodynamics/conjunction/__init__.pyi +121 -0
- ostk/astrodynamics/conjunction/close_approach.pyi +89 -0
- ostk/astrodynamics/conjunction/message/__init__.pyi +3 -0
- ostk/astrodynamics/conjunction/message/ccsds.pyi +705 -0
- ostk/astrodynamics/converters.py +130 -0
- ostk/astrodynamics/converters.pyi +58 -0
- ostk/astrodynamics/data/__init__.pyi +3 -0
- ostk/astrodynamics/data/provider.pyi +22 -0
- ostk/astrodynamics/dataframe.py +597 -0
- ostk/astrodynamics/display.py +281 -0
- ostk/astrodynamics/dynamics.pyi +311 -0
- ostk/astrodynamics/eclipse.pyi +70 -0
- ostk/astrodynamics/estimator.pyi +268 -0
- ostk/astrodynamics/event_condition.pyi +910 -0
- ostk/astrodynamics/flight/__init__.pyi +626 -0
- ostk/astrodynamics/flight/profile/__init__.pyi +99 -0
- ostk/astrodynamics/flight/profile/model.pyi +179 -0
- ostk/astrodynamics/flight/system.pyi +268 -0
- ostk/astrodynamics/guidance_law.pyi +416 -0
- ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.17 +0 -0
- ostk/astrodynamics/pytrajectory/__init__.py +1 -0
- ostk/astrodynamics/pytrajectory/__init__.pyi +3 -0
- ostk/astrodynamics/pytrajectory/pystate.py +263 -0
- ostk/astrodynamics/pytrajectory/pystate.pyi +66 -0
- ostk/astrodynamics/solver.pyi +432 -0
- ostk/astrodynamics/test/__init__.py +1 -0
- ostk/astrodynamics/test/access/__init__.py +1 -0
- ostk/astrodynamics/test/access/test_generator.py +319 -0
- ostk/astrodynamics/test/access/test_visibility_criterion.py +201 -0
- ostk/astrodynamics/test/conftest.py +119 -0
- ostk/astrodynamics/test/conjunction/close_approach/__init__.py +0 -0
- ostk/astrodynamics/test/conjunction/close_approach/test_generator.py +228 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/__init__.py +1 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/conftest.py +325 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/data/cdm.json +303 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/test_cdm.py +416 -0
- ostk/astrodynamics/test/conjunction/test_close_approach.py +244 -0
- ostk/astrodynamics/test/data/provider/test_off_nadir.py +58 -0
- ostk/astrodynamics/test/dynamics/__init__.py +1 -0
- ostk/astrodynamics/test/dynamics/data/Tabulated_Earth_Gravity.csv +565 -0
- ostk/astrodynamics/test/dynamics/data/Tabulated_Earth_Gravity_Truth.csv +100 -0
- ostk/astrodynamics/test/dynamics/test_atmospheric_drag.py +128 -0
- ostk/astrodynamics/test/dynamics/test_central_body_gravity.py +58 -0
- ostk/astrodynamics/test/dynamics/test_dynamics.py +50 -0
- ostk/astrodynamics/test/dynamics/test_position_derivative.py +51 -0
- ostk/astrodynamics/test/dynamics/test_tabulated.py +138 -0
- ostk/astrodynamics/test/dynamics/test_third_body_gravity.py +67 -0
- ostk/astrodynamics/test/dynamics/test_thruster.py +157 -0
- ostk/astrodynamics/test/eclipse/__init__.py +1 -0
- ostk/astrodynamics/test/eclipse/test_generator.py +138 -0
- ostk/astrodynamics/test/estimator/test_orbit_determination_solver.py +261 -0
- ostk/astrodynamics/test/estimator/test_tle_solver.py +216 -0
- ostk/astrodynamics/test/event_condition/test_angular_condition.py +113 -0
- ostk/astrodynamics/test/event_condition/test_boolean_condition.py +55 -0
- ostk/astrodynamics/test/event_condition/test_brouwer_lyddane_mean_long_condition.py +135 -0
- ostk/astrodynamics/test/event_condition/test_coe_condition.py +135 -0
- ostk/astrodynamics/test/event_condition/test_instant_condition.py +48 -0
- ostk/astrodynamics/test/event_condition/test_logical_condition.py +120 -0
- ostk/astrodynamics/test/event_condition/test_real_condition.py +50 -0
- ostk/astrodynamics/test/flight/__init__.py +1 -0
- ostk/astrodynamics/test/flight/profile/model/test_tabulated_profile.py +115 -0
- ostk/astrodynamics/test/flight/system/__init__.py +1 -0
- ostk/astrodynamics/test/flight/system/test_propulsion_system.py +64 -0
- ostk/astrodynamics/test/flight/system/test_satellite_system.py +83 -0
- ostk/astrodynamics/test/flight/system/test_satellite_system_builder.py +71 -0
- ostk/astrodynamics/test/flight/test_maneuver.py +231 -0
- ostk/astrodynamics/test/flight/test_profile.py +293 -0
- ostk/astrodynamics/test/flight/test_system.py +45 -0
- ostk/astrodynamics/test/guidance_law/test_constant_thrust.py +177 -0
- ostk/astrodynamics/test/guidance_law/test_guidance_law.py +60 -0
- ostk/astrodynamics/test/guidance_law/test_heterogeneous_guidance_law.py +164 -0
- ostk/astrodynamics/test/guidance_law/test_qlaw.py +209 -0
- ostk/astrodynamics/test/solvers/__init__.py +1 -0
- ostk/astrodynamics/test/solvers/test_finite_difference_solver.py +196 -0
- ostk/astrodynamics/test/solvers/test_least_squares_solver.py +334 -0
- ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +161 -0
- ostk/astrodynamics/test/test_access.py +128 -0
- ostk/astrodynamics/test/test_converters.py +290 -0
- ostk/astrodynamics/test/test_dataframe.py +1355 -0
- ostk/astrodynamics/test/test_display.py +184 -0
- ostk/astrodynamics/test/test_event_condition.py +80 -0
- ostk/astrodynamics/test/test_import.py +26 -0
- ostk/astrodynamics/test/test_root_solver.py +70 -0
- ostk/astrodynamics/test/test_trajectory.py +126 -0
- ostk/astrodynamics/test/test_utilities.py +338 -0
- ostk/astrodynamics/test/test_viewer.py +318 -0
- ostk/astrodynamics/test/trajectory/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/model/test_nadir_trajectory.py +87 -0
- ostk/astrodynamics/test/trajectory/model/test_tabulated_trajectory.py +303 -0
- ostk/astrodynamics/test/trajectory/model/test_target_scan_trajectory.py +126 -0
- ostk/astrodynamics/test/trajectory/orbit/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/message/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/conftest.py +18 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/data/opm_1.yaml +44 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/test_opm.py +108 -0
- ostk/astrodynamics/test/trajectory/orbit/models/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean.py +65 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean_long.py +102 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean_short.py +102 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +305 -0
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +337 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +130 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_modified_equinoctial.py +142 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_propagated.py +234 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_sgp4.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_tabulated.py +380 -0
- ostk/astrodynamics/test/trajectory/orbit/test_model.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/test_pass.py +75 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_angular_velocity.py +30 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_attitude_quaternion.py +18 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_acceleration.py +136 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_position.py +107 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_velocity.py +115 -0
- ostk/astrodynamics/test/trajectory/state/test_coordinate_broker.py +84 -0
- ostk/astrodynamics/test/trajectory/state/test_coordinate_subset.py +58 -0
- ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +316 -0
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_direction.py +81 -0
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_factory.py +119 -0
- ostk/astrodynamics/test/trajectory/test_model.py +1 -0
- ostk/astrodynamics/test/trajectory/test_orbit.py +212 -0
- ostk/astrodynamics/test/trajectory/test_propagator.py +452 -0
- ostk/astrodynamics/test/trajectory/test_segment.py +694 -0
- ostk/astrodynamics/test/trajectory/test_sequence.py +550 -0
- ostk/astrodynamics/test/trajectory/test_state.py +629 -0
- ostk/astrodynamics/test/trajectory/test_state_builder.py +172 -0
- ostk/astrodynamics/trajectory/__init__.pyi +1982 -0
- ostk/astrodynamics/trajectory/model.pyi +259 -0
- ostk/astrodynamics/trajectory/orbit/__init__.pyi +349 -0
- ostk/astrodynamics/trajectory/orbit/message/__init__.pyi +3 -0
- ostk/astrodynamics/trajectory/orbit/message/spacex.pyi +264 -0
- ostk/astrodynamics/trajectory/orbit/model/__init__.pyi +648 -0
- ostk/astrodynamics/trajectory/orbit/model/brouwerLyddaneMean.pyi +121 -0
- ostk/astrodynamics/trajectory/orbit/model/kepler.pyi +709 -0
- ostk/astrodynamics/trajectory/orbit/model/sgp4.pyi +330 -0
- ostk/astrodynamics/trajectory/state/__init__.pyi +402 -0
- ostk/astrodynamics/trajectory/state/coordinate_subset.pyi +208 -0
- ostk/astrodynamics/utilities.py +396 -0
- ostk/astrodynamics/viewer.py +851 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from ostk.physics.unit import Length
|
|
6
|
+
from ostk.physics.unit import Angle
|
|
7
|
+
|
|
8
|
+
from ostk.astrodynamics.trajectory.orbit.model import BrouwerLyddaneMean
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@pytest.fixture
|
|
12
|
+
def semi_major_axis() -> Length:
|
|
13
|
+
return Length.kilometers(7000.0)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@pytest.fixture
|
|
17
|
+
def eccentricity() -> float:
|
|
18
|
+
return 1e-3
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@pytest.fixture
|
|
22
|
+
def inclination() -> Angle:
|
|
23
|
+
return Angle.degrees(35.0)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@pytest.fixture
|
|
27
|
+
def raan() -> Angle:
|
|
28
|
+
return Angle.degrees(40.0)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@pytest.fixture
|
|
32
|
+
def aop() -> Angle:
|
|
33
|
+
return Angle.degrees(50.0)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@pytest.fixture
|
|
37
|
+
def mean_anomaly() -> Angle:
|
|
38
|
+
return Angle.degrees(60.0)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@pytest.fixture
|
|
42
|
+
def brouwer_lyddane_mean(
|
|
43
|
+
semi_major_axis, eccentricity, inclination, raan, aop, mean_anomaly
|
|
44
|
+
):
|
|
45
|
+
class BrouwerLyddaneMeanMock(BrouwerLyddaneMean):
|
|
46
|
+
def __init__(
|
|
47
|
+
self, semi_major_axis, eccentricity, inclination, raan, aop, mean_anomaly
|
|
48
|
+
):
|
|
49
|
+
super().__init__(
|
|
50
|
+
semi_major_axis, eccentricity, inclination, raan, aop, mean_anomaly
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
def to_coe():
|
|
54
|
+
return 0.0
|
|
55
|
+
|
|
56
|
+
return BrouwerLyddaneMeanMock(
|
|
57
|
+
semi_major_axis, eccentricity, inclination, raan, aop, mean_anomaly
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class TestBrouwerLyddaneMean:
|
|
62
|
+
def test_getters(self, brouwer_lyddane_mean: BrouwerLyddaneMean):
|
|
63
|
+
assert isinstance(brouwer_lyddane_mean.get_mean_anomaly(), Angle)
|
|
64
|
+
assert isinstance(brouwer_lyddane_mean.get_true_anomaly(), Angle)
|
|
65
|
+
assert isinstance(brouwer_lyddane_mean.get_eccentric_anomaly(), Angle)
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from ostk.physics.unit import Length
|
|
6
|
+
from ostk.physics.unit import Angle
|
|
7
|
+
from ostk.physics.environment.gravitational import Earth
|
|
8
|
+
|
|
9
|
+
from ostk.physics.coordinate import Frame
|
|
10
|
+
from ostk.physics.coordinate import Position
|
|
11
|
+
from ostk.physics.coordinate import Velocity
|
|
12
|
+
|
|
13
|
+
from ostk.astrodynamics.trajectory.orbit.model.kepler import COE
|
|
14
|
+
from ostk.astrodynamics.trajectory.orbit.model.brouwerLyddaneMean import (
|
|
15
|
+
BrouwerLyddaneMeanLong,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@pytest.fixture
|
|
20
|
+
def semi_major_axis() -> Length:
|
|
21
|
+
return Length.kilometers(7000.0)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@pytest.fixture
|
|
25
|
+
def eccentricity() -> float:
|
|
26
|
+
return 1e-3
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@pytest.fixture
|
|
30
|
+
def inclination() -> Angle:
|
|
31
|
+
return Angle.degrees(35.0)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@pytest.fixture
|
|
35
|
+
def raan() -> Angle:
|
|
36
|
+
return Angle.degrees(40.0)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@pytest.fixture
|
|
40
|
+
def aop() -> Angle:
|
|
41
|
+
return Angle.degrees(50.0)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@pytest.fixture
|
|
45
|
+
def mean_anomaly() -> Angle:
|
|
46
|
+
return Angle.degrees(60.0)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@pytest.fixture
|
|
50
|
+
def coe(
|
|
51
|
+
semi_major_axis: Length,
|
|
52
|
+
eccentricity: float,
|
|
53
|
+
inclination: Angle,
|
|
54
|
+
raan: Angle,
|
|
55
|
+
aop: Angle,
|
|
56
|
+
mean_anomaly: Angle,
|
|
57
|
+
) -> COE:
|
|
58
|
+
return COE(semi_major_axis, eccentricity, inclination, raan, aop, mean_anomaly)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@pytest.fixture
|
|
62
|
+
def cartesian_state() -> tuple[Position, Velocity]:
|
|
63
|
+
return (
|
|
64
|
+
Position.meters(
|
|
65
|
+
[6596407.223662058, 2281266.582975321, -10540.61521486086], Frame.GCRF()
|
|
66
|
+
),
|
|
67
|
+
Velocity.meters_per_second(
|
|
68
|
+
[337.7269674273224, -969.7192552349448, 7488.702816619139], Frame.GCRF()
|
|
69
|
+
),
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@pytest.fixture
|
|
74
|
+
def gravitational_parameter():
|
|
75
|
+
return Earth.EGM2008.gravitational_parameter
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@pytest.fixture
|
|
79
|
+
def brouwer_lyddane_mean_long(
|
|
80
|
+
semi_major_axis, eccentricity, inclination, raan, aop, mean_anomaly
|
|
81
|
+
):
|
|
82
|
+
return BrouwerLyddaneMeanLong(
|
|
83
|
+
semi_major_axis, eccentricity, inclination, raan, aop, mean_anomaly
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class TestBrouwerLyddaneMeanLong:
|
|
88
|
+
def test_to_coe(self, brouwer_lyddane_mean_long: BrouwerLyddaneMeanLong):
|
|
89
|
+
assert brouwer_lyddane_mean_long.to_coe().is_defined()
|
|
90
|
+
|
|
91
|
+
def test_coe(self, coe: COE):
|
|
92
|
+
assert BrouwerLyddaneMeanLong.COE(coe).is_defined()
|
|
93
|
+
|
|
94
|
+
def test_cartesian(
|
|
95
|
+
self, cartesian_state: tuple[Position, Velocity], gravitational_parameter
|
|
96
|
+
):
|
|
97
|
+
assert BrouwerLyddaneMeanLong.cartesian(
|
|
98
|
+
cartesian_state, gravitational_parameter
|
|
99
|
+
).is_defined()
|
|
100
|
+
|
|
101
|
+
def test_undefined(self):
|
|
102
|
+
assert BrouwerLyddaneMeanLong.undefined().is_defined() is False
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from ostk.physics.unit import Length
|
|
6
|
+
from ostk.physics.unit import Angle
|
|
7
|
+
from ostk.physics.environment.gravitational import Earth
|
|
8
|
+
|
|
9
|
+
from ostk.physics.coordinate import Frame
|
|
10
|
+
from ostk.physics.coordinate import Position
|
|
11
|
+
from ostk.physics.coordinate import Velocity
|
|
12
|
+
|
|
13
|
+
from ostk.astrodynamics.trajectory.orbit.model.kepler import COE
|
|
14
|
+
from ostk.astrodynamics.trajectory.orbit.model.brouwerLyddaneMean import (
|
|
15
|
+
BrouwerLyddaneMeanShort,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@pytest.fixture
|
|
20
|
+
def semi_major_axis() -> Length:
|
|
21
|
+
return Length.kilometers(7000.0)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@pytest.fixture
|
|
25
|
+
def eccentricity() -> float:
|
|
26
|
+
return 1e-3
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@pytest.fixture
|
|
30
|
+
def inclination() -> Angle:
|
|
31
|
+
return Angle.degrees(35.0)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@pytest.fixture
|
|
35
|
+
def raan() -> Angle:
|
|
36
|
+
return Angle.degrees(40.0)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@pytest.fixture
|
|
40
|
+
def aop() -> Angle:
|
|
41
|
+
return Angle.degrees(50.0)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@pytest.fixture
|
|
45
|
+
def mean_anomaly() -> Angle:
|
|
46
|
+
return Angle.degrees(60.0)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@pytest.fixture
|
|
50
|
+
def coe(
|
|
51
|
+
semi_major_axis: Length,
|
|
52
|
+
eccentricity: float,
|
|
53
|
+
inclination: Angle,
|
|
54
|
+
raan: Angle,
|
|
55
|
+
aop: Angle,
|
|
56
|
+
mean_anomaly: Angle,
|
|
57
|
+
) -> COE:
|
|
58
|
+
return COE(semi_major_axis, eccentricity, inclination, raan, aop, mean_anomaly)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@pytest.fixture
|
|
62
|
+
def cartesian_state() -> tuple[Position, Velocity]:
|
|
63
|
+
return (
|
|
64
|
+
Position.meters(
|
|
65
|
+
[6596407.223662058, 2281266.582975321, -10540.61521486086], Frame.GCRF()
|
|
66
|
+
),
|
|
67
|
+
Velocity.meters_per_second(
|
|
68
|
+
[337.7269674273224, -969.7192552349448, 7488.702816619139], Frame.GCRF()
|
|
69
|
+
),
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@pytest.fixture
|
|
74
|
+
def gravitational_parameter():
|
|
75
|
+
return Earth.EGM2008.gravitational_parameter
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@pytest.fixture
|
|
79
|
+
def brouwer_lyddane_mean_short(
|
|
80
|
+
semi_major_axis, eccentricity, inclination, raan, aop, mean_anomaly
|
|
81
|
+
):
|
|
82
|
+
return BrouwerLyddaneMeanShort(
|
|
83
|
+
semi_major_axis, eccentricity, inclination, raan, aop, mean_anomaly
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class TestBrouwerLyddaneMeanShort:
|
|
88
|
+
def test_to_coe(self, brouwer_lyddane_mean_short: BrouwerLyddaneMeanShort):
|
|
89
|
+
assert brouwer_lyddane_mean_short.to_coe().is_defined()
|
|
90
|
+
|
|
91
|
+
def test_coe(self, coe: COE) -> COE:
|
|
92
|
+
assert BrouwerLyddaneMeanShort.COE(coe).is_defined()
|
|
93
|
+
|
|
94
|
+
def test_cartesian(
|
|
95
|
+
self, cartesian_state: tuple[Position, Velocity], gravitational_parameter
|
|
96
|
+
):
|
|
97
|
+
assert BrouwerLyddaneMeanShort.cartesian(
|
|
98
|
+
cartesian_state, gravitational_parameter
|
|
99
|
+
).is_defined()
|
|
100
|
+
|
|
101
|
+
def test_undefined(self):
|
|
102
|
+
assert BrouwerLyddaneMeanShort.undefined().is_defined() is False
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from ostk.physics.unit import Length
|
|
6
|
+
from ostk.physics.unit import Angle
|
|
7
|
+
from ostk.physics.time import Instant
|
|
8
|
+
from ostk.physics.time import Time
|
|
9
|
+
from ostk.physics.environment.gravitational import Earth
|
|
10
|
+
from ostk.physics.environment.object.celestial import Sun
|
|
11
|
+
from ostk.physics.environment.object import Celestial
|
|
12
|
+
from ostk.physics import Environment
|
|
13
|
+
|
|
14
|
+
from ostk.astrodynamics.trajectory.orbit.model.kepler import COE
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@pytest.fixture
|
|
18
|
+
def semi_major_axis() -> Length:
|
|
19
|
+
return Length.kilometers(7000.0)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@pytest.fixture
|
|
23
|
+
def eccentricity() -> float:
|
|
24
|
+
return 0.1
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@pytest.fixture
|
|
28
|
+
def inclination() -> Angle:
|
|
29
|
+
return Angle.degrees(35.0)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@pytest.fixture
|
|
33
|
+
def raan() -> Angle:
|
|
34
|
+
return Angle.degrees(40.0)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@pytest.fixture
|
|
38
|
+
def aop() -> Angle:
|
|
39
|
+
return Angle.degrees(50.0)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@pytest.fixture
|
|
43
|
+
def true_anomaly() -> Angle:
|
|
44
|
+
return Angle.degrees(60.0)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@pytest.fixture
|
|
48
|
+
def coe(
|
|
49
|
+
semi_major_axis: Length,
|
|
50
|
+
eccentricity: float,
|
|
51
|
+
inclination: Angle,
|
|
52
|
+
raan: Angle,
|
|
53
|
+
aop: Angle,
|
|
54
|
+
true_anomaly: Angle,
|
|
55
|
+
) -> COE:
|
|
56
|
+
return COE(semi_major_axis, eccentricity, inclination, raan, aop, true_anomaly)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@pytest.fixture
|
|
60
|
+
def environment() -> Environment:
|
|
61
|
+
return Environment.default()
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@pytest.fixture
|
|
65
|
+
def earth(environment: Environment) -> Celestial:
|
|
66
|
+
return environment.access_celestial_object_with_name("Earth")
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class TestCOE:
|
|
70
|
+
def test_constructors(
|
|
71
|
+
self,
|
|
72
|
+
semi_major_axis: Length,
|
|
73
|
+
eccentricity: float,
|
|
74
|
+
inclination: Angle,
|
|
75
|
+
raan: Angle,
|
|
76
|
+
aop: Angle,
|
|
77
|
+
true_anomaly: Angle,
|
|
78
|
+
):
|
|
79
|
+
coe: COE = COE(
|
|
80
|
+
semi_major_axis,
|
|
81
|
+
eccentricity,
|
|
82
|
+
inclination,
|
|
83
|
+
raan,
|
|
84
|
+
aop,
|
|
85
|
+
true_anomaly,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
assert coe is not None
|
|
89
|
+
assert isinstance(coe, COE)
|
|
90
|
+
assert coe.is_defined()
|
|
91
|
+
|
|
92
|
+
def test_comparators(
|
|
93
|
+
self,
|
|
94
|
+
coe: COE,
|
|
95
|
+
):
|
|
96
|
+
assert coe == coe
|
|
97
|
+
assert (coe != coe) is False
|
|
98
|
+
|
|
99
|
+
def test_getters(
|
|
100
|
+
self,
|
|
101
|
+
coe: COE,
|
|
102
|
+
semi_major_axis: Length,
|
|
103
|
+
eccentricity: float,
|
|
104
|
+
inclination: Angle,
|
|
105
|
+
raan: Angle,
|
|
106
|
+
aop: Angle,
|
|
107
|
+
true_anomaly: Angle,
|
|
108
|
+
):
|
|
109
|
+
assert coe.get_semi_major_axis() == semi_major_axis
|
|
110
|
+
assert coe.get_eccentricity() == eccentricity
|
|
111
|
+
assert coe.get_inclination() == inclination
|
|
112
|
+
assert coe.get_raan() == raan
|
|
113
|
+
assert coe.get_aop() == aop
|
|
114
|
+
assert coe.get_true_anomaly() == true_anomaly
|
|
115
|
+
assert coe.get_argument_of_latitude() == aop + true_anomaly
|
|
116
|
+
assert coe.get_mean_anomaly() is not None
|
|
117
|
+
assert coe.get_eccentric_anomaly() is not None
|
|
118
|
+
assert coe.get_mean_motion(Earth.EGM2008.gravitational_parameter) is not None
|
|
119
|
+
assert coe.get_orbital_period(Earth.EGM2008.gravitational_parameter) is not None
|
|
120
|
+
assert coe.get_periapsis_radius() is not None
|
|
121
|
+
assert coe.get_apoapsis_radius() is not None
|
|
122
|
+
assert coe.get_semi_latus_rectum() is not None
|
|
123
|
+
assert coe.get_radial_distance() is not None
|
|
124
|
+
assert coe.get_angular_momentum(Earth.EGM2008.gravitational_parameter) is not None
|
|
125
|
+
assert coe.get_SI_vector(COE.AnomalyType.TrueAnomaly) is not None
|
|
126
|
+
assert coe.get_SI_vector(COE.AnomalyType.MeanAnomaly) is not None
|
|
127
|
+
assert coe.get_SI_vector(COE.AnomalyType.EccentricAnomaly) is not None
|
|
128
|
+
|
|
129
|
+
def test_anomaly_conversions(self):
|
|
130
|
+
assert (
|
|
131
|
+
COE.eccentric_anomaly_from_true_anomaly(Angle.degrees(0.0), 0.0) is not None
|
|
132
|
+
)
|
|
133
|
+
assert (
|
|
134
|
+
COE.true_anomaly_from_eccentric_anomaly(Angle.degrees(0.0), 0.0) is not None
|
|
135
|
+
)
|
|
136
|
+
assert (
|
|
137
|
+
COE.mean_anomaly_from_eccentric_anomaly(Angle.degrees(0.0), 0.0) is not None
|
|
138
|
+
)
|
|
139
|
+
assert (
|
|
140
|
+
COE.eccentric_anomaly_from_mean_anomaly(Angle.degrees(0.0), 0.0, 0.0)
|
|
141
|
+
is not None
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
def test_compute_methods(self, earth: Celestial):
|
|
145
|
+
semi_latus_rectum: float = COE.compute_semi_latus_rectum(7000.0e3, 0.0)
|
|
146
|
+
assert semi_latus_rectum is not None
|
|
147
|
+
assert (
|
|
148
|
+
COE.compute_angular_momentum(
|
|
149
|
+
7000.0e3, 0.0, Earth.EGM2008.gravitational_parameter
|
|
150
|
+
)
|
|
151
|
+
is not None
|
|
152
|
+
)
|
|
153
|
+
assert (
|
|
154
|
+
COE.compute_angular_momentum(
|
|
155
|
+
semi_latus_rectum, Earth.EGM2008.gravitational_parameter
|
|
156
|
+
)
|
|
157
|
+
is not None
|
|
158
|
+
)
|
|
159
|
+
assert COE.compute_radial_distance(7000.0e3, 0.0, 0.0) is not None
|
|
160
|
+
|
|
161
|
+
assert COE.compute_ltan(Angle.degrees(270.0), Instant.J2000()) is not None
|
|
162
|
+
assert (
|
|
163
|
+
COE.compute_ltan(Angle.degrees(270.0), Instant.J2000(), Sun.default())
|
|
164
|
+
is not None
|
|
165
|
+
)
|
|
166
|
+
assert COE.compute_mean_ltan(Angle.degrees(270.0), Instant.J2000()) is not None
|
|
167
|
+
assert (
|
|
168
|
+
COE.compute_mean_ltan(Angle.degrees(270.0), Instant.J2000(), Sun.default())
|
|
169
|
+
is not None
|
|
170
|
+
)
|
|
171
|
+
assert COE.compute_ltdn(Angle.degrees(270.0), Instant.J2000()) is not None
|
|
172
|
+
assert (
|
|
173
|
+
COE.compute_ltdn(Angle.degrees(270.0), Instant.J2000(), Sun.default())
|
|
174
|
+
is not None
|
|
175
|
+
)
|
|
176
|
+
assert COE.compute_mean_ltdn(Angle.degrees(270.0), Instant.J2000()) is not None
|
|
177
|
+
assert (
|
|
178
|
+
COE.compute_mean_ltdn(Angle.degrees(270.0), Instant.J2000(), Sun.default())
|
|
179
|
+
is not None
|
|
180
|
+
)
|
|
181
|
+
assert (
|
|
182
|
+
COE.compute_sun_synchronous_inclination(Length.meters(7130982.0), 0.0, earth)
|
|
183
|
+
is not None
|
|
184
|
+
)
|
|
185
|
+
assert (
|
|
186
|
+
COE.compute_raan_from_ltan(Time.parse("12:00:00"), Instant.J2000(), earth)
|
|
187
|
+
is not None
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
def test_from_SI_vector(
|
|
191
|
+
self,
|
|
192
|
+
coe: COE,
|
|
193
|
+
semi_major_axis: Length,
|
|
194
|
+
eccentricity: float,
|
|
195
|
+
inclination: Angle,
|
|
196
|
+
raan: Angle,
|
|
197
|
+
aop: Angle,
|
|
198
|
+
true_anomaly: Angle,
|
|
199
|
+
):
|
|
200
|
+
assert coe == COE.from_SI_vector(
|
|
201
|
+
[
|
|
202
|
+
semi_major_axis.in_meters(),
|
|
203
|
+
eccentricity,
|
|
204
|
+
inclination.in_radians(),
|
|
205
|
+
raan.in_radians(),
|
|
206
|
+
aop.in_radians(),
|
|
207
|
+
true_anomaly.in_radians(),
|
|
208
|
+
],
|
|
209
|
+
COE.AnomalyType.TrueAnomaly,
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
def test_string_from_element(self):
|
|
213
|
+
element_str = COE.string_from_element(COE.Element.SemiMajorAxis)
|
|
214
|
+
assert element_str == "SemiMajorAxis"
|
|
215
|
+
|
|
216
|
+
def test_sun_synchronous(self, earth: Celestial):
|
|
217
|
+
semi_major_axis: Length = Length.meters(7130982.0)
|
|
218
|
+
local_time_at_ascending_node: Time = Time.parse("12:00:00")
|
|
219
|
+
epoch: Instant = Instant.J2000()
|
|
220
|
+
eccentricity: float = 0.0
|
|
221
|
+
argument_of_latitude: Angle = Angle.degrees(30.0)
|
|
222
|
+
|
|
223
|
+
assert (
|
|
224
|
+
COE.sun_synchronous(
|
|
225
|
+
semi_major_axis,
|
|
226
|
+
local_time_at_ascending_node,
|
|
227
|
+
epoch,
|
|
228
|
+
earth,
|
|
229
|
+
eccentricity,
|
|
230
|
+
argument_of_latitude,
|
|
231
|
+
)
|
|
232
|
+
is not None
|
|
233
|
+
)
|
|
234
|
+
assert (
|
|
235
|
+
COE.sun_synchronous(
|
|
236
|
+
semi_major_axis, local_time_at_ascending_node, epoch, earth, eccentricity
|
|
237
|
+
)
|
|
238
|
+
is not None
|
|
239
|
+
)
|
|
240
|
+
assert (
|
|
241
|
+
COE.sun_synchronous(
|
|
242
|
+
semi_major_axis, local_time_at_ascending_node, epoch, earth
|
|
243
|
+
)
|
|
244
|
+
is not None
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
def test_geo_synchronous(self, earth: Celestial):
|
|
248
|
+
epoch: Instant = Instant.J2000()
|
|
249
|
+
inclination: Angle = Angle.degrees(0.01)
|
|
250
|
+
longitude: Angle = Angle.degrees(0.0)
|
|
251
|
+
|
|
252
|
+
assert COE.geo_synchronous(epoch, inclination, longitude, earth) is not None
|
|
253
|
+
|
|
254
|
+
def test_circular(self):
|
|
255
|
+
semi_major_axis: Length = Length.kilometers(7000.0)
|
|
256
|
+
inclination: Angle = Angle.degrees(45.0)
|
|
257
|
+
argument_of_latitude: Angle = Angle.degrees(30.0)
|
|
258
|
+
|
|
259
|
+
assert (
|
|
260
|
+
COE.circular(semi_major_axis, inclination, argument_of_latitude) is not None
|
|
261
|
+
)
|
|
262
|
+
assert COE.circular(semi_major_axis, inclination) is not None
|
|
263
|
+
assert COE.circular(semi_major_axis) is not None
|
|
264
|
+
|
|
265
|
+
def test_equatorial(self):
|
|
266
|
+
semi_major_axis: Length = Length.kilometers(7000.0)
|
|
267
|
+
eccentricity: float = 0.1
|
|
268
|
+
true_anomaly: Angle = Angle.degrees(45.0)
|
|
269
|
+
|
|
270
|
+
assert COE.equatorial(semi_major_axis, eccentricity, true_anomaly) is not None
|
|
271
|
+
assert COE.equatorial(semi_major_axis, eccentricity) is not None
|
|
272
|
+
assert COE.equatorial(semi_major_axis) is not None
|
|
273
|
+
|
|
274
|
+
def test_undefined(self):
|
|
275
|
+
coe: COE = COE.undefined()
|
|
276
|
+
|
|
277
|
+
assert coe is not None
|
|
278
|
+
assert isinstance(coe, COE)
|
|
279
|
+
assert coe.is_defined() is False
|
|
280
|
+
|
|
281
|
+
def test_frozen_orbit(
|
|
282
|
+
self,
|
|
283
|
+
semi_major_axis: Length,
|
|
284
|
+
inclination: Angle,
|
|
285
|
+
):
|
|
286
|
+
coe: COE = COE.frozen_orbit(
|
|
287
|
+
semi_major_axis,
|
|
288
|
+
Earth.EGM2008.equatorial_radius,
|
|
289
|
+
Earth.EGM2008.J2,
|
|
290
|
+
Earth.EGM2008.J3,
|
|
291
|
+
inclination=inclination,
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
assert coe is not None
|
|
295
|
+
assert isinstance(coe, COE)
|
|
296
|
+
assert coe.is_defined()
|
|
297
|
+
|
|
298
|
+
coe: COE = COE.frozen_orbit(
|
|
299
|
+
semi_major_axis,
|
|
300
|
+
Environment.default().access_celestial_object_with_name("Earth"),
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
assert coe is not None
|
|
304
|
+
assert isinstance(coe, COE)
|
|
305
|
+
assert coe.is_defined()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Apache License 2.0
|