open-space-toolkit-astrodynamics 12.0.1__py39-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.
Files changed (100) hide show
  1. open_space_toolkit_astrodynamics-12.0.1.dist-info/METADATA +30 -0
  2. open_space_toolkit_astrodynamics-12.0.1.dist-info/RECORD +100 -0
  3. open_space_toolkit_astrodynamics-12.0.1.dist-info/WHEEL +5 -0
  4. open_space_toolkit_astrodynamics-12.0.1.dist-info/top_level.txt +1 -0
  5. open_space_toolkit_astrodynamics-12.0.1.dist-info/zip-safe +1 -0
  6. ostk/__init__.py +1 -0
  7. ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-39-x86_64-linux-gnu.so +0 -0
  8. ostk/astrodynamics/__init__.py +11 -0
  9. ostk/astrodynamics/converters.py +128 -0
  10. ostk/astrodynamics/dataframe.py +477 -0
  11. ostk/astrodynamics/display.py +220 -0
  12. ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.12 +0 -0
  13. ostk/astrodynamics/pytrajectory/__init__.py +1 -0
  14. ostk/astrodynamics/pytrajectory/pystate.py +196 -0
  15. ostk/astrodynamics/test/__init__.py +1 -0
  16. ostk/astrodynamics/test/access/__init__.py +1 -0
  17. ostk/astrodynamics/test/access/test_generator.py +248 -0
  18. ostk/astrodynamics/test/conftest.py +119 -0
  19. ostk/astrodynamics/test/conjunction/message/ccsds/__init__.py +1 -0
  20. ostk/astrodynamics/test/conjunction/message/ccsds/conftest.py +325 -0
  21. ostk/astrodynamics/test/conjunction/message/ccsds/data/cdm.json +303 -0
  22. ostk/astrodynamics/test/conjunction/message/ccsds/test_cdm.py +416 -0
  23. ostk/astrodynamics/test/dynamics/__init__.py +1 -0
  24. ostk/astrodynamics/test/dynamics/data/Tabulated_Earth_Gravity.csv +565 -0
  25. ostk/astrodynamics/test/dynamics/data/Tabulated_Earth_Gravity_Truth.csv +100 -0
  26. ostk/astrodynamics/test/dynamics/test_atmospheric_drag.py +128 -0
  27. ostk/astrodynamics/test/dynamics/test_central_body_gravity.py +58 -0
  28. ostk/astrodynamics/test/dynamics/test_dynamics.py +50 -0
  29. ostk/astrodynamics/test/dynamics/test_position_derivative.py +51 -0
  30. ostk/astrodynamics/test/dynamics/test_tabulated.py +138 -0
  31. ostk/astrodynamics/test/dynamics/test_third_body_gravity.py +67 -0
  32. ostk/astrodynamics/test/dynamics/test_thruster.py +142 -0
  33. ostk/astrodynamics/test/event_condition/test_angular_condition.py +113 -0
  34. ostk/astrodynamics/test/event_condition/test_boolean_condition.py +55 -0
  35. ostk/astrodynamics/test/event_condition/test_coe_condition.py +87 -0
  36. ostk/astrodynamics/test/event_condition/test_instant_condition.py +48 -0
  37. ostk/astrodynamics/test/event_condition/test_logical_condition.py +120 -0
  38. ostk/astrodynamics/test/event_condition/test_real_condition.py +50 -0
  39. ostk/astrodynamics/test/flight/__init__.py +1 -0
  40. ostk/astrodynamics/test/flight/system/__init__.py +1 -0
  41. ostk/astrodynamics/test/flight/system/test_propulsion_system.py +73 -0
  42. ostk/astrodynamics/test/flight/system/test_satellite_system.py +91 -0
  43. ostk/astrodynamics/test/flight/system/test_satellite_system_builder.py +71 -0
  44. ostk/astrodynamics/test/flight/test_maneuver.py +212 -0
  45. ostk/astrodynamics/test/flight/test_profile.py +242 -0
  46. ostk/astrodynamics/test/flight/test_system.py +55 -0
  47. ostk/astrodynamics/test/guidance_law/test_constant_thrust.py +91 -0
  48. ostk/astrodynamics/test/guidance_law/test_qlaw.py +138 -0
  49. ostk/astrodynamics/test/solvers/__init__.py +1 -0
  50. ostk/astrodynamics/test/solvers/test_finite_difference_solver.py +181 -0
  51. ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +153 -0
  52. ostk/astrodynamics/test/test_access.py +128 -0
  53. ostk/astrodynamics/test/test_converters.py +290 -0
  54. ostk/astrodynamics/test/test_dataframe.py +875 -0
  55. ostk/astrodynamics/test/test_display.py +114 -0
  56. ostk/astrodynamics/test/test_event_condition.py +58 -0
  57. ostk/astrodynamics/test/test_import.py +26 -0
  58. ostk/astrodynamics/test/test_root_solver.py +70 -0
  59. ostk/astrodynamics/test/test_trajectory.py +40 -0
  60. ostk/astrodynamics/test/test_utilities.py +106 -0
  61. ostk/astrodynamics/test/test_viewer.py +129 -0
  62. ostk/astrodynamics/test/trajectory/__init__.py +1 -0
  63. ostk/astrodynamics/test/trajectory/orbit/__init__.py +1 -0
  64. ostk/astrodynamics/test/trajectory/orbit/message/__init__.py +1 -0
  65. ostk/astrodynamics/test/trajectory/orbit/message/spacex/__init__.py +1 -0
  66. ostk/astrodynamics/test/trajectory/orbit/message/spacex/conftest.py +18 -0
  67. ostk/astrodynamics/test/trajectory/orbit/message/spacex/data/opm_1.yaml +44 -0
  68. ostk/astrodynamics/test/trajectory/orbit/message/spacex/test_opm.py +108 -0
  69. ostk/astrodynamics/test/trajectory/orbit/models/__init__.py +1 -0
  70. ostk/astrodynamics/test/trajectory/orbit/models/kepler/__init__.py +1 -0
  71. ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean.py +65 -0
  72. ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean_long.py +102 -0
  73. ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean_short.py +102 -0
  74. ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +167 -0
  75. ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +1 -0
  76. ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +331 -0
  77. ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +130 -0
  78. ostk/astrodynamics/test/trajectory/orbit/models/test_propagated.py +234 -0
  79. ostk/astrodynamics/test/trajectory/orbit/models/test_sgp4.py +1 -0
  80. ostk/astrodynamics/test/trajectory/orbit/models/test_tabulated.py +380 -0
  81. ostk/astrodynamics/test/trajectory/orbit/test_model.py +1 -0
  82. ostk/astrodynamics/test/trajectory/orbit/test_pass.py +75 -0
  83. ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_angular_velocity.py +30 -0
  84. ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_attitude_quaternion.py +18 -0
  85. ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_position.py +107 -0
  86. ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_velocity.py +115 -0
  87. ostk/astrodynamics/test/trajectory/state/test_coordinate_broker.py +84 -0
  88. ostk/astrodynamics/test/trajectory/state/test_coordinate_subset.py +46 -0
  89. ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +314 -0
  90. ostk/astrodynamics/test/trajectory/test_local_orbital_frame_direction.py +81 -0
  91. ostk/astrodynamics/test/trajectory/test_local_orbital_frame_factory.py +108 -0
  92. ostk/astrodynamics/test/trajectory/test_model.py +1 -0
  93. ostk/astrodynamics/test/trajectory/test_orbit.py +196 -0
  94. ostk/astrodynamics/test/trajectory/test_propagator.py +458 -0
  95. ostk/astrodynamics/test/trajectory/test_segment.py +305 -0
  96. ostk/astrodynamics/test/trajectory/test_sequence.py +477 -0
  97. ostk/astrodynamics/test/trajectory/test_state.py +375 -0
  98. ostk/astrodynamics/test/trajectory/test_state_builder.py +171 -0
  99. ostk/astrodynamics/utilities.py +245 -0
  100. ostk/astrodynamics/viewer.py +392 -0
