open-space-toolkit-astrodynamics 1.2.1__py310-none-any.whl → 4.2.0__py310-none-any.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-1.2.1.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/METADATA +2 -2
- open_space_toolkit_astrodynamics-4.2.0.dist-info/RECORD +25 -0
- ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-310-x86_64-linux-gnu.so +0 -0
- ostk/astrodynamics/__init__.py +6 -0
- ostk/astrodynamics/{libopen-space-toolkit-astrodynamics.so.1 → libopen-space-toolkit-astrodynamics.so.4} +0 -0
- ostk/astrodynamics/pytrajectory/pystate.py +36 -0
- ostk/astrodynamics/test/test_access.py +2 -6
- ostk/astrodynamics/test/test_converters.py +1 -3
- ostk/astrodynamics/test/test_event_condition.py +24 -41
- ostk/astrodynamics/test/test_import.py +3 -3
- ostk/astrodynamics/test/test_viewer.py +1 -2
- ostk/astrodynamics/viewer.py +1 -1
- open_space_toolkit_astrodynamics-1.2.1.dist-info/RECORD +0 -72
- ostk/astrodynamics/test/access/__init__.py +0 -1
- ostk/astrodynamics/test/access/test_generator.py +0 -248
- ostk/astrodynamics/test/conjunction/messages/ccsds/__init__.py +0 -1
- ostk/astrodynamics/test/conjunction/messages/ccsds/conftest.py +0 -325
- ostk/astrodynamics/test/conjunction/messages/ccsds/data/cdm.json +0 -303
- ostk/astrodynamics/test/conjunction/messages/ccsds/test_cdm.py +0 -418
- ostk/astrodynamics/test/event_condition/test_coe_condition.py +0 -95
- ostk/astrodynamics/test/event_condition/test_conjunctive.py +0 -64
- ostk/astrodynamics/test/event_condition/test_disjunctive.py +0 -63
- ostk/astrodynamics/test/event_condition/test_duration_condition.py +0 -36
- ostk/astrodynamics/test/event_condition/test_logical_connective.py +0 -37
- ostk/astrodynamics/test/flight/__init__.py +0 -1
- ostk/astrodynamics/test/flight/profile/__init__.py +0 -1
- ostk/astrodynamics/test/flight/profile/test_state.py +0 -144
- ostk/astrodynamics/test/flight/system/__init__.py +0 -1
- ostk/astrodynamics/test/flight/system/dynamics/__init__.py +0 -1
- ostk/astrodynamics/test/flight/system/dynamics/test_atmospheric_drag.py +0 -86
- ostk/astrodynamics/test/flight/system/dynamics/test_central_body_gravity.py +0 -57
- ostk/astrodynamics/test/flight/system/dynamics/test_position_derivative.py +0 -49
- ostk/astrodynamics/test/flight/system/dynamics/test_third_body_gravity.py +0 -65
- ostk/astrodynamics/test/flight/system/test_satellite_system.py +0 -77
- ostk/astrodynamics/test/flight/test_profile.py +0 -147
- ostk/astrodynamics/test/flight/test_system.py +0 -55
- ostk/astrodynamics/test/solvers/__init__.py +0 -1
- ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +0 -153
- ostk/astrodynamics/test/test_numerical_solver.py +0 -248
- ostk/astrodynamics/test/trajectory/__init__.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/__init__.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/messages/__init__.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/messages/spacex/__init__.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/messages/spacex/conftest.py +0 -18
- ostk/astrodynamics/test/trajectory/orbit/messages/spacex/data/opm_1.yaml +0 -44
- ostk/astrodynamics/test/trajectory/orbit/messages/spacex/test_opm.py +0 -108
- ostk/astrodynamics/test/trajectory/orbit/models/__init__.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/__init__.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +0 -108
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +0 -332
- ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +0 -130
- ostk/astrodynamics/test/trajectory/orbit/models/test_propagated.py +0 -197
- ostk/astrodynamics/test/trajectory/orbit/models/test_sgp4.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/models/test_tabulated.py +0 -383
- ostk/astrodynamics/test/trajectory/orbit/test_model.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/test_pass.py +0 -55
- ostk/astrodynamics/test/trajectory/test_model.py +0 -1
- ostk/astrodynamics/test/trajectory/test_orbit.py +0 -92
- ostk/astrodynamics/test/trajectory/test_propagator.py +0 -233
- ostk/astrodynamics/test/trajectory/test_state.py +0 -70
- {open_space_toolkit_astrodynamics-1.2.1.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/WHEEL +0 -0
- {open_space_toolkit_astrodynamics-1.2.1.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/top_level.txt +0 -0
- {open_space_toolkit_astrodynamics-1.2.1.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/zip-safe +0 -0
- /ostk/{__init__.py → astrodynamics/pytrajectory/__init__.py} +0 -0
@@ -1,108 +0,0 @@
|
|
1
|
-
# Apache License 2.0
|
2
|
-
|
3
|
-
from ostk.physics.units import Length
|
4
|
-
from ostk.physics.units import Angle
|
5
|
-
from ostk.physics.environment.gravitational import Earth
|
6
|
-
|
7
|
-
from ostk.astrodynamics.trajectory.orbit.models.kepler import COE
|
8
|
-
|
9
|
-
|
10
|
-
def construct_coe():
|
11
|
-
a = Length.kilometers(7000.0)
|
12
|
-
e = 0.1
|
13
|
-
i = Angle.degrees(35.0)
|
14
|
-
raan = Angle.degrees(40.0)
|
15
|
-
aop = Angle.degrees(50.0)
|
16
|
-
nu = Angle.degrees(60.0)
|
17
|
-
|
18
|
-
coe = COE(a, e, i, raan, aop, nu)
|
19
|
-
|
20
|
-
return coe
|
21
|
-
|
22
|
-
|
23
|
-
def test_trajectory_orbit_models_kepler_coe_constructors():
|
24
|
-
a = Length.kilometers(7000.0)
|
25
|
-
e = 0.1
|
26
|
-
i = Angle.degrees(35.0)
|
27
|
-
raan = Angle.degrees(40.0)
|
28
|
-
aop = Angle.degrees(50.0)
|
29
|
-
nu = Angle.degrees(60.0)
|
30
|
-
|
31
|
-
coe: COE = COE(a, e, i, raan, aop, nu)
|
32
|
-
|
33
|
-
assert coe is not None
|
34
|
-
assert isinstance(coe, COE)
|
35
|
-
assert coe.is_defined()
|
36
|
-
|
37
|
-
coe: COE = COE.undefined()
|
38
|
-
|
39
|
-
assert coe is not None
|
40
|
-
assert isinstance(coe, COE)
|
41
|
-
assert coe.is_defined() is False
|
42
|
-
|
43
|
-
|
44
|
-
def test_trajectory_orbit_models_kepler_coe_comparators():
|
45
|
-
coe: COE = construct_coe()
|
46
|
-
|
47
|
-
assert coe == coe
|
48
|
-
assert (coe != coe) is False
|
49
|
-
|
50
|
-
|
51
|
-
def test_trajectory_orbit_models_kepler_coe_getters():
|
52
|
-
coe: COE = construct_coe()
|
53
|
-
|
54
|
-
# get_semi_major_axis()
|
55
|
-
|
56
|
-
assert coe.get_semi_major_axis() is not None
|
57
|
-
|
58
|
-
# get_eccentricity()
|
59
|
-
|
60
|
-
assert coe.get_eccentricity() is not None
|
61
|
-
|
62
|
-
# get_inclination()
|
63
|
-
|
64
|
-
assert coe.get_inclination() is not None
|
65
|
-
|
66
|
-
# get_raan()
|
67
|
-
|
68
|
-
assert coe.get_raan() is not None
|
69
|
-
|
70
|
-
# get_aop()
|
71
|
-
|
72
|
-
assert coe.get_aop() is not None
|
73
|
-
|
74
|
-
# get_true_anomaly()
|
75
|
-
|
76
|
-
assert coe.get_true_anomaly() is not None
|
77
|
-
|
78
|
-
# get_mean_anomaly()
|
79
|
-
|
80
|
-
assert coe.get_mean_anomaly() is not None
|
81
|
-
|
82
|
-
# get_eccentric_anomaly()
|
83
|
-
|
84
|
-
assert coe.get_eccentric_anomaly() is not None
|
85
|
-
|
86
|
-
|
87
|
-
def test_trajectory_orbit_models_kepler_coe_get_mean_motion():
|
88
|
-
coe: COE = construct_coe()
|
89
|
-
|
90
|
-
assert coe.get_mean_motion(Earth.EGM2008.gravitational_parameter) is not None
|
91
|
-
|
92
|
-
|
93
|
-
def test_trajectory_orbit_models_kepler_coe_get_orbital_period():
|
94
|
-
coe: COE = construct_coe()
|
95
|
-
|
96
|
-
assert coe.get_orbital_period(Earth.EGM2008.gravitational_parameter) is not None
|
97
|
-
|
98
|
-
|
99
|
-
def test_trajectory_orbit_models_kepler_coe_static_methods():
|
100
|
-
coe: COE = construct_coe()
|
101
|
-
|
102
|
-
assert COE.eccentric_anomaly_from_true_anomaly(Angle.degrees(0.0), 0.0) is not None
|
103
|
-
assert COE.true_anomaly_from_eccentric_anomaly(Angle.degrees(0.0), 0.0) is not None
|
104
|
-
assert COE.mean_anomaly_from_eccentric_anomaly(Angle.degrees(0.0), 0.0) is not None
|
105
|
-
assert (
|
106
|
-
COE.eccentric_anomaly_from_mean_anomaly(Angle.degrees(0.0), 0.0, 0.0)
|
107
|
-
is not None
|
108
|
-
)
|
@@ -1 +0,0 @@
|
|
1
|
-
# Apache License 2.0
|
@@ -1,332 +0,0 @@
|
|
1
|
-
# Apache License 2.0
|
2
|
-
|
3
|
-
import pytest
|
4
|
-
|
5
|
-
import tempfile
|
6
|
-
|
7
|
-
from ostk.core.filesystem import Path
|
8
|
-
from ostk.core.filesystem import File
|
9
|
-
|
10
|
-
from ostk.physics.units import Time
|
11
|
-
from ostk.physics.units import Angle
|
12
|
-
from ostk.physics.units import Derived
|
13
|
-
from ostk.physics.time import Instant
|
14
|
-
from ostk.physics.time import Scale
|
15
|
-
from ostk.physics.time import DateTime
|
16
|
-
|
17
|
-
from ostk.astrodynamics.trajectory.orbit.models.sgp4 import TLE
|
18
|
-
|
19
|
-
|
20
|
-
@pytest.fixture
|
21
|
-
def tle() -> TLE:
|
22
|
-
return TLE(
|
23
|
-
satellite_name="Satellite",
|
24
|
-
first_line="1 25544U 98067A 18231.17878740 .00000187 00000-0 10196-4 0 9994",
|
25
|
-
second_line="2 25544 51.6447 64.7824 0005971 73.1467 36.4366 15.53848234128316",
|
26
|
-
)
|
27
|
-
|
28
|
-
|
29
|
-
class TestTLE:
|
30
|
-
def test_constructor(self):
|
31
|
-
tle = TLE(
|
32
|
-
first_line="1 25544U 98067A 18231.17878740 .00000187 00000-0 10196-4 0 9994",
|
33
|
-
second_line="2 25544 51.6447 64.7824 0005971 73.1467 36.4366 15.53848234128316",
|
34
|
-
)
|
35
|
-
|
36
|
-
assert isinstance(tle, TLE)
|
37
|
-
|
38
|
-
def test_constructor_with_satellite_name(self):
|
39
|
-
tle = TLE(
|
40
|
-
satellite_name="Satellite",
|
41
|
-
first_line="1 25544U 98067A 18231.17878740 .00000187 00000-0 10196-4 0 9994",
|
42
|
-
second_line="2 25544 51.6447 64.7824 0005971 73.1467 36.4366 15.53848234128316",
|
43
|
-
)
|
44
|
-
|
45
|
-
assert isinstance(tle, TLE)
|
46
|
-
|
47
|
-
def test_comparators(self, tle: TLE):
|
48
|
-
assert (tle == tle) is True
|
49
|
-
assert (tle != tle) is False
|
50
|
-
|
51
|
-
def test_is_defined(self, tle: TLE):
|
52
|
-
assert tle.is_defined()
|
53
|
-
|
54
|
-
def test_get_satellite_name(self, tle: TLE):
|
55
|
-
assert tle.get_satellite_name() == "Satellite"
|
56
|
-
|
57
|
-
def test_get_first_line(self, tle: TLE):
|
58
|
-
assert (
|
59
|
-
tle.get_first_line()
|
60
|
-
== "1 25544U 98067A 18231.17878740 .00000187 00000-0 10196-4 0 9994"
|
61
|
-
)
|
62
|
-
|
63
|
-
def test_get_second_line(self, tle: TLE):
|
64
|
-
assert (
|
65
|
-
tle.get_second_line()
|
66
|
-
== "2 25544 51.6447 64.7824 0005971 73.1467 36.4366 15.53848234128316"
|
67
|
-
)
|
68
|
-
|
69
|
-
def test_get_satellite_number(self, tle: TLE):
|
70
|
-
assert tle.get_satellite_number() == 25544
|
71
|
-
|
72
|
-
def test_get_classification(self, tle: TLE):
|
73
|
-
assert tle.get_classification() == "U"
|
74
|
-
|
75
|
-
def test_get_international_designator(self, tle: TLE):
|
76
|
-
assert tle.get_international_designator() == "98067A"
|
77
|
-
|
78
|
-
def test_get_epoch(self, tle: TLE):
|
79
|
-
assert tle.get_epoch() == Instant.date_time(
|
80
|
-
DateTime(2018, 8, 19, 4, 17, 27, 231, 360, 0), Scale.UTC
|
81
|
-
)
|
82
|
-
|
83
|
-
def test_get_mean_motion_first_time_derivative_divided_by_two(self, tle: TLE):
|
84
|
-
assert (
|
85
|
-
tle.get_mean_motion_first_time_derivative_divided_by_two()
|
86
|
-
== 1.8700000000000001e-06
|
87
|
-
)
|
88
|
-
|
89
|
-
def test_get_mean_motion_second_time_derivative_divided_by_six(self, tle: TLE):
|
90
|
-
assert tle.get_mean_motion_second_time_derivative_divided_by_six() == 0.0
|
91
|
-
|
92
|
-
def test_get_b_star_drag_term(self, tle: TLE):
|
93
|
-
assert tle.get_b_star_drag_term() == 1.0196e-05
|
94
|
-
|
95
|
-
def test_get_ephemeris_type(self, tle: TLE):
|
96
|
-
assert tle.get_ephemeris_type() == 0
|
97
|
-
|
98
|
-
def test_get_element_set_number(self, tle: TLE):
|
99
|
-
assert tle.get_element_set_number() == 999
|
100
|
-
|
101
|
-
def test_get_first_line_checksum(self, tle: TLE):
|
102
|
-
assert tle.get_first_line_checksum() == 4
|
103
|
-
|
104
|
-
def test_get_inclination(self, tle: TLE):
|
105
|
-
assert tle.get_inclination().in_degrees() == 51.6447
|
106
|
-
|
107
|
-
def test_get_raan(self, tle: TLE):
|
108
|
-
assert tle.get_raan().in_degrees() == 64.782399999999996
|
109
|
-
|
110
|
-
def test_get_eccentricity(self, tle: TLE):
|
111
|
-
assert tle.get_eccentricity() == 0.00059710000000000004
|
112
|
-
|
113
|
-
def test_get_aop(self, tle: TLE):
|
114
|
-
assert tle.get_aop().in_degrees() == 73.146699999999996
|
115
|
-
|
116
|
-
def test_get_mean_anomaly(self, tle: TLE):
|
117
|
-
assert tle.get_mean_anomaly().in_degrees() == 36.436599999999999
|
118
|
-
|
119
|
-
def test_get_mean_motion(self, tle: TLE):
|
120
|
-
assert (
|
121
|
-
tle.get_mean_motion().in_unit(
|
122
|
-
Derived.Unit.angular_velocity(Angle.Unit.Revolution, Time.Unit.Day)
|
123
|
-
)
|
124
|
-
== 15.53848234
|
125
|
-
)
|
126
|
-
|
127
|
-
def test_get_revolution_number_at_epoch(self, tle: TLE):
|
128
|
-
assert tle.get_revolution_number_at_epoch() == 12831
|
129
|
-
|
130
|
-
def test_get_second_line_checksum(self, tle: TLE):
|
131
|
-
assert tle.get_second_line_checksum() == 6
|
132
|
-
|
133
|
-
def test_set_satellite_number(self, tle: TLE):
|
134
|
-
tle.set_satellite_number(99959)
|
135
|
-
|
136
|
-
assert tle.get_satellite_number() == 99959
|
137
|
-
|
138
|
-
tle.set_satellite_number(25544)
|
139
|
-
|
140
|
-
assert tle.get_satellite_number() == 25544
|
141
|
-
|
142
|
-
def test_set_epoch(self, tle: TLE):
|
143
|
-
tle.set_epoch(
|
144
|
-
Instant.date_time(DateTime(2019, 9, 20, 5, 18, 28, 232, 361, 0), Scale.UTC)
|
145
|
-
)
|
146
|
-
|
147
|
-
assert tle.get_epoch() == Instant.date_time(
|
148
|
-
DateTime(2019, 9, 20, 5, 18, 28, 231, 776, 0), Scale.UTC
|
149
|
-
)
|
150
|
-
|
151
|
-
tle.set_epoch(
|
152
|
-
Instant.date_time(DateTime(2018, 8, 19, 4, 17, 27, 231, 360, 0), Scale.UTC)
|
153
|
-
)
|
154
|
-
|
155
|
-
assert tle.get_epoch() == Instant.date_time(
|
156
|
-
DateTime(2018, 8, 19, 4, 17, 27, 231, 360, 0), Scale.UTC
|
157
|
-
)
|
158
|
-
|
159
|
-
def test_set_revolution_number_at_epoch(self, tle: TLE):
|
160
|
-
tle.set_revolution_number_at_epoch(2345)
|
161
|
-
|
162
|
-
assert tle.get_revolution_number_at_epoch() == 2345
|
163
|
-
assert (
|
164
|
-
tle.get_first_line()
|
165
|
-
== "1 25544U 98067A 18231.17878740 .00000187 00000-0 10196-4 0 9994"
|
166
|
-
)
|
167
|
-
assert (
|
168
|
-
tle.get_second_line()
|
169
|
-
== "2 25544 51.6447 64.7824 0005971 73.1467 36.4366 15.53848234 23455"
|
170
|
-
)
|
171
|
-
|
172
|
-
tle.set_revolution_number_at_epoch(6)
|
173
|
-
|
174
|
-
assert tle.get_revolution_number_at_epoch() == 6
|
175
|
-
assert (
|
176
|
-
tle.get_first_line()
|
177
|
-
== "1 25544U 98067A 18231.17878740 .00000187 00000-0 10196-4 0 9994"
|
178
|
-
)
|
179
|
-
assert (
|
180
|
-
tle.get_second_line()
|
181
|
-
== "2 25544 51.6447 64.7824 0005971 73.1467 36.4366 15.53848234 67"
|
182
|
-
)
|
183
|
-
|
184
|
-
other_tle = TLE(
|
185
|
-
"1 99993U 21990ZZZ 21182.62513889 .00000763 00000-0 42347-4 0 99995",
|
186
|
-
"2 99993 097.5132 311.4037 0016005 231.4378 006.3908 15.13696975009992",
|
187
|
-
)
|
188
|
-
|
189
|
-
assert other_tle.get_revolution_number_at_epoch() == 999
|
190
|
-
|
191
|
-
other_tle.set_revolution_number_at_epoch(999)
|
192
|
-
|
193
|
-
assert other_tle.get_revolution_number_at_epoch() == 999
|
194
|
-
assert (
|
195
|
-
other_tle.get_first_line()
|
196
|
-
== "1 99993U 21990ZZZ 21182.62513889 .00000763 00000-0 42347-4 0 99995"
|
197
|
-
)
|
198
|
-
assert (
|
199
|
-
other_tle.get_second_line()
|
200
|
-
== "2 99993 097.5132 311.4037 0016005 231.4378 006.3908 15.13696975 9992"
|
201
|
-
)
|
202
|
-
|
203
|
-
other_tle.set_revolution_number_at_epoch(9909)
|
204
|
-
|
205
|
-
assert other_tle.get_revolution_number_at_epoch() == 9909
|
206
|
-
assert (
|
207
|
-
other_tle.get_first_line()
|
208
|
-
== "1 99993U 21990ZZZ 21182.62513889 .00000763 00000-0 42347-4 0 99995"
|
209
|
-
)
|
210
|
-
assert (
|
211
|
-
other_tle.get_second_line()
|
212
|
-
== "2 99993 097.5132 311.4037 0016005 231.4378 006.3908 15.13696975 99092"
|
213
|
-
)
|
214
|
-
|
215
|
-
other_tle.set_revolution_number_at_epoch(99)
|
216
|
-
|
217
|
-
assert other_tle.get_revolution_number_at_epoch() == 99
|
218
|
-
assert (
|
219
|
-
other_tle.get_first_line()
|
220
|
-
== "1 99993U 21990ZZZ 21182.62513889 .00000763 00000-0 42347-4 0 99995"
|
221
|
-
)
|
222
|
-
assert (
|
223
|
-
other_tle.get_second_line()
|
224
|
-
== "2 99993 097.5132 311.4037 0016005 231.4378 006.3908 15.13696975 993"
|
225
|
-
)
|
226
|
-
|
227
|
-
def test_can_parse(self, tle: TLE):
|
228
|
-
assert TLE.can_parse(tle.get_first_line(), tle.get_second_line())
|
229
|
-
|
230
|
-
def test_parse(self, tle: TLE):
|
231
|
-
tle_lines: str = "\n".join(
|
232
|
-
[
|
233
|
-
str(tle.get_satellite_name()),
|
234
|
-
str(tle.get_first_line()),
|
235
|
-
str(tle.get_second_line()),
|
236
|
-
]
|
237
|
-
)
|
238
|
-
|
239
|
-
assert TLE.parse(tle_lines) == tle
|
240
|
-
|
241
|
-
def test_load(self, tle: TLE):
|
242
|
-
tle_lines: str = "\n".join(
|
243
|
-
[
|
244
|
-
str(tle.get_satellite_name()),
|
245
|
-
str(tle.get_first_line()),
|
246
|
-
str(tle.get_second_line()),
|
247
|
-
]
|
248
|
-
)
|
249
|
-
|
250
|
-
tle_file = tempfile.NamedTemporaryFile(suffix=".tle", delete=False)
|
251
|
-
tle_file.write(tle_lines.encode())
|
252
|
-
tle_file.close()
|
253
|
-
|
254
|
-
try:
|
255
|
-
assert TLE.load(File.path(Path.parse(tle_file.name))) == tle
|
256
|
-
|
257
|
-
finally:
|
258
|
-
File.path(Path.parse(tle_file.name)).remove()
|
259
|
-
|
260
|
-
def test_construct_with_satellite_name(self, tle: TLE):
|
261
|
-
constructed_tle = TLE.construct(
|
262
|
-
satellite_name="Satellite",
|
263
|
-
satellite_number=25544,
|
264
|
-
classification="U",
|
265
|
-
international_designator="98067A",
|
266
|
-
epoch=Instant.date_time(
|
267
|
-
DateTime(2018, 8, 19, 4, 17, 27, 231, 360, 0), Scale.UTC
|
268
|
-
),
|
269
|
-
mean_motion_first_time_derivative_divided_by_two=1.8700000000000001e-06,
|
270
|
-
mean_motion_second_time_derivative_divided_by_six=0.0,
|
271
|
-
b_star_drag_term=1.0196e-05,
|
272
|
-
ephemeris_type=0,
|
273
|
-
element_set_number=999,
|
274
|
-
inclination=Angle.degrees(51.6447),
|
275
|
-
raan=Angle.degrees(64.782399999999996),
|
276
|
-
eccentricity=0.00059710000000000004,
|
277
|
-
aop=Angle.degrees(73.146699999999996),
|
278
|
-
mean_anomaly=Angle.degrees(36.436599999999999),
|
279
|
-
mean_motion=Derived(
|
280
|
-
15.53848234,
|
281
|
-
Derived.Unit.angular_velocity(Angle.Unit.Revolution, Time.Unit.Day),
|
282
|
-
),
|
283
|
-
revolution_number_at_epoch=12831,
|
284
|
-
)
|
285
|
-
|
286
|
-
assert constructed_tle == tle
|
287
|
-
|
288
|
-
def test_construct_without_satellite_name(self, tle: TLE):
|
289
|
-
constructed_tle = TLE.construct(
|
290
|
-
satellite_number=25544,
|
291
|
-
classification="U",
|
292
|
-
international_designator="98067A",
|
293
|
-
epoch=Instant.date_time(
|
294
|
-
DateTime(2018, 8, 19, 4, 17, 27, 231, 360, 0), Scale.UTC
|
295
|
-
),
|
296
|
-
mean_motion_first_time_derivative_divided_by_two=1.8700000000000001e-06,
|
297
|
-
mean_motion_second_time_derivative_divided_by_six=0.0,
|
298
|
-
b_star_drag_term=1.0196e-05,
|
299
|
-
ephemeris_type=0,
|
300
|
-
element_set_number=999,
|
301
|
-
inclination=Angle.degrees(51.6447),
|
302
|
-
raan=Angle.degrees(64.782399999999996),
|
303
|
-
eccentricity=0.00059710000000000004,
|
304
|
-
aop=Angle.degrees(73.146699999999996),
|
305
|
-
mean_anomaly=Angle.degrees(36.436599999999999),
|
306
|
-
mean_motion=Derived(
|
307
|
-
15.53848234,
|
308
|
-
Derived.Unit.angular_velocity(Angle.Unit.Revolution, Time.Unit.Day),
|
309
|
-
),
|
310
|
-
revolution_number_at_epoch=12831,
|
311
|
-
)
|
312
|
-
|
313
|
-
assert constructed_tle.get_first_line() == tle.get_first_line()
|
314
|
-
assert constructed_tle.get_second_line() == tle.get_second_line()
|
315
|
-
|
316
|
-
def test_generate_checksum(self, tle: TLE):
|
317
|
-
assert (
|
318
|
-
TLE.generate_checksum(tle.get_first_line()) == tle.get_first_line_checksum()
|
319
|
-
)
|
320
|
-
assert (
|
321
|
-
TLE.generate_checksum(tle.get_second_line())
|
322
|
-
== tle.get_second_line_checksum()
|
323
|
-
)
|
324
|
-
|
325
|
-
assert (
|
326
|
-
TLE.generate_checksum(f"{str(tle.get_first_line())[:-1]}0")
|
327
|
-
== tle.get_first_line_checksum()
|
328
|
-
)
|
329
|
-
assert (
|
330
|
-
TLE.generate_checksum(f"{str(tle.get_second_line())[:-1]}9")
|
331
|
-
== tle.get_second_line_checksum()
|
332
|
-
)
|
@@ -1,130 +0,0 @@
|
|
1
|
-
# Apache License 2.0
|
2
|
-
|
3
|
-
import ostk.physics as physics
|
4
|
-
|
5
|
-
import ostk.astrodynamics as astrodynamics
|
6
|
-
|
7
|
-
Length = physics.units.Length
|
8
|
-
Angle = physics.units.Angle
|
9
|
-
Scale = physics.time.Scale
|
10
|
-
Instant = physics.time.Instant
|
11
|
-
Interval = physics.time.Interval
|
12
|
-
DateTime = physics.time.DateTime
|
13
|
-
Position = physics.coordinate.Position
|
14
|
-
Velocity = physics.coordinate.Velocity
|
15
|
-
Frame = physics.coordinate.Frame
|
16
|
-
Environment = physics.Environment
|
17
|
-
|
18
|
-
Trajectory = astrodynamics.Trajectory
|
19
|
-
Model = astrodynamics.trajectory.Model
|
20
|
-
Orbit = astrodynamics.trajectory.Orbit
|
21
|
-
Pass = astrodynamics.trajectory.orbit.Pass
|
22
|
-
Kepler = astrodynamics.trajectory.orbit.models.Kepler
|
23
|
-
COE = astrodynamics.trajectory.orbit.models.kepler.COE
|
24
|
-
SGP4 = astrodynamics.trajectory.orbit.models.SGP4
|
25
|
-
TLE = astrodynamics.trajectory.orbit.models.sgp4.TLE
|
26
|
-
State = astrodynamics.trajectory.State
|
27
|
-
Access = astrodynamics.Access
|
28
|
-
|
29
|
-
earth = Environment.default().access_celestial_object_with_name("Earth")
|
30
|
-
|
31
|
-
|
32
|
-
def construct_kepler():
|
33
|
-
a = Length.kilometers(7000.0)
|
34
|
-
e = 0.1
|
35
|
-
i = Angle.degrees(35.0)
|
36
|
-
raan = Angle.degrees(40.0)
|
37
|
-
aop = Angle.degrees(50.0)
|
38
|
-
nu = Angle.degrees(60.0)
|
39
|
-
|
40
|
-
coe = COE(a, e, i, raan, aop, nu)
|
41
|
-
|
42
|
-
assert coe is not None
|
43
|
-
assert isinstance(coe, COE)
|
44
|
-
|
45
|
-
epoch = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
46
|
-
|
47
|
-
kepler = Kepler(coe, epoch, earth, Kepler.PerturbationType.No)
|
48
|
-
|
49
|
-
return kepler
|
50
|
-
|
51
|
-
|
52
|
-
def test_trajectory_orbit_models_kepler_constructors():
|
53
|
-
a = Length.kilometers(7000.0)
|
54
|
-
e = 0.1
|
55
|
-
i = Angle.degrees(35.0)
|
56
|
-
raan = Angle.degrees(40.0)
|
57
|
-
aop = Angle.degrees(50.0)
|
58
|
-
nu = Angle.degrees(60.0)
|
59
|
-
|
60
|
-
coe = COE(a, e, i, raan, aop, nu)
|
61
|
-
|
62
|
-
assert coe is not None
|
63
|
-
assert isinstance(coe, COE)
|
64
|
-
|
65
|
-
epoch = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
66
|
-
|
67
|
-
kepler = Kepler(coe, epoch, earth, Kepler.PerturbationType.No)
|
68
|
-
|
69
|
-
assert kepler is not None
|
70
|
-
assert isinstance(kepler, Kepler)
|
71
|
-
assert kepler.is_defined()
|
72
|
-
|
73
|
-
|
74
|
-
def test_trajectory_orbit_models_kepler_comparators():
|
75
|
-
kepler: Kepler = construct_kepler()
|
76
|
-
|
77
|
-
assert kepler == kepler
|
78
|
-
assert (kepler != kepler) is False
|
79
|
-
|
80
|
-
|
81
|
-
def test_trajectory_orbit_models_kepler_getters():
|
82
|
-
kepler: Kepler = construct_kepler()
|
83
|
-
|
84
|
-
# get_classical_orbital_elements
|
85
|
-
|
86
|
-
assert kepler.get_classical_orbital_elements() is not None
|
87
|
-
|
88
|
-
# get_epoch
|
89
|
-
|
90
|
-
assert kepler.get_epoch() is not None
|
91
|
-
|
92
|
-
# get_revolution_number_at_epoch()
|
93
|
-
|
94
|
-
assert kepler.get_revolution_number_at_epoch() is not None
|
95
|
-
|
96
|
-
# get_gravitational_parameter()
|
97
|
-
|
98
|
-
assert kepler.get_gravitational_parameter() is not None
|
99
|
-
|
100
|
-
# get_equatorial_radius()
|
101
|
-
|
102
|
-
assert kepler.get_equatorial_radius() is not None
|
103
|
-
|
104
|
-
# get_j2()
|
105
|
-
|
106
|
-
assert kepler.get_j2() is not None
|
107
|
-
|
108
|
-
# get_j4()
|
109
|
-
|
110
|
-
assert kepler.get_j4() is not None
|
111
|
-
|
112
|
-
# get_perturbation_type()
|
113
|
-
|
114
|
-
assert kepler.get_perturbation_type() is not None
|
115
|
-
|
116
|
-
|
117
|
-
def test_trajectory_orbit_models_kepler_calculate_state_at_epoch():
|
118
|
-
kepler: Kepler = construct_kepler()
|
119
|
-
|
120
|
-
epoch: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
121
|
-
|
122
|
-
assert kepler.calculate_state_at(epoch) is not None
|
123
|
-
|
124
|
-
|
125
|
-
def test_trajectory_orbit_models_kepler_calculate_rev_number_at_epoch():
|
126
|
-
kepler: Kepler = construct_kepler()
|
127
|
-
|
128
|
-
epoch: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
129
|
-
|
130
|
-
assert kepler.calculate_revolution_number_at(epoch) is not None
|