open-space-toolkit-astrodynamics 9.0.3__py39-none-manylinux2014_aarch64.whl → 13.0.2__py39-none-manylinux2014_aarch64.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-9.0.3.dist-info → open_space_toolkit_astrodynamics-13.0.2.dist-info}/METADATA +5 -2
- {open_space_toolkit_astrodynamics-9.0.3.dist-info → open_space_toolkit_astrodynamics-13.0.2.dist-info}/RECORD +30 -28
- {open_space_toolkit_astrodynamics-9.0.3.dist-info → open_space_toolkit_astrodynamics-13.0.2.dist-info}/WHEEL +1 -1
- ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-39-aarch64-linux-gnu.so +0 -0
- ostk/astrodynamics/converters.py +36 -93
- ostk/astrodynamics/dataframe.py +479 -0
- ostk/astrodynamics/display.py +2 -0
- ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.13 +0 -0
- ostk/astrodynamics/pytrajectory/pystate.py +216 -1
- ostk/astrodynamics/test/conftest.py +2 -2
- ostk/astrodynamics/test/flight/test_maneuver.py +8 -12
- ostk/astrodynamics/test/flight/test_profile.py +155 -55
- ostk/astrodynamics/test/test_converters.py +43 -140
- ostk/astrodynamics/test/test_dataframe.py +875 -0
- ostk/astrodynamics/test/test_display.py +2 -3
- ostk/astrodynamics/test/test_event_condition.py +27 -7
- ostk/astrodynamics/test/test_trajectory.py +116 -38
- ostk/astrodynamics/test/test_utilities.py +31 -46
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +13 -0
- ostk/astrodynamics/test/trajectory/orbit/test_pass.py +9 -0
- ostk/astrodynamics/test/trajectory/state/test_coordinate_subset.py +3 -0
- ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +2 -2
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_factory.py +48 -4
- ostk/astrodynamics/test/trajectory/test_orbit.py +42 -2
- ostk/astrodynamics/test/trajectory/test_segment.py +99 -1
- ostk/astrodynamics/test/trajectory/test_sequence.py +53 -0
- ostk/astrodynamics/test/trajectory/test_state.py +306 -0
- ostk/astrodynamics/utilities.py +125 -36
- ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.9 +0 -0
- {open_space_toolkit_astrodynamics-9.0.3.dist-info → open_space_toolkit_astrodynamics-13.0.2.dist-info}/top_level.txt +0 -0
- {open_space_toolkit_astrodynamics-9.0.3.dist-info → open_space_toolkit_astrodynamics-13.0.2.dist-info}/zip-safe +0 -0
ostk/astrodynamics/utilities.py
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Apache License 2.0
|
2
2
|
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from datetime import datetime
|
6
|
+
from datetime import timezone
|
7
|
+
|
3
8
|
from .OpenSpaceToolkitAstrodynamicsPy import *
|
4
9
|
|
5
10
|
from ostk.physics import Environment
|
@@ -7,6 +12,7 @@ from ostk.physics.time import Scale
|
|
7
12
|
from ostk.physics.time import Instant
|
8
13
|
from ostk.physics.time import Duration
|
9
14
|
from ostk.physics.time import Interval
|
15
|
+
from ostk.physics.unit import Length
|
10
16
|
from ostk.physics.coordinate.spherical import LLA
|
11
17
|
from ostk.physics.coordinate.spherical import AER
|
12
18
|
from ostk.physics.coordinate import Position
|
@@ -15,18 +21,18 @@ from ostk.physics.environment.object.celestial import Earth
|
|
15
21
|
from ostk.physics.environment.gravitational import Earth as EarthGravitationalModel
|
16
22
|
|
17
23
|
|
18
|
-
def lla_from_state(state: trajectory.State) ->
|
24
|
+
def lla_from_state(state: trajectory.State) -> LLA:
|
19
25
|
"""
|
20
26
|
Return latitude (degrees), longitude (degrees), altitude (meters) float list from a state.
|
21
|
-
"""
|
22
27
|
|
23
|
-
|
28
|
+
Args:
|
29
|
+
state (trajectory.State): A state.
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
)
|
31
|
+
Returns:
|
32
|
+
LLA: The LLA.
|
33
|
+
"""
|
34
|
+
|
35
|
+
return lla_from_position(state.get_position(), state.get_instant())
|
30
36
|
|
31
37
|
|
32
38
|
def lla_from_position(
|
@@ -35,6 +41,13 @@ def lla_from_position(
|
|
35
41
|
) -> LLA:
|
36
42
|
"""
|
37
43
|
Return LLA from position and instant.
|
44
|
+
|
45
|
+
Args:
|
46
|
+
position (Position): A position.
|
47
|
+
instant (Instant): An instant.
|
48
|
+
|
49
|
+
Returns:
|
50
|
+
LLA: The LLA.
|
38
51
|
"""
|
39
52
|
|
40
53
|
if position.access_frame() != Frame.ITRF():
|
@@ -54,6 +67,12 @@ def lla_from_position(
|
|
54
67
|
def position_from_lla(lla: LLA) -> Position:
|
55
68
|
"""
|
56
69
|
Return position from lla.
|
70
|
+
|
71
|
+
Args:
|
72
|
+
lla (LLA): A LLA.
|
73
|
+
|
74
|
+
Returns:
|
75
|
+
Position: The position.
|
57
76
|
"""
|
58
77
|
|
59
78
|
return Position.meters(
|
@@ -70,9 +89,18 @@ def compute_aer(
|
|
70
89
|
from_position: Position,
|
71
90
|
to_position: Position,
|
72
91
|
environment: Environment,
|
73
|
-
) ->
|
92
|
+
) -> AER:
|
74
93
|
"""
|
75
|
-
Return
|
94
|
+
Return AER from Instant and Positions (observer, target).
|
95
|
+
|
96
|
+
Args:
|
97
|
+
instant (Instant): An instant.
|
98
|
+
from_position (Position): An observer position.
|
99
|
+
to_position (Position): A target position.
|
100
|
+
environment (Environment): An environment.
|
101
|
+
|
102
|
+
Returns:
|
103
|
+
AER: The AER.
|
76
104
|
"""
|
77
105
|
|
78
106
|
from_lla: LLA = lla_from_position(from_position, instant)
|
@@ -83,27 +111,30 @@ def compute_aer(
|
|
83
111
|
from_position_NED: Position = from_position.in_frame(ned_frame, instant)
|
84
112
|
to_position_NED: Position = to_position.in_frame(ned_frame, instant)
|
85
113
|
|
86
|
-
|
87
|
-
|
88
|
-
return (
|
89
|
-
float(aer.get_azimuth().in_degrees()),
|
90
|
-
float(aer.get_elevation().in_degrees()),
|
91
|
-
float(aer.get_range().in_meters()),
|
92
|
-
)
|
114
|
+
return AER.from_position_to_position(from_position_NED, to_position_NED, True)
|
93
115
|
|
94
116
|
|
95
|
-
def
|
117
|
+
def compute_time_lla_aer_coordinates(
|
96
118
|
state: trajectory.State,
|
97
119
|
from_position: Position,
|
98
120
|
environment: Environment,
|
99
|
-
) -> tuple[
|
121
|
+
) -> tuple[datetime, float, float, float, float, float, float]:
|
100
122
|
"""
|
101
|
-
Return [
|
123
|
+
Return [datetime, latitude, longitude, altitude, azimuth, elevation, range] from State and observer Position.
|
124
|
+
|
125
|
+
Args:
|
126
|
+
state (trajectory.State): A state.
|
127
|
+
from_position (Position): An observer position.
|
128
|
+
environment (Environment): An environment.
|
129
|
+
|
130
|
+
Returns:
|
131
|
+
tuple[datetime, float, float, float, float, float, float]: The [datetime, latitude, longitude, altitude, azimuth, elevation, range].
|
102
132
|
"""
|
103
133
|
|
104
134
|
instant: Instant = state.get_instant()
|
105
135
|
|
106
|
-
lla:
|
136
|
+
lla: LLA = lla_from_state(state)
|
137
|
+
|
107
138
|
aer: AER = compute_aer(
|
108
139
|
instant,
|
109
140
|
from_position,
|
@@ -111,44 +142,102 @@ def compute_time_lla_aer_state(
|
|
111
142
|
environment,
|
112
143
|
)
|
113
144
|
|
114
|
-
return (
|
145
|
+
return (
|
146
|
+
instant.get_date_time(Scale.UTC).replace(tzinfo=timezone.utc),
|
147
|
+
float(lla.get_latitude().in_degrees()),
|
148
|
+
float(lla.get_longitude().in_degrees()),
|
149
|
+
float(lla.get_altitude().in_meters()),
|
150
|
+
float(aer.get_azimuth().in_degrees()),
|
151
|
+
float(aer.get_elevation().in_degrees()),
|
152
|
+
float(aer.get_range().in_meters()),
|
153
|
+
)
|
115
154
|
|
116
155
|
|
117
156
|
def compute_trajectory_geometry(
|
118
157
|
trajectory: Trajectory,
|
119
158
|
interval: Interval,
|
120
|
-
|
159
|
+
step: Duration = Duration.minutes(1.0),
|
160
|
+
) -> list[LLA]:
|
121
161
|
"""
|
122
|
-
Return
|
162
|
+
Return list of LLA along a Trajectory during the Interval at the provided step.
|
163
|
+
|
164
|
+
Args:
|
165
|
+
trajectory (Trajectory): A trajectory.
|
166
|
+
interval (Interval): An interval.
|
167
|
+
step (Duration): A step. Defaults to 1.0 minutes.
|
168
|
+
|
169
|
+
Returns:
|
170
|
+
list[LLA]: The list of LLA.
|
123
171
|
"""
|
124
172
|
|
125
173
|
return [
|
126
174
|
lla_from_state(state)
|
127
|
-
for state in trajectory.get_states_at(
|
128
|
-
interval.generate_grid(Duration.minutes(1.0))
|
129
|
-
)
|
175
|
+
for state in trajectory.get_states_at(interval.generate_grid(step))
|
130
176
|
]
|
131
177
|
|
132
178
|
|
179
|
+
def compute_ground_track(
|
180
|
+
trajectory: Trajectory,
|
181
|
+
interval: Interval,
|
182
|
+
step: Duration = Duration.minutes(1.0),
|
183
|
+
) -> list[LLA]:
|
184
|
+
"""
|
185
|
+
Return list of LLA along a Trajectory ground track (altitude set to 10.0 meters) during the Interval at the provided step.
|
186
|
+
|
187
|
+
Args:
|
188
|
+
trajectory (Trajectory): A trajectory.
|
189
|
+
interval (Interval): An interval.
|
190
|
+
step (Duration): A step. Defaults to 1.0 minutes.
|
191
|
+
|
192
|
+
Returns:
|
193
|
+
list[LLA]: The list of LLA.
|
194
|
+
"""
|
195
|
+
|
196
|
+
ground_llas: list[LLA] = []
|
197
|
+
for state in trajectory.get_states_at(interval.generate_grid(step)):
|
198
|
+
lla: LLA = lla_from_state(state)
|
199
|
+
|
200
|
+
ground_lla: LLA = LLA(
|
201
|
+
lla.get_latitude(),
|
202
|
+
lla.get_longitude(),
|
203
|
+
Length.meters(10.0),
|
204
|
+
)
|
205
|
+
|
206
|
+
ground_llas.append(ground_lla)
|
207
|
+
|
208
|
+
return ground_llas
|
209
|
+
|
210
|
+
|
133
211
|
def convert_state(
|
134
212
|
state: trajectory.State,
|
135
213
|
) -> tuple[str, float, float, float, float, float, float, float, float, float]:
|
136
214
|
"""
|
137
|
-
Convert
|
215
|
+
Convert a State into dataframe-ready values.
|
216
|
+
- Instant (str)
|
217
|
+
- Modified Julian Date (float)
|
218
|
+
- Position X [meters] (float)
|
219
|
+
- Position Y [meters] (float)
|
220
|
+
- Position Z [meters] (float)
|
221
|
+
- Velocity X [meters/second] (float)
|
222
|
+
- Velocity Y [meters/second] (float)
|
223
|
+
- Velocity Z [meters/second] (float)
|
224
|
+
- Latitude [degrees] (float)
|
225
|
+
- Longitude [degrees] (float)
|
226
|
+
- Altitude [meters] (float)
|
227
|
+
|
228
|
+
Args:
|
229
|
+
state (trajectory.State): A state.
|
230
|
+
|
231
|
+
Returns:
|
232
|
+
tuple[str, float, float, float, float, float, float, float, float, float]: The dataframe-ready values.
|
138
233
|
"""
|
139
234
|
|
140
|
-
lla: LLA =
|
141
|
-
state.get_position()
|
142
|
-
.in_frame(Frame.ITRF(), state.get_instant())
|
143
|
-
.get_coordinates(),
|
144
|
-
EarthGravitationalModel.EGM2008.equatorial_radius,
|
145
|
-
EarthGravitationalModel.EGM2008.flattening,
|
146
|
-
)
|
235
|
+
lla: LLA = lla_from_state(state)
|
147
236
|
|
148
237
|
instant: Instant = state.get_instant()
|
149
238
|
|
150
239
|
return (
|
151
|
-
|
240
|
+
str(instant.to_string()),
|
152
241
|
float(instant.get_modified_julian_date(Scale.UTC)),
|
153
242
|
*state.get_position().get_coordinates().transpose().tolist(),
|
154
243
|
*state.get_velocity().get_coordinates().transpose().tolist(),
|
Binary file
|
File without changes
|
File without changes
|