open-space-toolkit-astrodynamics 2.2.0__py311-none-any.whl → 5.0.0__py311-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-2.2.0.dist-info → open_space_toolkit_astrodynamics-5.0.0.dist-info}/METADATA +2 -2
- open_space_toolkit_astrodynamics-5.0.0.dist-info/RECORD +25 -0
- ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-311-x86_64-linux-gnu.so +0 -0
- ostk/astrodynamics/__init__.py +6 -0
- ostk/astrodynamics/converters.py +1 -1
- ostk/astrodynamics/{libopen-space-toolkit-astrodynamics.so.2 → libopen-space-toolkit-astrodynamics.so.5} +0 -0
- ostk/astrodynamics/pytrajectory/pystate.py +36 -0
- ostk/astrodynamics/test/test_access.py +1 -1
- ostk/astrodynamics/test/test_converters.py +1 -1
- ostk/astrodynamics/test/test_event_condition.py +27 -2
- ostk/astrodynamics/test/test_import.py +2 -2
- ostk/astrodynamics/test/test_trajectory.py +1 -1
- ostk/astrodynamics/viewer.py +1 -1
- open_space_toolkit_astrodynamics-2.2.0.dist-info/RECORD +0 -77
- 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 -416
- ostk/astrodynamics/test/event_condition/test_boolean_condition.py +0 -55
- ostk/astrodynamics/test/event_condition/test_coe_condition.py +0 -126
- ostk/astrodynamics/test/event_condition/test_instant_condition.py +0 -48
- ostk/astrodynamics/test/event_condition/test_logical_condition.py +0 -120
- ostk/astrodynamics/test/event_condition/test_real_condition.py +0 -53
- 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 -89
- ostk/astrodynamics/test/flight/system/dynamics/test_central_body_gravity.py +0 -58
- ostk/astrodynamics/test/flight/system/dynamics/test_dynamics.py +0 -37
- ostk/astrodynamics/test/flight/system/dynamics/test_position_derivative.py +0 -51
- ostk/astrodynamics/test/flight/system/dynamics/test_third_body_gravity.py +0 -67
- ostk/astrodynamics/test/flight/system/test_satellite_system.py +0 -77
- ostk/astrodynamics/test/flight/test_profile.py +0 -153
- 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/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 -112
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +0 -331
- ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +0 -130
- ostk/astrodynamics/test/trajectory/orbit/models/test_propagated.py +0 -195
- ostk/astrodynamics/test/trajectory/orbit/models/test_sgp4.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/models/test_tabulated.py +0 -380
- ostk/astrodynamics/test/trajectory/orbit/test_model.py +0 -1
- ostk/astrodynamics/test/trajectory/orbit/test_pass.py +0 -55
- ostk/astrodynamics/test/trajectory/state/coordinates_subset/test_cartesian_position.py +0 -103
- ostk/astrodynamics/test/trajectory/state/coordinates_subset/test_cartesian_velocity.py +0 -113
- ostk/astrodynamics/test/trajectory/state/test_coordinates_broker.py +0 -71
- ostk/astrodynamics/test/trajectory/state/test_coordinates_subset.py +0 -43
- ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +0 -242
- 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 -234
- ostk/astrodynamics/test/trajectory/test_state.py +0 -121
- {open_space_toolkit_astrodynamics-2.2.0.dist-info → open_space_toolkit_astrodynamics-5.0.0.dist-info}/WHEEL +0 -0
- {open_space_toolkit_astrodynamics-2.2.0.dist-info → open_space_toolkit_astrodynamics-5.0.0.dist-info}/top_level.txt +0 -0
- {open_space_toolkit_astrodynamics-2.2.0.dist-info → open_space_toolkit_astrodynamics-5.0.0.dist-info}/zip-safe +0 -0
- /ostk/{__init__.py → astrodynamics/pytrajectory/__init__.py} +0 -0
@@ -1,234 +0,0 @@
|
|
1
|
-
# Apache License 2.0
|
2
|
-
|
3
|
-
import pytest
|
4
|
-
|
5
|
-
import numpy as np
|
6
|
-
|
7
|
-
from ostk.mathematics.geometry.d3.objects import Cuboid
|
8
|
-
from ostk.mathematics.geometry.d3.objects import Composite
|
9
|
-
from ostk.mathematics.geometry.d3.objects import Point
|
10
|
-
|
11
|
-
from ostk.physics import Environment
|
12
|
-
from ostk.physics.units import Mass
|
13
|
-
from ostk.physics.time import Instant
|
14
|
-
from ostk.physics.time import DateTime
|
15
|
-
from ostk.physics.time import Scale
|
16
|
-
from ostk.physics.time import Duration
|
17
|
-
from ostk.physics.coordinate import Position
|
18
|
-
from ostk.physics.coordinate import Velocity
|
19
|
-
from ostk.physics.coordinate import Frame
|
20
|
-
from ostk.physics.environment.objects.celestial_bodies import Earth
|
21
|
-
|
22
|
-
from ostk.astrodynamics.trajectory.state import NumericalSolver
|
23
|
-
from ostk.astrodynamics.flight.system import SatelliteSystem
|
24
|
-
from ostk.astrodynamics.flight.system import Dynamics
|
25
|
-
from ostk.astrodynamics.flight.system.dynamics import CentralBodyGravity
|
26
|
-
from ostk.astrodynamics.flight.system.dynamics import PositionDerivative
|
27
|
-
from ostk.astrodynamics.trajectory import State
|
28
|
-
from ostk.astrodynamics.trajectory import Propagator
|
29
|
-
from ostk.astrodynamics.event_condition import InstantCondition
|
30
|
-
|
31
|
-
|
32
|
-
@pytest.fixture
|
33
|
-
def satellite_system() -> SatelliteSystem:
|
34
|
-
mass = Mass(90.0, Mass.Unit.Kilogram)
|
35
|
-
satellite_geometry = Composite(
|
36
|
-
Cuboid(
|
37
|
-
Point(0.0, 0.0, 0.0),
|
38
|
-
[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]],
|
39
|
-
[1.0, 0.0, 0.0],
|
40
|
-
)
|
41
|
-
)
|
42
|
-
inertia_tensor = np.identity(3)
|
43
|
-
surface_area = 0.8
|
44
|
-
drag_coefficient = 0.0
|
45
|
-
|
46
|
-
return SatelliteSystem(
|
47
|
-
mass, satellite_geometry, inertia_tensor, surface_area, drag_coefficient
|
48
|
-
)
|
49
|
-
|
50
|
-
|
51
|
-
@pytest.fixture
|
52
|
-
def environment() -> Environment:
|
53
|
-
return Environment.default()
|
54
|
-
|
55
|
-
|
56
|
-
@pytest.fixture
|
57
|
-
def state() -> State:
|
58
|
-
frame: Frame = Frame.GCRF()
|
59
|
-
position: Position = Position.meters([7500000.0, 0.0, 0.0], frame)
|
60
|
-
velocity: Velocity = Velocity.meters_per_second(
|
61
|
-
[0.0, 5335.865450622126, 5335.865450622126], frame
|
62
|
-
)
|
63
|
-
|
64
|
-
instant: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
65
|
-
return State(instant, position, velocity)
|
66
|
-
|
67
|
-
|
68
|
-
@pytest.fixture
|
69
|
-
def central_body_gravity() -> CentralBodyGravity:
|
70
|
-
return CentralBodyGravity(Earth.WGS84(20, 0))
|
71
|
-
|
72
|
-
|
73
|
-
@pytest.fixture
|
74
|
-
def position_derivative() -> PositionDerivative:
|
75
|
-
return PositionDerivative()
|
76
|
-
|
77
|
-
|
78
|
-
@pytest.fixture
|
79
|
-
def dynamics(
|
80
|
-
position_derivative: PositionDerivative, central_body_gravity: CentralBodyGravity
|
81
|
-
) -> list:
|
82
|
-
return [position_derivative, central_body_gravity]
|
83
|
-
|
84
|
-
|
85
|
-
@pytest.fixture
|
86
|
-
def numerical_solver() -> NumericalSolver:
|
87
|
-
return NumericalSolver(
|
88
|
-
NumericalSolver.LogType.NoLog,
|
89
|
-
NumericalSolver.StepperType.RungeKuttaFehlberg78,
|
90
|
-
5.0,
|
91
|
-
1.0e-15,
|
92
|
-
1.0e-15,
|
93
|
-
)
|
94
|
-
|
95
|
-
|
96
|
-
@pytest.fixture
|
97
|
-
def conditional_numerical_solver() -> NumericalSolver:
|
98
|
-
return NumericalSolver(
|
99
|
-
NumericalSolver.LogType.NoLog,
|
100
|
-
NumericalSolver.StepperType.RungeKuttaDopri5,
|
101
|
-
5.0,
|
102
|
-
1.0e-15,
|
103
|
-
1.0e-15,
|
104
|
-
)
|
105
|
-
|
106
|
-
|
107
|
-
@pytest.fixture
|
108
|
-
def event_condition(state: State) -> InstantCondition:
|
109
|
-
return InstantCondition(
|
110
|
-
InstantCondition.Criterion.StrictlyPositive,
|
111
|
-
state.get_instant() + Duration.seconds(42.0),
|
112
|
-
)
|
113
|
-
|
114
|
-
|
115
|
-
@pytest.fixture
|
116
|
-
def propagator(numerical_solver: NumericalSolver, dynamics: list[Dynamics]) -> Propagator:
|
117
|
-
return Propagator(numerical_solver, dynamics)
|
118
|
-
|
119
|
-
|
120
|
-
class TestPropagator:
|
121
|
-
def test_constructors(self, propagator: Propagator):
|
122
|
-
assert propagator is not None
|
123
|
-
assert isinstance(propagator, Propagator)
|
124
|
-
assert propagator.is_defined()
|
125
|
-
|
126
|
-
def test_access_numerical_solver(
|
127
|
-
self, propagator: Propagator, numerical_solver: NumericalSolver
|
128
|
-
):
|
129
|
-
assert propagator.access_numerical_solver() == numerical_solver
|
130
|
-
|
131
|
-
def test_get_dynamics(self, propagator: Propagator, dynamics: list):
|
132
|
-
assert propagator.get_dynamics() == dynamics
|
133
|
-
|
134
|
-
def test_set_dynamics(self, propagator: Propagator, dynamics: list):
|
135
|
-
assert len(propagator.get_dynamics()) == 2
|
136
|
-
|
137
|
-
propagator.set_dynamics(dynamics + dynamics)
|
138
|
-
|
139
|
-
assert len(propagator.get_dynamics()) == 4
|
140
|
-
|
141
|
-
def test_add_dynamics(
|
142
|
-
self, propagator: Propagator, central_body_gravity: CentralBodyGravity
|
143
|
-
):
|
144
|
-
assert len(propagator.get_dynamics()) == 2
|
145
|
-
|
146
|
-
propagator.add_dynamics(central_body_gravity)
|
147
|
-
propagator.add_dynamics(central_body_gravity)
|
148
|
-
|
149
|
-
assert len(propagator.get_dynamics()) == 4
|
150
|
-
|
151
|
-
def test_clear_dynamics(self, propagator: Propagator):
|
152
|
-
assert len(propagator.get_dynamics()) >= 1
|
153
|
-
|
154
|
-
propagator.clear_dynamics()
|
155
|
-
|
156
|
-
assert len(propagator.get_dynamics()) == 0
|
157
|
-
|
158
|
-
def test_calculate_state_at(self, propagator: Propagator, state: State):
|
159
|
-
instant: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 10, 0), Scale.UTC)
|
160
|
-
|
161
|
-
propagator_state = propagator.calculate_state_at(state, instant)
|
162
|
-
|
163
|
-
propagator_state_position_ref = np.array(
|
164
|
-
[6265892.25765909, 3024770.94961259, 3024359.72137468]
|
165
|
-
)
|
166
|
-
propagator_state_velocity_ref = np.array(
|
167
|
-
[-3974.49168221, 4468.16996776, 4466.19232746]
|
168
|
-
)
|
169
|
-
|
170
|
-
propagator_state_position = propagator_state.get_position().get_coordinates()
|
171
|
-
propagator_state_velocity = propagator_state.get_velocity().get_coordinates()
|
172
|
-
|
173
|
-
assert all(
|
174
|
-
[
|
175
|
-
round(propagator_state_position[i], 8)
|
176
|
-
== round(propagator_state_position_ref[i], 8)
|
177
|
-
for i in range(0, len(propagator_state_position_ref))
|
178
|
-
]
|
179
|
-
)
|
180
|
-
assert all(
|
181
|
-
[
|
182
|
-
round(propagator_state_velocity[i], 8)
|
183
|
-
== round(propagator_state_velocity_ref[i], 8)
|
184
|
-
for i in range(0, len(propagator_state_velocity_ref))
|
185
|
-
]
|
186
|
-
)
|
187
|
-
assert propagator_state.get_instant() == instant
|
188
|
-
|
189
|
-
def test_calculate_state_at(
|
190
|
-
self,
|
191
|
-
conditional_numerical_solver: NumericalSolver,
|
192
|
-
dynamics: list[Dynamics],
|
193
|
-
state: State,
|
194
|
-
event_condition: InstantCondition,
|
195
|
-
):
|
196
|
-
propagator: Propagator = Propagator(conditional_numerical_solver, dynamics)
|
197
|
-
|
198
|
-
instant: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 10, 0), Scale.UTC)
|
199
|
-
|
200
|
-
propagator_state = propagator.calculate_state_at(state, instant, event_condition)
|
201
|
-
|
202
|
-
assert pytest.approx(42.0, abs=1e-3) == float(
|
203
|
-
(propagator_state.get_instant() - state.get_instant()).in_seconds()
|
204
|
-
)
|
205
|
-
|
206
|
-
def test_calculate_states_at(self, propagator: Propagator, state: State):
|
207
|
-
instant_array = [
|
208
|
-
Instant.date_time(DateTime(2018, 1, 1, 0, 10, 0), Scale.UTC),
|
209
|
-
Instant.date_time(DateTime(2018, 1, 1, 0, 20, 0), Scale.UTC),
|
210
|
-
]
|
211
|
-
|
212
|
-
_ = propagator.calculate_states_at(state, instant_array)
|
213
|
-
|
214
|
-
with pytest.raises(RuntimeError):
|
215
|
-
instant_array.reverse()
|
216
|
-
propagator.calculate_states_at(state, instant_array)
|
217
|
-
|
218
|
-
def test_from_environment(
|
219
|
-
self,
|
220
|
-
numerical_solver: NumericalSolver,
|
221
|
-
environment: Environment,
|
222
|
-
satellite_system: SatelliteSystem,
|
223
|
-
):
|
224
|
-
assert Propagator.from_environment(numerical_solver, environment) is not None
|
225
|
-
|
226
|
-
assert (
|
227
|
-
Propagator.from_environment(numerical_solver, environment, satellite_system)
|
228
|
-
is not None
|
229
|
-
)
|
230
|
-
|
231
|
-
def test_default(self, environment: Environment, satellite_system: SatelliteSystem):
|
232
|
-
assert Propagator.default()
|
233
|
-
assert Propagator.default(environment) is not None
|
234
|
-
assert Propagator.default(environment, satellite_system) is not None
|
@@ -1,121 +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
|
-
|
14
|
-
from ostk.astrodynamics.trajectory import State
|
15
|
-
from ostk.astrodynamics.trajectory.state import CoordinatesBroker
|
16
|
-
from ostk.astrodynamics.trajectory.state.coordinates_subset import (
|
17
|
-
CartesianPosition,
|
18
|
-
CartesianVelocity,
|
19
|
-
)
|
20
|
-
|
21
|
-
|
22
|
-
@pytest.fixture()
|
23
|
-
def instant() -> Instant:
|
24
|
-
return Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
25
|
-
|
26
|
-
|
27
|
-
@pytest.fixture
|
28
|
-
def frame() -> Frame:
|
29
|
-
return Frame.GCRF()
|
30
|
-
|
31
|
-
|
32
|
-
@pytest.fixture()
|
33
|
-
def position(frame: Frame) -> Position:
|
34
|
-
return Position.meters([6371000.0, 0.0, 0.0], frame)
|
35
|
-
|
36
|
-
|
37
|
-
@pytest.fixture()
|
38
|
-
def velocity(frame: Frame) -> Velocity:
|
39
|
-
return Velocity.meters_per_second([7600.0, 0.0, 0.0], frame)
|
40
|
-
|
41
|
-
|
42
|
-
@pytest.fixture
|
43
|
-
def state(
|
44
|
-
instant: Instant, position: Position, velocity: Velocity, frame: Frame
|
45
|
-
) -> State:
|
46
|
-
return State(instant, position, velocity)
|
47
|
-
|
48
|
-
|
49
|
-
@pytest.fixture
|
50
|
-
def coordinates_broker() -> CoordinatesBroker:
|
51
|
-
return CoordinatesBroker([CartesianPosition.default(), CartesianVelocity.default()])
|
52
|
-
|
53
|
-
|
54
|
-
class TestState:
|
55
|
-
def test_constructor(
|
56
|
-
self,
|
57
|
-
instant: Instant,
|
58
|
-
position: Position,
|
59
|
-
velocity: Velocity,
|
60
|
-
):
|
61
|
-
state = State(instant, position, velocity)
|
62
|
-
assert state is not None
|
63
|
-
assert isinstance(state, State)
|
64
|
-
assert state.is_defined()
|
65
|
-
|
66
|
-
def test_explicit_constructor(
|
67
|
-
self,
|
68
|
-
instant: Instant,
|
69
|
-
position: Position,
|
70
|
-
velocity: Velocity,
|
71
|
-
frame: Frame,
|
72
|
-
coordinates_broker: CoordinatesBroker,
|
73
|
-
):
|
74
|
-
state = State(instant, position, velocity)
|
75
|
-
assert state is not None
|
76
|
-
assert isinstance(state, State)
|
77
|
-
assert state.is_defined()
|
78
|
-
|
79
|
-
state = State(
|
80
|
-
instant,
|
81
|
-
np.append(position.get_coordinates(), velocity.get_coordinates()),
|
82
|
-
frame,
|
83
|
-
coordinates_broker,
|
84
|
-
)
|
85
|
-
|
86
|
-
assert state is not None
|
87
|
-
assert isinstance(state, State)
|
88
|
-
assert state.is_defined()
|
89
|
-
|
90
|
-
def test_comparators(self, state: State):
|
91
|
-
assert (state == state) is True
|
92
|
-
assert (state != state) is False
|
93
|
-
|
94
|
-
def test_operators(self, state: State):
|
95
|
-
assert isinstance(state + state, State)
|
96
|
-
assert isinstance(state - state, State)
|
97
|
-
|
98
|
-
def test_getters(
|
99
|
-
self,
|
100
|
-
state: State,
|
101
|
-
instant: Instant,
|
102
|
-
position: Position,
|
103
|
-
velocity: Velocity,
|
104
|
-
frame: Frame,
|
105
|
-
):
|
106
|
-
assert state.get_instant() == instant
|
107
|
-
assert state.get_position() == position
|
108
|
-
assert state.get_velocity() == velocity
|
109
|
-
assert state.get_frame() == frame
|
110
|
-
assert (
|
111
|
-
state.get_coordinates()
|
112
|
-
== np.append(position.get_coordinates(), velocity.get_coordinates())
|
113
|
-
).all()
|
114
|
-
|
115
|
-
def test_in_frame(
|
116
|
-
self,
|
117
|
-
state: State,
|
118
|
-
frame: Frame,
|
119
|
-
):
|
120
|
-
assert state.in_frame(frame) == state
|
121
|
-
assert state.in_frame(Frame.ITRF()) != state
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|