open-space-toolkit-astrodynamics 1.2.0__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.
Files changed (65) hide show
  1. {open_space_toolkit_astrodynamics-1.2.0.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/METADATA +2 -2
  2. open_space_toolkit_astrodynamics-4.2.0.dist-info/RECORD +25 -0
  3. ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-310-x86_64-linux-gnu.so +0 -0
  4. ostk/astrodynamics/__init__.py +6 -0
  5. ostk/astrodynamics/{libopen-space-toolkit-astrodynamics.so.1 → libopen-space-toolkit-astrodynamics.so.4} +0 -0
  6. ostk/astrodynamics/pytrajectory/pystate.py +36 -0
  7. ostk/astrodynamics/test/test_access.py +2 -6
  8. ostk/astrodynamics/test/test_converters.py +1 -3
  9. ostk/astrodynamics/test/test_event_condition.py +24 -41
  10. ostk/astrodynamics/test/test_import.py +3 -3
  11. ostk/astrodynamics/test/test_viewer.py +1 -2
  12. ostk/astrodynamics/viewer.py +1 -1
  13. open_space_toolkit_astrodynamics-1.2.0.dist-info/RECORD +0 -72
  14. ostk/astrodynamics/test/access/__init__.py +0 -1
  15. ostk/astrodynamics/test/access/test_generator.py +0 -248
  16. ostk/astrodynamics/test/conjunction/messages/ccsds/__init__.py +0 -1
  17. ostk/astrodynamics/test/conjunction/messages/ccsds/conftest.py +0 -325
  18. ostk/astrodynamics/test/conjunction/messages/ccsds/data/cdm.json +0 -303
  19. ostk/astrodynamics/test/conjunction/messages/ccsds/test_cdm.py +0 -418
  20. ostk/astrodynamics/test/event_condition/test_coe_condition.py +0 -95
  21. ostk/astrodynamics/test/event_condition/test_conjunctive.py +0 -64
  22. ostk/astrodynamics/test/event_condition/test_disjunctive.py +0 -63
  23. ostk/astrodynamics/test/event_condition/test_duration_condition.py +0 -36
  24. ostk/astrodynamics/test/event_condition/test_logical_connective.py +0 -37
  25. ostk/astrodynamics/test/flight/__init__.py +0 -1
  26. ostk/astrodynamics/test/flight/profile/__init__.py +0 -1
  27. ostk/astrodynamics/test/flight/profile/test_state.py +0 -144
  28. ostk/astrodynamics/test/flight/system/__init__.py +0 -1
  29. ostk/astrodynamics/test/flight/system/dynamics/__init__.py +0 -1
  30. ostk/astrodynamics/test/flight/system/dynamics/test_atmospheric_drag.py +0 -86
  31. ostk/astrodynamics/test/flight/system/dynamics/test_central_body_gravity.py +0 -57
  32. ostk/astrodynamics/test/flight/system/dynamics/test_position_derivative.py +0 -49
  33. ostk/astrodynamics/test/flight/system/dynamics/test_third_body_gravity.py +0 -65
  34. ostk/astrodynamics/test/flight/system/test_satellite_system.py +0 -77
  35. ostk/astrodynamics/test/flight/test_profile.py +0 -147
  36. ostk/astrodynamics/test/flight/test_system.py +0 -55
  37. ostk/astrodynamics/test/solvers/__init__.py +0 -1
  38. ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +0 -153
  39. ostk/astrodynamics/test/test_numerical_solver.py +0 -248
  40. ostk/astrodynamics/test/trajectory/__init__.py +0 -1
  41. ostk/astrodynamics/test/trajectory/orbit/__init__.py +0 -1
  42. ostk/astrodynamics/test/trajectory/orbit/messages/__init__.py +0 -1
  43. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/__init__.py +0 -1
  44. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/conftest.py +0 -18
  45. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/data/opm_1.yaml +0 -44
  46. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/test_opm.py +0 -108
  47. ostk/astrodynamics/test/trajectory/orbit/models/__init__.py +0 -1
  48. ostk/astrodynamics/test/trajectory/orbit/models/kepler/__init__.py +0 -1
  49. ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +0 -108
  50. ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +0 -1
  51. ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +0 -332
  52. ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +0 -130
  53. ostk/astrodynamics/test/trajectory/orbit/models/test_propagated.py +0 -197
  54. ostk/astrodynamics/test/trajectory/orbit/models/test_sgp4.py +0 -1
  55. ostk/astrodynamics/test/trajectory/orbit/models/test_tabulated.py +0 -383
  56. ostk/astrodynamics/test/trajectory/orbit/test_model.py +0 -1
  57. ostk/astrodynamics/test/trajectory/orbit/test_pass.py +0 -55
  58. ostk/astrodynamics/test/trajectory/test_model.py +0 -1
  59. ostk/astrodynamics/test/trajectory/test_orbit.py +0 -92
  60. ostk/astrodynamics/test/trajectory/test_propagator.py +0 -233
  61. ostk/astrodynamics/test/trajectory/test_state.py +0 -70
  62. {open_space_toolkit_astrodynamics-1.2.0.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/WHEEL +0 -0
  63. {open_space_toolkit_astrodynamics-1.2.0.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/top_level.txt +0 -0
  64. {open_space_toolkit_astrodynamics-1.2.0.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/zip-safe +0 -0
  65. /ostk/{__init__.py → astrodynamics/pytrajectory/__init__.py} +0 -0
@@ -1,197 +0,0 @@
1
- # Apache License 2.0
2
-
3
- import pytest
4
-
5
- import numpy as np
6
-
7
- from ostk.physics.time import Instant
8
- from ostk.physics.time import DateTime
9
- from ostk.physics.time import Scale
10
- from ostk.physics.coordinate import Position
11
- from ostk.physics.coordinate import Velocity
12
- from ostk.physics.coordinate import Frame
13
- from ostk.physics.environment.objects.celestial_bodies import Earth
14
-
15
- from ostk.astrodynamics import NumericalSolver
16
- from ostk.astrodynamics.trajectory import State
17
- from ostk.astrodynamics.trajectory import Orbit
18
- from ostk.astrodynamics.trajectory import Propagator
19
- from ostk.astrodynamics.flight.system import Dynamics
20
- from ostk.astrodynamics.flight.system.dynamics import CentralBodyGravity
21
- from ostk.astrodynamics.flight.system.dynamics import PositionDerivative
22
- from ostk.astrodynamics.trajectory.orbit.models import Propagated
23
-
24
-
25
- @pytest.fixture
26
- def state() -> State:
27
- frame: Frame = Frame.GCRF()
28
- position: Position = Position.meters([7500000.0, 0.0, 0.0], frame)
29
- velocity: Velocity = Velocity.meters_per_second(
30
- [0.0, 5335.865450622126, 5335.865450622126], frame
31
- )
32
-
33
- instant: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
34
- return State(instant, position, velocity)
35
-
36
-
37
- @pytest.fixture
38
- def central_body_dynamics() -> CentralBodyGravity:
39
- return CentralBodyGravity(Earth.WGS84(20, 0))
40
-
41
-
42
- @pytest.fixture
43
- def position_derivative() -> PositionDerivative:
44
- return PositionDerivative()
45
-
46
-
47
- @pytest.fixture
48
- def dynamics(
49
- position_derivative: PositionDerivative, central_body_dynamics: CentralBodyGravity
50
- ) -> list:
51
- return [position_derivative, central_body_dynamics]
52
-
53
-
54
- @pytest.fixture
55
- def numerical_solver() -> NumericalSolver:
56
- return NumericalSolver(
57
- NumericalSolver.LogType.NoLog,
58
- NumericalSolver.StepperType.RungeKuttaFehlberg78,
59
- 5.0,
60
- 1.0e-15,
61
- 1.0e-15,
62
- )
63
-
64
-
65
- @pytest.fixture
66
- def propagator(
67
- numerical_solver: NumericalSolver, dynamics: list[Dynamics]
68
- ) -> Propagator:
69
- return Propagator(numerical_solver, dynamics)
70
-
71
-
72
- @pytest.fixture
73
- def propagated(propagator: Propagator, state: State) -> Propagated:
74
- return Propagated(propagator, state)
75
-
76
-
77
- @pytest.fixture
78
- def earth() -> Earth:
79
- return Earth.spherical()
80
-
81
-
82
- @pytest.fixture
83
- def orbit(propagated: Propagated, earth: Earth) -> Orbit:
84
- return Orbit(propagated, earth)
85
-
86
-
87
- class TestPropagated:
88
- def test_constructors(
89
- self,
90
- propagated: Propagated,
91
- earth: Earth,
92
- dynamics: list,
93
- numerical_solver: NumericalSolver,
94
- state: State,
95
- ):
96
- assert propagated is not None
97
- assert isinstance(propagated, Propagated)
98
- assert propagated.is_defined()
99
-
100
- orbit = Orbit(propagated, earth)
101
-
102
- assert orbit is not None
103
- assert isinstance(orbit, Orbit)
104
- assert orbit.is_defined()
105
-
106
- state_array = [state, state]
107
- propagated_with_state_array = Propagated(
108
- Propagator(numerical_solver, dynamics), state_array
109
- )
110
-
111
- assert propagated_with_state_array is not None
112
- assert isinstance(propagated_with_state_array, Propagated)
113
- assert propagated_with_state_array.is_defined()
114
-
115
- def test_comparators(self, propagated: Propagated):
116
- assert (propagated == propagated) is True
117
- assert (propagated != propagated) is False
118
-
119
- def test_getters(self, propagated: Propagated, state: State):
120
- assert propagated.get_epoch() == state.get_instant()
121
-
122
- assert propagated.get_revolution_number_at_epoch() == 1
123
-
124
- assert propagated.access_cached_state_array() == [state]
125
-
126
- def test_calculate_state_at(self, propagated: Propagated, orbit: Orbit):
127
- instant: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 10, 0), Scale.UTC)
128
-
129
- propagated_state = propagated.calculate_state_at(instant)
130
- propagated_state_orbit = orbit.get_state_at(instant)
131
-
132
- assert propagated_state == propagated_state_orbit
133
-
134
- propagated_state_position_ref = np.array(
135
- [6265892.25765909, 3024770.94961259, 3024359.72137468]
136
- )
137
- propagated_state_velocity_ref = np.array(
138
- [-3974.49168221, 4468.16996776, 4466.19232746]
139
- )
140
-
141
- propagated_state_position = propagated_state.get_position().get_coordinates()
142
- propagated_state_velocity = propagated_state.get_velocity().get_coordinates()
143
-
144
- assert all(
145
- [
146
- round(propagated_state_position[i], 8)
147
- == round(propagated_state_position_ref[i], 8)
148
- for i in range(0, len(propagated_state_position_ref))
149
- ]
150
- )
151
- assert all(
152
- [
153
- round(propagated_state_velocity[i], 8)
154
- == round(propagated_state_velocity_ref[i], 8)
155
- for i in range(0, len(propagated_state_velocity_ref))
156
- ]
157
- )
158
- assert propagated_state.get_instant() == instant
159
-
160
- def test_calculate_states_at(self, propagated: Propagated, orbit: Orbit):
161
- instant_array = [
162
- Instant.date_time(DateTime(2018, 1, 1, 0, 10, 0), Scale.UTC),
163
- Instant.date_time(DateTime(2018, 1, 1, 0, 20, 0), Scale.UTC),
164
- ]
165
-
166
- propagated_state_array = propagated.calculate_states_at(instant_array)
167
- propagated_state_array_orbit = orbit.get_states_at(instant_array)
168
-
169
- assert propagated_state_array_orbit == propagated_state_array
170
-
171
- assert propagated_state_array_orbit[0].get_instant() == instant_array[0]
172
- assert propagated_state_array_orbit[1].get_instant() == instant_array[1]
173
-
174
- def test_calculate_rev_number_at(self, propagated: Propagated, orbit: Orbit):
175
- instant: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 40, 0), Scale.UTC)
176
-
177
- assert propagated.calculate_revolution_number_at(instant) == 1
178
- assert orbit.get_revolution_number_at(instant) == 1
179
-
180
- def test_access_cached_state_array(self, propagated: Propagated, state: State):
181
- assert len(propagated.access_cached_state_array()) == 1
182
- assert propagated.access_cached_state_array()[0] == state
183
-
184
- def test_access_propagator(self, propagated: Propagated):
185
- assert propagated.access_propagator() is not None
186
- assert isinstance(propagated.access_propagator(), Propagator)
187
-
188
- def test_set_cached_state_array(self, propagated: Propagated, state: State):
189
- assert len(propagated.access_cached_state_array()) == 1
190
-
191
- propagated.set_cached_state_array([state, state, state])
192
-
193
- assert len(propagated.access_cached_state_array()) == 1
194
- assert propagated.access_cached_state_array()[0] == state
195
-
196
- with pytest.raises(Exception) as e:
197
- propagated.set_cached_state_array([])
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1,383 +0,0 @@
1
- # Apache License 2.0
2
-
3
- import pytest
4
-
5
- import numpy as np
6
-
7
- from ostk.physics.time import Instant
8
- from ostk.physics.time import DateTime
9
- from ostk.physics.time import Scale
10
- from ostk.physics.time import Duration
11
- from ostk.physics.coordinate import Position
12
- from ostk.physics.coordinate import Velocity
13
- from ostk.physics.coordinate import Frame
14
- from ostk.physics import Environment
15
-
16
- from ostk.astrodynamics.trajectory import State
17
- from ostk.astrodynamics.trajectory import Orbit
18
- from ostk.astrodynamics.trajectory.orbit.models import Tabulated
19
-
20
-
21
- @pytest.fixture
22
- def earth():
23
- return Environment.default().access_celestial_object_with_name("Earth")
24
-
25
-
26
- @pytest.fixture
27
- def reference_states() -> list[State]:
28
- data = [
29
- [
30
- "2023-04-18T08:28:32.744064",
31
- -3310024.847608758,
32
- -6052528.239971979,
33
- 7626.534641683145,
34
- -855.2088930507367,
35
- 495.9541573743367,
36
- 7536.520188134902,
37
- ],
38
- [
39
- "2023-04-18T08:28:33.744064",
40
- -3310878.047628086,
41
- -6052028.610429457,
42
- 15163.0493833017,
43
- -851.1838953959017,
44
- 503.31279367207185,
45
- 7536.506322816037,
46
- ],
47
- [
48
- "2023-04-18T08:28:34.744064",
49
- -3311727.222133691,
50
- -6051521.622540367,
51
- 22699.545682944226,
52
- -847.1578341126227,
53
- 510.67087060642456,
54
- 7536.483268627912,
55
- ],
56
- [
57
- "2023-04-18T08:28:35.744064",
58
- -3312572.370064364,
59
- -6051007.276868478,
60
- 30236.014351773065,
61
- -843.1307141262514,
62
- 518.0283791399937,
63
- 7536.451025467619,
64
- ],
65
- [
66
- "2023-04-18T08:28:36.744064",
67
- -3313413.490363804,
68
- -6050485.573986613,
69
- 37772.44620082258,
70
- -839.1025403636198,
71
- 525.3853102358,
72
- 7536.40959324377,
73
- ],
74
- [
75
- "2023-04-18T08:28:37.744064",
76
- -3314250.5819806806,
77
- -6049956.514476612,
78
- 45308.83204108345,
79
- -835.0733177529921,
80
- 532.7416548573802,
81
- 7536.358971876497,
82
- ],
83
- [
84
- "2023-04-18T08:28:38.744064",
85
- -3315083.6438685474,
86
- -6049420.098929363,
87
- 52845.16268340493,
88
- -831.0430512241197,
89
- 540.0974039686765,
90
- 7536.299161297429,
91
- ],
92
- [
93
- "2023-04-18T08:28:39.744064",
94
- -3315912.6749859042,
95
- -6048876.327944793,
96
- 60381.42893867038,
97
- -827.0117457081434,
98
- 547.4525485342174,
99
- 7536.23016144972,
100
- ],
101
- [
102
- "2023-04-18T08:28:40.744064",
103
- -3316737.6742961914,
104
- -6048325.2021318525,
105
- 67917.62161760827,
106
- -822.9794061376964,
107
- 554.8070795189376,
108
- 7536.1519722880375,
109
- ],
110
- [
111
- "2023-04-18T08:28:41.744064",
112
- -3317558.640767768,
113
- -6047766.722108539,
114
- 75453.73153099201,
115
- -818.9460374467976,
116
- 562.1609878883643,
117
- 7536.064593778564,
118
- ],
119
- [
120
- "2023-04-18T08:28:42.744064",
121
- -3318375.5733739412,
122
- -6047200.888501875,
123
- 82989.7494894997,
124
- -814.9116445709234,
125
- 569.5142646084902,
126
- 7535.968025898996,
127
- ],
128
- [
129
- "2023-04-18T08:28:43.744064",
130
- -3319188.471092942,
131
- -6046627.7019479135,
132
- 90525.66630384693,
133
- -810.8762324469382,
134
- 576.866900645898,
135
- 7535.862268638544,
136
- ],
137
- [
138
- "2023-04-18T08:28:44.744064",
139
- -3319997.332907958,
140
- -6046047.163091751,
141
- 98061.47278470133,
142
- -806.8398060131411,
143
- 584.2188869676824,
144
- 7535.747321997941,
145
- ],
146
- [
147
- "2023-04-18T08:28:45.744064",
148
- -3320802.157807084,
149
- -6045459.272587514,
150
- 105597.15974279115,
151
- -802.8023702092072,
152
- 591.5702145415504,
153
- 7535.62318598943,
154
- ],
155
- [
156
- "2023-04-18T08:28:46.744064",
157
- -3321602.9447833803,
158
- -6044864.0310983565,
159
- 113132.71798877101,
160
- -798.7639299762548,
161
- 598.9208743356983,
162
- 7535.48986063679,
163
- ],
164
- [
165
- "2023-04-18T08:28:47.744064",
166
- -3322399.692834845,
167
- -6044261.439296465,
168
- 120668.13833342775,
169
- -794.7244902567405,
170
- 606.2708573190106,
171
- 7535.347345975296,
172
- ],
173
- [
174
- "2023-04-18T08:28:48.744064",
175
- -3323192.400964402,
176
- -6043651.497863061,
177
- 128203.41158748553,
178
- -790.6840559945587,
179
- 613.6201544608678,
180
- 7535.195642051765,
181
- ],
182
- [
183
- "2023-04-18T08:28:49.744064",
184
- -3323981.068179951,
185
- -6043034.207488383,
186
- 135738.52856182377,
187
- -786.6426321349277,
188
- 620.9687567313651,
189
- 7535.034748924513,
190
- ],
191
- [
192
- "2023-04-18T08:28:50.744064",
193
- -3324765.6934943097,
194
- -6042409.568871722,
195
- 143273.48006733102,
196
- -782.6002236244674,
197
- 628.3166551011666,
198
- 7534.864666663388,
199
- ],
200
- [
201
- "2023-04-18T08:28:51.744064",
202
- -3325546.2759252544,
203
- -6041777.582721372,
204
- 150808.25691495842,
205
- -778.5568354111685,
206
- 635.6638405415614,
207
- 7534.68539534976,
208
- ],
209
- ]
210
- return [
211
- State(
212
- instant=Instant.date_time(DateTime.parse(row[0]), Scale.UTC),
213
- position=Position.meters(
214
- [float(row[1]), float(row[2]), float(row[3])], Frame.GCRF()
215
- ),
216
- velocity=Velocity.meters_per_second(
217
- [float(row[4]), float(row[5]), float(row[6])], Frame.GCRF()
218
- ),
219
- )
220
- for row in data
221
- ]
222
-
223
-
224
- @pytest.fixture
225
- def test_states(reference_states: list[State]) -> list[State]:
226
- return reference_states[::4]
227
-
228
-
229
- class TestTabulated:
230
- @pytest.mark.parametrize(
231
- "interpolation_type",
232
- (
233
- (Tabulated.InterpolationType.Linear),
234
- (Tabulated.InterpolationType.CubicSpline),
235
- (Tabulated.InterpolationType.BarycentricRational),
236
- ),
237
- )
238
- def test_constructor(
239
- self, test_states: list[State], interpolation_type: Tabulated.InterpolationType
240
- ):
241
- assert (
242
- Tabulated(
243
- states=test_states,
244
- initial_revolution_number=1,
245
- interpolation_type=interpolation_type,
246
- )
247
- is not None
248
- )
249
-
250
- def test_constructor_orbit_tabulated_sucess(
251
- self,
252
- test_states: list[State],
253
- earth,
254
- ):
255
- tabulated = Tabulated(
256
- states=test_states,
257
- initial_revolution_number=1,
258
- interpolation_type=Tabulated.InterpolationType.CubicSpline,
259
- )
260
-
261
- orbit: Orbit = Orbit(tabulated, earth)
262
-
263
- assert orbit is not None
264
- assert isinstance(orbit, Orbit)
265
-
266
- def test_get_interpolation_type(self, test_states: list[State]):
267
- tabulated = Tabulated(
268
- states=test_states,
269
- initial_revolution_number=1,
270
- interpolation_type=Tabulated.InterpolationType.CubicSpline,
271
- )
272
-
273
- assert (
274
- tabulated.get_interpolation_type()
275
- == Tabulated.InterpolationType.CubicSpline
276
- )
277
-
278
- @pytest.mark.parametrize(
279
- "interpolation_type,error_tolerance",
280
- (
281
- (Tabulated.InterpolationType.Linear, 420.0),
282
- (Tabulated.InterpolationType.CubicSpline, 5e-3),
283
- (Tabulated.InterpolationType.BarycentricRational, 5e-2),
284
- ),
285
- )
286
- def test_calculate_state_at_success(
287
- self,
288
- test_states: list[State],
289
- reference_states: list[State],
290
- interpolation_type: Tabulated.InterpolationType,
291
- error_tolerance: float,
292
- ):
293
- tabulated = Tabulated(
294
- states=test_states,
295
- initial_revolution_number=1,
296
- interpolation_type=interpolation_type,
297
- )
298
-
299
- for reference_state in reference_states:
300
- if not tabulated.get_interval().contains_instant(
301
- reference_state.get_instant()
302
- ):
303
- continue
304
-
305
- calculated_state: State = tabulated.calculate_state_at(
306
- reference_state.get_instant()
307
- )
308
- assert np.all(
309
- np.abs(
310
- calculated_state.get_coordinates()
311
- - reference_state.get_coordinates()
312
- )
313
- < error_tolerance
314
- )
315
-
316
- @pytest.mark.parametrize(
317
- "interpolation_type,error_tolerance",
318
- (
319
- (Tabulated.InterpolationType.Linear, 420.0),
320
- (Tabulated.InterpolationType.CubicSpline, 5e-3),
321
- (Tabulated.InterpolationType.BarycentricRational, 5e-2),
322
- ),
323
- )
324
- def test_calculate_states_at_success(
325
- self,
326
- test_states: list[State],
327
- reference_states: list[State],
328
- interpolation_type: Tabulated.InterpolationType,
329
- error_tolerance: float,
330
- ):
331
- tabulated = Tabulated(
332
- states=test_states,
333
- initial_revolution_number=1,
334
- interpolation_type=interpolation_type,
335
- )
336
-
337
- states_within_interval: list[State] = [
338
- state
339
- for state in reference_states
340
- if tabulated.get_interval().contains_instant(state.get_instant())
341
- ]
342
-
343
- calculated_states: list[State] = tabulated.calculate_states_at(
344
- [state.get_instant() for state in states_within_interval]
345
- )
346
-
347
- for calculated_state, reference_state in zip(
348
- calculated_states, states_within_interval
349
- ):
350
- assert np.all(
351
- np.abs(
352
- calculated_state.get_coordinates()
353
- - reference_state.get_coordinates()
354
- )
355
- < error_tolerance
356
- )
357
-
358
- @pytest.mark.parametrize(
359
- "interpolation_type",
360
- (
361
- (Tabulated.InterpolationType.Linear),
362
- (Tabulated.InterpolationType.CubicSpline),
363
- (Tabulated.InterpolationType.BarycentricRational),
364
- ),
365
- )
366
- def test_calculate_state_at_failure(
367
- self, test_states: list[State], interpolation_type: Tabulated.InterpolationType
368
- ):
369
- tabulated = Tabulated(
370
- states=test_states,
371
- initial_revolution_number=1,
372
- interpolation_type=interpolation_type,
373
- )
374
-
375
- with pytest.raises(Exception):
376
- tabulated.calculate_state_at(
377
- test_states[0].get_instant() - Duration.seconds(1)
378
- )
379
-
380
- with pytest.raises(Exception):
381
- tabulated.calculate_state_at(
382
- test_states[-1].get_instant() + Duration.seconds(1)
383
- )
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1,55 +0,0 @@
1
- # Apache License 2.0
2
-
3
- import pytest
4
-
5
- import ostk.physics as physics
6
-
7
- import ostk.astrodynamics as astrodynamics
8
-
9
- Length = physics.units.Length
10
- Angle = physics.units.Angle
11
- Scale = physics.time.Scale
12
- Instant = physics.time.Instant
13
- Interval = physics.time.Interval
14
- DateTime = physics.time.DateTime
15
- Position = physics.coordinate.Position
16
- Velocity = physics.coordinate.Velocity
17
- Frame = physics.coordinate.Frame
18
- Environment = physics.Environment
19
-
20
- Trajectory = astrodynamics.Trajectory
21
- Model = astrodynamics.trajectory.Model
22
- Orbit = astrodynamics.trajectory.Orbit
23
- Pass = astrodynamics.trajectory.orbit.Pass
24
- Kepler = astrodynamics.trajectory.orbit.models.Kepler
25
- COE = astrodynamics.trajectory.orbit.models.kepler.COE
26
- SGP4 = astrodynamics.trajectory.orbit.models.SGP4
27
- TLE = astrodynamics.trajectory.orbit.models.sgp4.TLE
28
- State = astrodynamics.trajectory.State
29
- Access = astrodynamics.Access
30
-
31
- earth = Environment.default().access_celestial_object_with_name("Earth")
32
-
33
-
34
- def test_trajectory_orbit_pass():
35
- pass_type = Pass.Type.Partial
36
- pass_revolution_number = 123
37
- pass_start_instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
38
- pass_end_instant = Instant.date_time(DateTime(2018, 1, 1, 1, 0, 0), Scale.UTC)
39
- pass_interval = Interval.closed(pass_start_instant, pass_end_instant)
40
-
41
- pass_ = Pass(pass_type, pass_revolution_number, pass_interval)
42
-
43
- assert pass_ is not None
44
- assert isinstance(pass_, Pass)
45
-
46
- assert pass_.is_defined()
47
- assert pass_.is_complete() is not None
48
- assert pass_.get_type() is not None
49
- assert pass_.get_revolution_number() is not None
50
- # Interval conversion to Python type of issue
51
- # assert pass_.get_interval() is not None
52
-
53
- assert Pass.string_from_type(Pass.Type.Complete) is not None
54
- assert Pass.string_from_phase(Pass.Phase.Ascending) is not None
55
- assert Pass.string_from_quarter(Pass.Quarter.First) is not None
@@ -1 +0,0 @@
1
- # Apache License 2.0