open-space-toolkit-astrodynamics 13.1.0__py313-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-13.1.0.dist-info/METADATA +30 -0
  2. open_space_toolkit_astrodynamics-13.1.0.dist-info/RECORD +100 -0
  3. open_space_toolkit_astrodynamics-13.1.0.dist-info/WHEEL +5 -0
  4. open_space_toolkit_astrodynamics-13.1.0.dist-info/top_level.txt +1 -0
  5. open_space_toolkit_astrodynamics-13.1.0.dist-info/zip-safe +1 -0
  6. ostk/__init__.py +1 -0
  7. ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-313-x86_64-linux-gnu.so +0 -0
  8. ostk/astrodynamics/__init__.py +11 -0
  9. ostk/astrodynamics/converters.py +130 -0
  10. ostk/astrodynamics/dataframe.py +479 -0
  11. ostk/astrodynamics/display.py +222 -0
  12. ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.13 +0 -0
  13. ostk/astrodynamics/pytrajectory/__init__.py +1 -0
  14. ostk/astrodynamics/pytrajectory/pystate.py +251 -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 +253 -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 +78 -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 +118 -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 +201 -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 +205 -0
  94. ostk/astrodynamics/test/trajectory/test_propagator.py +458 -0
  95. ostk/astrodynamics/test/trajectory/test_segment.py +403 -0
  96. ostk/astrodynamics/test/trajectory/test_sequence.py +530 -0
  97. ostk/astrodynamics/test/trajectory/test_state.py +543 -0
  98. ostk/astrodynamics/test/trajectory/test_state_builder.py +171 -0
  99. ostk/astrodynamics/utilities.py +247 -0
  100. ostk/astrodynamics/viewer.py +392 -0