@@ -0,0 +1,108 @@
1
+ # Apache License 2.0
2
+
3
+ import pytest
4
+
5
+ from datetime import datetime
6
+
7
+ from ostk.core.container import Dictionary
8
+ from ostk.core.filesystem import Path
9
+ from ostk.core.filesystem import File
10
+
11
+ from ostk.physics.unit import Length
12
+ from ostk.physics.unit import Angle
13
+ from ostk.physics.time import Instant
14
+ from ostk.physics.time import Scale
15
+ from ostk.physics.time import Duration
16
+ from ostk.physics.coordinate import Position
17
+ from ostk.physics.coordinate import Velocity
18
+ from ostk.physics.coordinate import Frame
19
+
20
+ from ostk.astrodynamics.trajectory.orbit.message.spacex import OPM
21
+
22
+
23
+ @pytest.fixture
24
+ def opm() -> OPM:
25
+ return OPM(
26
+ header=OPM.Header(
27
+ generation_date=Instant.date_time(datetime(2020, 1, 2, 3, 4, 5), Scale.UTC),
28
+ launch_date=Instant.date_time(datetime(2020, 1, 3, 3, 4, 5), Scale.UTC),
29
+ ),
30
+ deployments=[
31
+ OPM.Deployment(
32
+ name="A",
33
+ sequence_number=1,
34
+ mission_time=Duration.hours(3600.0),
35
+ date=Instant.date_time(datetime(2020, 1, 4, 3, 4, 5), Scale.UTC),
36
+ position=Position.meters((1.0, 2.0, 3.0), Frame.ITRF()),
37
+ velocity=Velocity.meters_per_second((4.0, 5.0, 6.0), Frame.ITRF()),
38
+ mean_perigee_altitude=Length.kilometers(500.0),
39
+ mean_apogee_altitude=Length.kilometers(500.0),
40
+ mean_inclination=Angle.degrees(1.0),
41
+ mean_argument_of_perigee=Angle.degrees(2.0),
42
+ mean_longitude_ascending_node=Angle.degrees(3.0),
43
+ mean_mean_anomaly=Angle.degrees(4.0),
44
+ ballistic_coefficient=123.456,
45
+ ),
46
+ ],
47
+ )
48
+
49
+
50
+ class TestOPM:
51
+ def test_constructor(self, opm: OPM):
52
+ assert opm is not None
53
+
54
+ def test_get_header(self, opm: OPM):
55
+ assert opm.get_header() is not None
56
+
57
+ def test_get_deployments(self, opm: OPM):
58
+ assert len(opm.get_deployments()) == 1
59
+
60
+ def test_get_deployment_at(self, opm: OPM):
61
+ assert opm.get_deployment_at(index=0).name == "A"
62
+
63
+ def test_get_deployment_with_name(self, opm: OPM):
64
+ assert opm.get_deployment_with_name(name="A").name == "A"
65
+
66
+ def test_undefined(self):
67
+ assert OPM.undefined().is_defined() is False
68
+
69
+ def test_dictionary(self):
70
+ dictionary = Dictionary(
71
+ {
72
+ "header": {
73
+ "generation_date": "2020-01-01T12:34:56.789Z",
74
+ "launch_date": "2020-01-02T12:34:56.789Z",
75
+ },
76
+ "deployments": [
77
+ {
78
+ "name": "satellite_a",
79
+ "sequence_number": 1,
80
+ "mission_time_s": 3600.0,
81
+ "date": "2020-01-02T13:34:56.789Z",
82
+ "r_ecef_m": [693289.644, 6876578.628, -133035.288],
83
+ "v_ecef_m_per_s": [1305.783, 39.783, 7525.920],
84
+ "mean_perigee_altitude_km": 526.768,
85
+ "mean_apogee_altitude_km": 568.430,
86
+ "mean_inclination_deg": 97.123,
87
+ "mean_argument_of_perigee_deg": -179.513,
88
+ "mean_longitude_ascending_node_deg": 85.057,
89
+ "mean_mean_anomaly_deg": 179.263,
90
+ "ballistic_coef_kg_per_m2": 47.55,
91
+ }
92
+ ],
93
+ }
94
+ )
95
+
96
+ assert OPM.dictionary(dictionary) is not None
97
+
98
+ def test_parse(self, opm_file: File):
99
+ with open(str(opm_file.get_path().to_string()), "r") as stream:
100
+ assert OPM.parse(string=stream.read()) is not None
101
+
102
+ def test_load(self, opm_file: File):
103
+ assert OPM.load(file=opm_file) is not None
104
+
105
+
106
+ class TestOPMDeployment:
107
+ def test_to_state(self, opm: OPM):
108
+ assert opm.get_deployment_with_name(name="A").to_state() is not None
@@ -0,0 +1 @@
1
+ # Apache License 2.0
@@ -0,0 +1 @@
1
+ # Apache License 2.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,167 @@
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.astrodynamics.trajectory.orbit.model.kepler import COE
10
+
11
+
12
+ @pytest.fixture
13
+ def semi_major_axis() -> Length:
14
+ return Length.kilometers(7000.0)
15
+
16
+
17
+ @pytest.fixture
18
+ def eccentricity() -> float:
19
+ return 0.1
20
+
21
+
22
+ @pytest.fixture
23
+ def inclination() -> Angle:
24
+ return Angle.degrees(35.0)
25
+
26
+
27
+ @pytest.fixture
28
+ def raan() -> Angle:
29
+ return Angle.degrees(40.0)
30
+
31
+
32
+ @pytest.fixture
33
+ def aop() -> Angle:
34
+ return Angle.degrees(50.0)
35
+
36
+
37
+ @pytest.fixture
38
+ def true_anomaly() -> Angle:
39
+ return Angle.degrees(60.0)
40
+
41
+
42
+ @pytest.fixture
43
+ def coe(
44
+ semi_major_axis: Length,
45
+ eccentricity: float,
46
+ inclination: Angle,
47
+ raan: Angle,
48
+ aop: Angle,
49
+ true_anomaly: Angle,
50
+ ) -> COE:
51
+ return COE(semi_major_axis, eccentricity, inclination, raan, aop, true_anomaly)
52
+
53
+
54
+ class TestCOE:
55
+ def test_constructors(self):
56
+ a = Length.kilometers(7000.0)
57
+ e = 0.1
58
+ i = Angle.degrees(35.0)
59
+ raan = Angle.degrees(40.0)
60
+ aop = Angle.degrees(50.0)
61
+ nu = Angle.degrees(60.0)
62
+
63
+ coe: COE = COE(a, e, i, raan, aop, nu)
64
+
65
+ assert coe is not None
66
+ assert isinstance(coe, COE)
67
+ assert coe.is_defined()
68
+
69
+ coe: COE = COE.undefined()
70
+
71
+ assert coe is not None
72
+ assert isinstance(coe, COE)
73
+ assert coe.is_defined() is False
74
+
75
+ def test_comparators(
76
+ self,
77
+ coe: COE,
78
+ ):
79
+ assert coe == coe
80
+ assert (coe != coe) is False
81
+
82
+ def test_getters(
83
+ self,
84
+ coe: COE,
85
+ semi_major_axis: Length,
86
+ eccentricity: float,
87
+ inclination: Angle,
88
+ raan: Angle,
89
+ aop: Angle,
90
+ true_anomaly: Angle,
91
+ ):
92
+ assert coe.get_semi_major_axis() == semi_major_axis
93
+ assert coe.get_eccentricity() == eccentricity
94
+ assert coe.get_inclination() == inclination
95
+ assert coe.get_raan() == raan
96
+ assert coe.get_aop() == aop
97
+ assert coe.get_true_anomaly() == true_anomaly
98
+ assert coe.get_mean_anomaly() is not None
99
+ assert coe.get_eccentric_anomaly() is not None
100
+ assert coe.get_mean_motion(Earth.EGM2008.gravitational_parameter) is not None
101
+ assert coe.get_orbital_period(Earth.EGM2008.gravitational_parameter) is not None
102
+ assert coe.get_periapsis_radius() is not None
103
+ assert coe.get_apoapsis_radius() is not None
104
+ assert coe.get_semi_latus_rectum() is not None
105
+ assert coe.get_radial_distance() is not None
106
+ assert coe.get_angular_momentum(Earth.EGM2008.gravitational_parameter) is not None
107
+ assert coe.get_SI_vector(COE.AnomalyType.TrueAnomaly) is not None
108
+ assert coe.get_SI_vector(COE.AnomalyType.MeanAnomaly) is not None
109
+ assert coe.get_SI_vector(COE.AnomalyType.EccentricAnomaly) is not None
110
+
111
+ def test_anomaly_conversions(self):
112
+ assert (
113
+ COE.eccentric_anomaly_from_true_anomaly(Angle.degrees(0.0), 0.0) is not None
114
+ )
115
+ assert (
116
+ COE.true_anomaly_from_eccentric_anomaly(Angle.degrees(0.0), 0.0) is not None
117
+ )
118
+ assert (
119
+ COE.mean_anomaly_from_eccentric_anomaly(Angle.degrees(0.0), 0.0) is not None
120
+ )
121
+ assert (
122
+ COE.eccentric_anomaly_from_mean_anomaly(Angle.degrees(0.0), 0.0, 0.0)
123
+ is not None
124
+ )
125
+
126
+ def test_compute_methods(self):
127
+ semi_latus_rectum: float = COE.compute_semi_latus_rectum(7000.0e3, 0.0)
128
+ assert semi_latus_rectum is not None
129
+ assert (
130
+ COE.compute_angular_momentum(
131
+ 7000.0e3, 0.0, Earth.EGM2008.gravitational_parameter
132
+ )
133
+ is not None
134
+ )
135
+ assert (
136
+ COE.compute_angular_momentum(
137
+ semi_latus_rectum, Earth.EGM2008.gravitational_parameter
138
+ )
139
+ is not None
140
+ )
141
+ assert COE.compute_radial_distance(7000.0e3, 0.0, 0.0) is not None
142
+
143
+ def test_from_SI_vector(
144
+ self,
145
+ coe: COE,
146
+ semi_major_axis: Length,
147
+ eccentricity: float,
148
+ inclination: Angle,
149
+ raan: Angle,
150
+ aop: Angle,
151
+ true_anomaly: Angle,
152
+ ):
153
+ assert coe == COE.from_SI_vector(
154
+ [
155
+ semi_major_axis.in_meters(),
156
+ eccentricity,
157
+ inclination.in_radians(),
158
+ raan.in_radians(),
159
+ aop.in_radians(),
160
+ true_anomaly.in_radians(),
161
+ ],
162
+ COE.AnomalyType.TrueAnomaly,
163
+ )
164
+
165
+ def test_string_from_element(self):
166
+ element_str = COE.string_from_element(COE.Element.SemiMajorAxis)
167
+ assert element_str == "SemiMajorAxis"
@@ -0,0 +1 @@
1
+ # Apache License 2.0