open-space-toolkit-astrodynamics 12.2.1__py312-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.
- open_space_toolkit_astrodynamics-12.2.1.dist-info/METADATA +30 -0
- open_space_toolkit_astrodynamics-12.2.1.dist-info/RECORD +100 -0
- open_space_toolkit_astrodynamics-12.2.1.dist-info/WHEEL +5 -0
- open_space_toolkit_astrodynamics-12.2.1.dist-info/top_level.txt +1 -0
- open_space_toolkit_astrodynamics-12.2.1.dist-info/zip-safe +1 -0
- ostk/__init__.py +1 -0
- ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-312-x86_64-linux-gnu.so +0 -0
- ostk/astrodynamics/__init__.py +11 -0
- ostk/astrodynamics/converters.py +128 -0
- ostk/astrodynamics/dataframe.py +477 -0
- ostk/astrodynamics/display.py +220 -0
- ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.12 +0 -0
- ostk/astrodynamics/pytrajectory/__init__.py +1 -0
- ostk/astrodynamics/pytrajectory/pystate.py +220 -0
- ostk/astrodynamics/test/__init__.py +1 -0
- ostk/astrodynamics/test/access/__init__.py +1 -0
- ostk/astrodynamics/test/access/test_generator.py +248 -0
- ostk/astrodynamics/test/conftest.py +119 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/__init__.py +1 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/conftest.py +325 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/data/cdm.json +303 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/test_cdm.py +416 -0
- ostk/astrodynamics/test/dynamics/__init__.py +1 -0
- ostk/astrodynamics/test/dynamics/data/Tabulated_Earth_Gravity.csv +565 -0
- ostk/astrodynamics/test/dynamics/data/Tabulated_Earth_Gravity_Truth.csv +100 -0
- ostk/astrodynamics/test/dynamics/test_atmospheric_drag.py +128 -0
- ostk/astrodynamics/test/dynamics/test_central_body_gravity.py +58 -0
- ostk/astrodynamics/test/dynamics/test_dynamics.py +50 -0
- ostk/astrodynamics/test/dynamics/test_position_derivative.py +51 -0
- ostk/astrodynamics/test/dynamics/test_tabulated.py +138 -0
- ostk/astrodynamics/test/dynamics/test_third_body_gravity.py +67 -0
- ostk/astrodynamics/test/dynamics/test_thruster.py +142 -0
- ostk/astrodynamics/test/event_condition/test_angular_condition.py +113 -0
- ostk/astrodynamics/test/event_condition/test_boolean_condition.py +55 -0
- ostk/astrodynamics/test/event_condition/test_coe_condition.py +87 -0
- ostk/astrodynamics/test/event_condition/test_instant_condition.py +48 -0
- ostk/astrodynamics/test/event_condition/test_logical_condition.py +120 -0
- ostk/astrodynamics/test/event_condition/test_real_condition.py +50 -0
- ostk/astrodynamics/test/flight/__init__.py +1 -0
- ostk/astrodynamics/test/flight/system/__init__.py +1 -0
- ostk/astrodynamics/test/flight/system/test_propulsion_system.py +73 -0
- ostk/astrodynamics/test/flight/system/test_satellite_system.py +91 -0
- ostk/astrodynamics/test/flight/system/test_satellite_system_builder.py +71 -0
- ostk/astrodynamics/test/flight/test_maneuver.py +212 -0
- ostk/astrodynamics/test/flight/test_profile.py +242 -0
- ostk/astrodynamics/test/flight/test_system.py +55 -0
- ostk/astrodynamics/test/guidance_law/test_constant_thrust.py +91 -0
- ostk/astrodynamics/test/guidance_law/test_qlaw.py +138 -0
- ostk/astrodynamics/test/solvers/__init__.py +1 -0
- ostk/astrodynamics/test/solvers/test_finite_difference_solver.py +181 -0
- ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +153 -0
- ostk/astrodynamics/test/test_access.py +128 -0
- ostk/astrodynamics/test/test_converters.py +290 -0
- ostk/astrodynamics/test/test_dataframe.py +875 -0
- ostk/astrodynamics/test/test_display.py +114 -0
- ostk/astrodynamics/test/test_event_condition.py +58 -0
- ostk/astrodynamics/test/test_import.py +26 -0
- ostk/astrodynamics/test/test_root_solver.py +70 -0
- ostk/astrodynamics/test/test_trajectory.py +118 -0
- ostk/astrodynamics/test/test_utilities.py +106 -0
- ostk/astrodynamics/test/test_viewer.py +129 -0
- ostk/astrodynamics/test/trajectory/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/message/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/conftest.py +18 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/data/opm_1.yaml +44 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/test_opm.py +108 -0
- ostk/astrodynamics/test/trajectory/orbit/models/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean.py +65 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean_long.py +102 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean_short.py +102 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +180 -0
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +331 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +130 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_propagated.py +234 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_sgp4.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_tabulated.py +380 -0
- ostk/astrodynamics/test/trajectory/orbit/test_model.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/test_pass.py +75 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_angular_velocity.py +30 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_attitude_quaternion.py +18 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_position.py +107 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_velocity.py +115 -0
- ostk/astrodynamics/test/trajectory/state/test_coordinate_broker.py +84 -0
- ostk/astrodynamics/test/trajectory/state/test_coordinate_subset.py +46 -0
- ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +314 -0
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_direction.py +81 -0
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_factory.py +108 -0
- ostk/astrodynamics/test/trajectory/test_model.py +1 -0
- ostk/astrodynamics/test/trajectory/test_orbit.py +196 -0
- ostk/astrodynamics/test/trajectory/test_propagator.py +458 -0
- ostk/astrodynamics/test/trajectory/test_segment.py +305 -0
- ostk/astrodynamics/test/trajectory/test_sequence.py +477 -0
- ostk/astrodynamics/test/trajectory/test_state.py +467 -0
- ostk/astrodynamics/test/trajectory/test_state_builder.py +171 -0
- ostk/astrodynamics/utilities.py +245 -0
- ostk/astrodynamics/viewer.py +392 -0
@@ -0,0 +1,290 @@
|
|
1
|
+
# Apache License 2.0
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
from datetime import datetime, timedelta, timezone
|
6
|
+
|
7
|
+
from ostk.physics.time import Instant
|
8
|
+
from ostk.physics.time import Interval
|
9
|
+
from ostk.physics.time import DateTime
|
10
|
+
from ostk.physics.time import Scale
|
11
|
+
|
12
|
+
from ostk.astrodynamics.converters import coerce_to_datetime
|
13
|
+
from ostk.astrodynamics.converters import coerce_to_instant
|
14
|
+
from ostk.astrodynamics.converters import coerce_to_iso
|
15
|
+
from ostk.astrodynamics.converters import coerce_to_interval
|
16
|
+
|
17
|
+
|
18
|
+
def test_coerce_to_datetime_success_instant():
|
19
|
+
value = Instant.date_time(DateTime(2020, 1, 2, 3, 4, 5, 123, 456), Scale.UTC)
|
20
|
+
assert coerce_to_datetime(value) == datetime(
|
21
|
+
2020, 1, 2, 3, 4, 5, 123456, tzinfo=timezone.utc
|
22
|
+
)
|
23
|
+
|
24
|
+
value = Instant.date_time(DateTime(2020, 1, 2, 3, 4, 5, 123, 456), Scale.TAI)
|
25
|
+
assert coerce_to_datetime(value) == datetime(
|
26
|
+
2020, 1, 2, 3, 3, 28, 123456, tzinfo=timezone.utc
|
27
|
+
)
|
28
|
+
|
29
|
+
|
30
|
+
def test_coerce_to_datetime_success_datetime():
|
31
|
+
value = datetime(2020, 1, 2, 3, 4, 5, 123456, tzinfo=timezone.utc)
|
32
|
+
assert coerce_to_datetime(value) == value
|
33
|
+
|
34
|
+
value = datetime(
|
35
|
+
2020, 1, 2, 3, 4, 5, 123456, tzinfo=timezone(timedelta(seconds=3600))
|
36
|
+
)
|
37
|
+
assert coerce_to_datetime(value) == value
|
38
|
+
|
39
|
+
|
40
|
+
def test_coerce_to_datetime_success_iso():
|
41
|
+
value = "2020-01-02T03:04:05.123456+00:00"
|
42
|
+
assert coerce_to_datetime(value) == datetime(
|
43
|
+
2020, 1, 2, 3, 4, 5, 123456, tzinfo=timezone.utc
|
44
|
+
)
|
45
|
+
|
46
|
+
value = "2020-01-02T03:04:05+00:00"
|
47
|
+
assert coerce_to_datetime(value) == datetime(2020, 1, 2, 3, 4, 5, tzinfo=timezone.utc)
|
48
|
+
|
49
|
+
value = "2020-01-02T03:04:05.123456+01:00"
|
50
|
+
assert coerce_to_datetime(value) == datetime(
|
51
|
+
2020, 1, 2, 3, 4, 5, 123456, tzinfo=timezone(timedelta(seconds=3600))
|
52
|
+
)
|
53
|
+
|
54
|
+
value = "2020-01-02T03:04:05.123456Z"
|
55
|
+
assert coerce_to_datetime(value) == datetime(
|
56
|
+
2020, 1, 2, 3, 4, 5, 123456, tzinfo=timezone.utc
|
57
|
+
)
|
58
|
+
|
59
|
+
value = "2020-01-02T03:04:05Z"
|
60
|
+
assert coerce_to_datetime(value) == datetime(2020, 1, 2, 3, 4, 5, tzinfo=timezone.utc)
|
61
|
+
|
62
|
+
|
63
|
+
def test_coerce_to_datetime_failure():
|
64
|
+
with pytest.raises(TypeError):
|
65
|
+
coerce_to_datetime(False)
|
66
|
+
|
67
|
+
with pytest.raises(Exception):
|
68
|
+
coerce_to_datetime("some_ill_formed_iso")
|
69
|
+
|
70
|
+
|
71
|
+
def test_coerce_to_instant_success_datetime():
|
72
|
+
value = datetime(2020, 1, 2, 3, 4, 5, 123456, tzinfo=timezone.utc)
|
73
|
+
assert coerce_to_instant(value) == Instant.date_time(
|
74
|
+
DateTime(2020, 1, 2, 3, 4, 5, 123, 456), Scale.UTC
|
75
|
+
)
|
76
|
+
|
77
|
+
value = datetime(
|
78
|
+
2020, 1, 2, 3, 4, 5, 123456, tzinfo=timezone(timedelta(seconds=3600))
|
79
|
+
)
|
80
|
+
assert coerce_to_instant(value) == Instant.date_time(
|
81
|
+
DateTime(2020, 1, 2, 2, 4, 5, 123, 456), Scale.UTC
|
82
|
+
)
|
83
|
+
|
84
|
+
|
85
|
+
def test_coerce_to_instant_success_instant():
|
86
|
+
value = Instant.date_time(DateTime(2020, 1, 2, 3, 4, 5, 123, 456), Scale.UTC)
|
87
|
+
assert coerce_to_instant(value) == value
|
88
|
+
|
89
|
+
value = Instant.date_time(DateTime(2020, 1, 2, 3, 4, 5, 123, 456), Scale.TAI)
|
90
|
+
assert coerce_to_instant(value) == value
|
91
|
+
|
92
|
+
|
93
|
+
def test_coerce_to_instant_success_iso():
|
94
|
+
value = "2020-01-02T03:04:05.123456+00:00"
|
95
|
+
assert coerce_to_instant(value) == Instant.date_time(
|
96
|
+
DateTime(2020, 1, 2, 3, 4, 5, 123, 456), Scale.UTC
|
97
|
+
)
|
98
|
+
|
99
|
+
value = "2020-01-02T03:04:05+00:00"
|
100
|
+
assert coerce_to_instant(value) == Instant.date_time(
|
101
|
+
DateTime(2020, 1, 2, 3, 4, 5), Scale.UTC
|
102
|
+
)
|
103
|
+
|
104
|
+
value = "2020-01-02T03:04:05.123456+01:00"
|
105
|
+
assert coerce_to_instant(value) == Instant.date_time(
|
106
|
+
DateTime(2020, 1, 2, 2, 4, 5, 123, 456), Scale.UTC
|
107
|
+
)
|
108
|
+
|
109
|
+
value = "2020-01-02T03:04:05.123456Z"
|
110
|
+
assert coerce_to_instant(value) == Instant.date_time(
|
111
|
+
DateTime(2020, 1, 2, 3, 4, 5, 123, 456), Scale.UTC
|
112
|
+
)
|
113
|
+
|
114
|
+
value = "2020-01-02T03:04:05Z"
|
115
|
+
assert coerce_to_instant(value) == Instant.date_time(
|
116
|
+
DateTime(
|
117
|
+
2020,
|
118
|
+
1,
|
119
|
+
2,
|
120
|
+
3,
|
121
|
+
4,
|
122
|
+
5,
|
123
|
+
),
|
124
|
+
Scale.UTC,
|
125
|
+
)
|
126
|
+
|
127
|
+
|
128
|
+
def test_coerce_to_instant_failure():
|
129
|
+
with pytest.raises(TypeError):
|
130
|
+
coerce_to_instant(False)
|
131
|
+
|
132
|
+
with pytest.raises(Exception):
|
133
|
+
coerce_to_instant("some_ill_formed_iso")
|
134
|
+
|
135
|
+
|
136
|
+
def test_coerce_to_iso_success_datetime():
|
137
|
+
value = datetime(2020, 1, 2, 3, 4, 5, 123456, tzinfo=timezone.utc)
|
138
|
+
assert (
|
139
|
+
coerce_to_iso(value, timespec="microseconds")
|
140
|
+
== "2020-01-02T03:04:05.123456+00:00"
|
141
|
+
)
|
142
|
+
|
143
|
+
value = datetime(
|
144
|
+
2020, 1, 2, 3, 4, 5, 123456, tzinfo=timezone(timedelta(seconds=3600))
|
145
|
+
)
|
146
|
+
assert (
|
147
|
+
coerce_to_iso(value, timespec="microseconds")
|
148
|
+
== "2020-01-02T03:04:05.123456+01:00"
|
149
|
+
)
|
150
|
+
|
151
|
+
value = datetime(2020, 1, 2, 3, 4, 5, 123456, tzinfo=timezone.utc)
|
152
|
+
assert (
|
153
|
+
coerce_to_iso(value, timespec="milliseconds") == "2020-01-02T03:04:05.123+00:00"
|
154
|
+
)
|
155
|
+
|
156
|
+
value = datetime(2020, 1, 2, 3, 4, 5, 0, tzinfo=timezone.utc)
|
157
|
+
assert (
|
158
|
+
coerce_to_iso(value, timespec="microseconds")
|
159
|
+
== "2020-01-02T03:04:05.000000+00:00"
|
160
|
+
)
|
161
|
+
|
162
|
+
|
163
|
+
def test_coerce_to_iso_success_instant():
|
164
|
+
value = Instant.date_time(DateTime(2020, 1, 2, 3, 4, 5, 123, 456), Scale.UTC)
|
165
|
+
assert (
|
166
|
+
coerce_to_iso(value, timespec="microseconds")
|
167
|
+
== "2020-01-02T03:04:05.123456+00:00"
|
168
|
+
)
|
169
|
+
|
170
|
+
value = Instant.date_time(DateTime(2020, 1, 2, 3, 4, 5, 123, 456), Scale.TAI)
|
171
|
+
assert (
|
172
|
+
coerce_to_iso(value, timespec="microseconds")
|
173
|
+
== "2020-01-02T03:03:28.123456+00:00"
|
174
|
+
)
|
175
|
+
|
176
|
+
value = Instant.date_time(DateTime(2020, 1, 2, 3, 4, 5, 123, 456), Scale.UTC)
|
177
|
+
assert (
|
178
|
+
coerce_to_iso(value, timespec="milliseconds") == "2020-01-02T03:04:05.123+00:00"
|
179
|
+
)
|
180
|
+
|
181
|
+
value = Instant.date_time(DateTime(2020, 1, 2, 3, 4, 5, 123), Scale.UTC)
|
182
|
+
assert (
|
183
|
+
coerce_to_iso(value, timespec="microseconds")
|
184
|
+
== "2020-01-02T03:04:05.123000+00:00"
|
185
|
+
)
|
186
|
+
|
187
|
+
|
188
|
+
def test_coerce_to_iso_success_iso():
|
189
|
+
value = "2020-01-02T03:04:05.123456+00:00"
|
190
|
+
assert coerce_to_iso(value, timespec="microseconds") == value
|
191
|
+
|
192
|
+
value = "2020-01-02T03:04:05.123456+01:00"
|
193
|
+
assert coerce_to_iso(value, timespec="microseconds") == value
|
194
|
+
|
195
|
+
value = "2020-01-02T03:04:05.123456+00:00"
|
196
|
+
assert (
|
197
|
+
coerce_to_iso(value, timespec="milliseconds") == "2020-01-02T03:04:05.123+00:00"
|
198
|
+
)
|
199
|
+
|
200
|
+
value = "2020-01-02T03:04:05.123+00:00"
|
201
|
+
assert (
|
202
|
+
coerce_to_iso(value, timespec="microseconds")
|
203
|
+
== "2020-01-02T03:04:05.123000+00:00"
|
204
|
+
)
|
205
|
+
|
206
|
+
value = "2020-01-02T03:04:05+00:00"
|
207
|
+
assert (
|
208
|
+
coerce_to_iso(value, timespec="microseconds")
|
209
|
+
== "2020-01-02T03:04:05.000000+00:00"
|
210
|
+
)
|
211
|
+
|
212
|
+
value = "2020-01-02T03:04:05.123456Z"
|
213
|
+
assert (
|
214
|
+
coerce_to_iso(value, timespec="microseconds")
|
215
|
+
== "2020-01-02T03:04:05.123456+00:00"
|
216
|
+
)
|
217
|
+
|
218
|
+
value = "2020-01-02T03:04:05.123456Z"
|
219
|
+
assert (
|
220
|
+
coerce_to_iso(value, timespec="milliseconds") == "2020-01-02T03:04:05.123+00:00"
|
221
|
+
)
|
222
|
+
|
223
|
+
value = "2020-01-02T03:04:05.123Z"
|
224
|
+
assert (
|
225
|
+
coerce_to_iso(value, timespec="microseconds")
|
226
|
+
== "2020-01-02T03:04:05.123000+00:00"
|
227
|
+
)
|
228
|
+
|
229
|
+
value = "2020-01-02T03:04:05Z"
|
230
|
+
assert (
|
231
|
+
coerce_to_iso(value, timespec="microseconds")
|
232
|
+
== "2020-01-02T03:04:05.000000+00:00"
|
233
|
+
)
|
234
|
+
|
235
|
+
|
236
|
+
def test_coerce_to_iso_failure():
|
237
|
+
with pytest.raises(TypeError):
|
238
|
+
coerce_to_iso(False)
|
239
|
+
|
240
|
+
with pytest.raises(Exception):
|
241
|
+
coerce_to_iso("some_ill_formed_iso")
|
242
|
+
|
243
|
+
|
244
|
+
@pytest.mark.parametrize(
|
245
|
+
"value",
|
246
|
+
[
|
247
|
+
(
|
248
|
+
Interval.closed(
|
249
|
+
Instant.date_time(DateTime(2020, 1, 1), Scale.UTC),
|
250
|
+
Instant.date_time(DateTime(2020, 1, 2), Scale.UTC),
|
251
|
+
)
|
252
|
+
),
|
253
|
+
(
|
254
|
+
(
|
255
|
+
Instant.date_time(DateTime(2020, 1, 1), Scale.UTC),
|
256
|
+
Instant.date_time(DateTime(2020, 1, 2), Scale.UTC),
|
257
|
+
)
|
258
|
+
),
|
259
|
+
(
|
260
|
+
[
|
261
|
+
Instant.date_time(DateTime(2020, 1, 1), Scale.UTC),
|
262
|
+
Instant.date_time(DateTime(2020, 1, 2), Scale.UTC),
|
263
|
+
]
|
264
|
+
),
|
265
|
+
(
|
266
|
+
(
|
267
|
+
datetime(2020, 1, 1, tzinfo=timezone.utc),
|
268
|
+
datetime(2020, 1, 2, tzinfo=timezone.utc),
|
269
|
+
)
|
270
|
+
),
|
271
|
+
(
|
272
|
+
[
|
273
|
+
datetime(2020, 1, 1, tzinfo=timezone.utc),
|
274
|
+
datetime(2020, 1, 2, tzinfo=timezone.utc),
|
275
|
+
]
|
276
|
+
),
|
277
|
+
(
|
278
|
+
[
|
279
|
+
"2020-01-01T00:00:00Z",
|
280
|
+
"2020-01-02T00:00:00Z",
|
281
|
+
]
|
282
|
+
),
|
283
|
+
("[2020-01-01T00:00:00Z - 2020-01-02T00:00:00Z] [UTC]"),
|
284
|
+
],
|
285
|
+
)
|
286
|
+
def test_coerce_to_interval(value):
|
287
|
+
assert coerce_to_interval(value) == Interval.closed(
|
288
|
+
Instant.date_time(DateTime(2020, 1, 1), Scale.UTC),
|
289
|
+
Instant.date_time(DateTime(2020, 1, 2), Scale.UTC),
|
290
|
+
)
|