@@ -0,0 +1,44 @@
1
+ # Dummy SpaceX OPM output
2
+
3
+ # Notes:
4
+ # - ECEF velocity is Earth relative
5
+ # - Apogee/Perigee altitude assumes a spherical Earth, 6378.137 km radius
6
+ # - Orbital elements are computed in an inertial frame realized by inertially
7
+ # freezing the WGS84 ECEF frame at time of current state
8
+ # - State is post-deployment, so includes separation delta-velocity
9
+
10
+
11
+ header:
12
+ generation_date: 2020-01-01T12:34:56.789Z
13
+ launch_date: 2020-01-02T12:34:56.789Z
14
+
15
+
16
+ deployments:
17
+
18
+ - name: satellite_a
19
+ sequence_number: 1
20
+ mission_time_s: 3600.0
21
+ date: 2020-01-02T13:34:56.789Z
22
+ r_ecef_m: [693289.644, 6876578.628, -133035.288]
23
+ v_ecef_m_per_s: [1305.783, 39.783, 7525.920]
24
+ mean_perigee_altitude_km: 526.768
25
+ mean_apogee_altitude_km: 568.430
26
+ mean_inclination_deg: 97.123
27
+ mean_argument_of_perigee_deg: -179.513
28
+ mean_longitude_ascending_node_deg: 85.057
29
+ mean_mean_anomaly_deg: 179.263
30
+ ballistic_coef_kg_per_m2: 47.55
31
+
32
+ - name: satellite_b
33
+ sequence_number: 2
34
+ mission_time_s: 7200.0
35
+ date: 2020-01-02T14:34:56.789Z
36
+ r_ecef_m: [699863.059, 6875647.517, -123777.595]
37
+ v_ecef_m_per_s: [1504.658, 6.705, 7538.669]
38
+ mean_perigee_altitude_km: 536.779
39
+ mean_apogee_altitude_km: 529.851
40
+ mean_inclination_deg: 97.124
41
+ mean_argument_of_perigee_deg: 136.875
42
+ mean_longitude_ascending_node_deg: 85.032
43
+ mean_mean_anomaly_deg: -127.164
44
+ ballistic_coef_kg_per_m2: 44.26
@@ -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,201 @@
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.environment.gravitational import Earth
9
+ from ostk.physics.environment.object.celestial import Sun
10
+ from ostk.physics import Environment
11
+
12
+ from ostk.astrodynamics.trajectory.orbit.model.kepler import COE
13
+
14
+
15
+ @pytest.fixture
16
+ def semi_major_axis() -> Length:
17
+ return Length.kilometers(7000.0)
18
+
19
+
20
+ @pytest.fixture
21
+ def eccentricity() -> float:
22
+ return 0.1
23
+
24
+
25
+ @pytest.fixture
26
+ def inclination() -> Angle:
27
+ return Angle.degrees(35.0)
28
+
29
+
30
+ @pytest.fixture
31
+ def raan() -> Angle:
32
+ return Angle.degrees(40.0)
33
+
34
+
35
+ @pytest.fixture
36
+ def aop() -> Angle:
37
+ return Angle.degrees(50.0)
38
+
39
+
40
+ @pytest.fixture
41
+ def true_anomaly() -> Angle:
42
+ return Angle.degrees(60.0)
43
+
44
+
45
+ @pytest.fixture
46
+ def coe(
47
+ semi_major_axis: Length,
48
+ eccentricity: float,
49
+ inclination: Angle,
50
+ raan: Angle,
51
+ aop: Angle,
52
+ true_anomaly: Angle,
53
+ ) -> COE:
54
+ return COE(semi_major_axis, eccentricity, inclination, raan, aop, true_anomaly)
55
+
56
+
57
+ class TestCOE:
58
+ def test_constructors(self):
59
+ a = Length.kilometers(7000.0)
60
+ e = 0.1
61
+ i = Angle.degrees(35.0)
62
+ raan = Angle.degrees(40.0)
63
+ aop = Angle.degrees(50.0)
64
+ nu = Angle.degrees(60.0)
65
+
66
+ coe: COE = COE(a, e, i, raan, aop, nu)
67
+
68
+ assert coe is not None
69
+ assert isinstance(coe, COE)
70
+ assert coe.is_defined()
71
+
72
+ coe: COE = COE.undefined()
73
+
74
+ assert coe is not None
75
+ assert isinstance(coe, COE)
76
+ assert coe.is_defined() is False
77
+
78
+ coe: COE = COE.frozen_orbit(
79
+ a,
80
+ Earth.EGM2008.equatorial_radius,
81
+ Earth.EGM2008.J2,
82
+ Earth.EGM2008.J3,
83
+ inclination=i,
84
+ )
85
+
86
+ assert coe is not None
87
+ assert isinstance(coe, COE)
88
+ assert coe.is_defined()
89
+
90
+ coe: COE = COE.frozen_orbit(
91
+ a, Environment.default().access_celestial_object_with_name("Earth")
92
+ )
93
+
94
+ assert coe is not None
95
+ assert isinstance(coe, COE)
96
+ assert coe.is_defined()
97
+
98
+ def test_comparators(
99
+ self,
100
+ coe: COE,
101
+ ):
102
+ assert coe == coe
103
+ assert (coe != coe) is False
104
+
105
+ def test_getters(
106
+ self,
107
+ coe: COE,
108
+ semi_major_axis: Length,
109
+ eccentricity: float,
110
+ inclination: Angle,
111
+ raan: Angle,
112
+ aop: Angle,
113
+ true_anomaly: Angle,
114
+ ):
115
+ assert coe.get_semi_major_axis() == semi_major_axis
116
+ assert coe.get_eccentricity() == eccentricity
117
+ assert coe.get_inclination() == inclination
118
+ assert coe.get_raan() == raan
119
+ assert coe.get_aop() == aop
120
+ assert coe.get_true_anomaly() == true_anomaly
121
+ assert coe.get_mean_anomaly() is not None
122
+ assert coe.get_eccentric_anomaly() is not None
123
+ assert coe.get_mean_motion(Earth.EGM2008.gravitational_parameter) is not None
124
+ assert coe.get_orbital_period(Earth.EGM2008.gravitational_parameter) is not None
125
+ assert coe.get_periapsis_radius() is not None
126
+ assert coe.get_apoapsis_radius() is not None
127
+ assert coe.get_semi_latus_rectum() is not None
128
+ assert coe.get_radial_distance() is not None
129
+ assert coe.get_angular_momentum(Earth.EGM2008.gravitational_parameter) is not None
130
+ assert coe.get_SI_vector(COE.AnomalyType.TrueAnomaly) is not None
131
+ assert coe.get_SI_vector(COE.AnomalyType.MeanAnomaly) is not None
132
+ assert coe.get_SI_vector(COE.AnomalyType.EccentricAnomaly) is not None
133
+
134
+ def test_anomaly_conversions(self):
135
+ assert (
136
+ COE.eccentric_anomaly_from_true_anomaly(Angle.degrees(0.0), 0.0) is not None
137
+ )
138
+ assert (
139
+ COE.true_anomaly_from_eccentric_anomaly(Angle.degrees(0.0), 0.0) is not None
140
+ )
141
+ assert (
142
+ COE.mean_anomaly_from_eccentric_anomaly(Angle.degrees(0.0), 0.0) is not None
143
+ )
144
+ assert (
145
+ COE.eccentric_anomaly_from_mean_anomaly(Angle.degrees(0.0), 0.0, 0.0)
146
+ is not None
147
+ )
148
+
149
+ def test_compute_methods(self):
150
+ semi_latus_rectum: float = COE.compute_semi_latus_rectum(7000.0e3, 0.0)
151
+ assert semi_latus_rectum is not None
152
+ assert (
153
+ COE.compute_angular_momentum(
154
+ 7000.0e3, 0.0, Earth.EGM2008.gravitational_parameter
155
+ )
156
+ is not None
157
+ )
158
+ assert (
159
+ COE.compute_angular_momentum(
160
+ semi_latus_rectum, Earth.EGM2008.gravitational_parameter
161
+ )
162
+ is not None
163
+ )
164
+ assert COE.compute_radial_distance(7000.0e3, 0.0, 0.0) is not None
165
+
166
+ assert COE.compute_ltan(Angle.degrees(270.0), Instant.J2000()) is not None
167
+ assert (
168
+ COE.compute_ltan(Angle.degrees(270.0), Instant.J2000(), Sun.default())
169
+ is not None
170
+ )
171
+ assert COE.compute_mean_ltan(Angle.degrees(270.0), Instant.J2000()) is not None
172
+ assert (
173
+ COE.compute_mean_ltan(Angle.degrees(270.0), Instant.J2000(), Sun.default())
174
+ is not None
175
+ )
176
+
177
+ def test_from_SI_vector(
178
+ self,
179
+ coe: COE,
180
+ semi_major_axis: Length,
181
+ eccentricity: float,
182
+ inclination: Angle,
183
+ raan: Angle,
184
+ aop: Angle,
185
+ true_anomaly: Angle,
186
+ ):
187
+ assert coe == COE.from_SI_vector(
188
+ [
189
+ semi_major_axis.in_meters(),
190
+ eccentricity,
191
+ inclination.in_radians(),
192
+ raan.in_radians(),
193
+ aop.in_radians(),
194
+ true_anomaly.in_radians(),
195
+ ],
196
+ COE.AnomalyType.TrueAnomaly,
197
+ )
198
+
199
+ def test_string_from_element(self):
200
+ element_str = COE.string_from_element(COE.Element.SemiMajorAxis)
201
+ assert element_str == "SemiMajorAxis"
@@ -0,0 +1 @@
1
+ # Apache License 2.0