open-space-toolkit-astrodynamics 10.1.0__py38-none-manylinux2014_x86_64.whl → 11.0.0__py38-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-10.1.0.dist-info → open_space_toolkit_astrodynamics-11.0.0.dist-info}/METADATA +2 -2
- {open_space_toolkit_astrodynamics-10.1.0.dist-info → open_space_toolkit_astrodynamics-11.0.0.dist-info}/RECORD +9 -9
- ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-38-x86_64-linux-gnu.so +0 -0
- ostk/astrodynamics/converters.py +8 -89
- ostk/astrodynamics/{libopen-space-toolkit-astrodynamics.so.10 → libopen-space-toolkit-astrodynamics.so.11} +0 -0
- ostk/astrodynamics/test/test_converters.py +0 -94
- {open_space_toolkit_astrodynamics-10.1.0.dist-info → open_space_toolkit_astrodynamics-11.0.0.dist-info}/WHEEL +0 -0
- {open_space_toolkit_astrodynamics-10.1.0.dist-info → open_space_toolkit_astrodynamics-11.0.0.dist-info}/top_level.txt +0 -0
- {open_space_toolkit_astrodynamics-10.1.0.dist-info → open_space_toolkit_astrodynamics-11.0.0.dist-info}/zip-safe +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: open-space-toolkit-astrodynamics
|
3
|
-
Version:
|
3
|
+
Version: 11.0.0
|
4
4
|
Summary: Orbit, attitude, access.
|
5
5
|
Author: Open Space Collective
|
6
6
|
Author-email: contact@open-space-collective.org
|
@@ -14,7 +14,7 @@ Description-Content-Type: text/markdown
|
|
14
14
|
Requires-Dist: open-space-toolkit-core ~=4.0
|
15
15
|
Requires-Dist: open-space-toolkit-io ~=4.0
|
16
16
|
Requires-Dist: open-space-toolkit-mathematics ~=4.0
|
17
|
-
Requires-Dist: open-space-toolkit-physics ~=
|
17
|
+
Requires-Dist: open-space-toolkit-physics ~=9.0
|
18
18
|
|
19
19
|
# Open Space Toolkit ▸ Astrodynamics
|
20
20
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
ostk/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
|
2
|
-
ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-38-x86_64-linux-gnu.so,sha256=
|
2
|
+
ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-38-x86_64-linux-gnu.so,sha256=B2ZMjxruLB8ePO8sucRpi1QnkRniyWjIi_K1WRpj-tM,2320224
|
3
3
|
ostk/astrodynamics/__init__.py,sha256=3gWyqFIbhAfcdeMhmfBPQPlPQTmaOzm-6flkJe745Zk,251
|
4
|
-
ostk/astrodynamics/converters.py,sha256=
|
4
|
+
ostk/astrodynamics/converters.py,sha256=xr1BDaY2od8IsNq-3isubaxainncgH8_yihZ6Mf38n4,2697
|
5
5
|
ostk/astrodynamics/dataframe.py,sha256=njimcfT2cvnSOp9eBR1Ej-LuYpXbVieAVEBk2tYW4Vg,18761
|
6
6
|
ostk/astrodynamics/display.py,sha256=KiEGsjNftQfoUe-HfZeYpQQQ4TkaEnxtEl6p5_LX5f0,6303
|
7
|
-
ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.
|
7
|
+
ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.11,sha256=XmhByJcM3gjA7ThpbM9IcXgJrPku-61SLe-cnIESNUQ,81543536
|
8
8
|
ostk/astrodynamics/utilities.py,sha256=Yu5Yydq22gNIHi6ylqeujDENcueb1JfUE6d93h1m9XE,4795
|
9
9
|
ostk/astrodynamics/viewer.py,sha256=8UxqsvU5wui7gPUwxXaKcIB-509NJiih9Df3mQgXyXY,11776
|
10
10
|
ostk/astrodynamics/pytrajectory/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
|
@@ -12,7 +12,7 @@ ostk/astrodynamics/pytrajectory/pystate.py,sha256=ByOq8szit74xQ-pnLz0uGGxM6Jqfa1
|
|
12
12
|
ostk/astrodynamics/test/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
|
13
13
|
ostk/astrodynamics/test/conftest.py,sha256=fsdUQnLxyfvBzfaSCkgipkPIhkPHchQqbeAro1pF648,2717
|
14
14
|
ostk/astrodynamics/test/test_access.py,sha256=MCBsUPtuVm7NgHZR0z0DpWnPZ_qBu4aRhLI2PnRNUYs,3940
|
15
|
-
ostk/astrodynamics/test/test_converters.py,sha256=
|
15
|
+
ostk/astrodynamics/test/test_converters.py,sha256=ommyONkpTnhm3GHtCRe_NMtD-SBtb0vD4LGXK6nhNuU,9098
|
16
16
|
ostk/astrodynamics/test/test_dataframe.py,sha256=IJMOODzTVYtiPxekmltH6lOMArPXbHwSEAl-jg0Ab2g,28414
|
17
17
|
ostk/astrodynamics/test/test_display.py,sha256=Ykvw2rUWWw8jsX0Suy11X27bHjwm_ira__xj0ZyHHxw,3672
|
18
18
|
ostk/astrodynamics/test/test_event_condition.py,sha256=mhMTH7wAoYFWRYt_8l2d1vjNPrFhVjMAEET4INLCVXY,1472
|
@@ -93,8 +93,8 @@ ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_angular_velocity
|
|
93
93
|
ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_attitude_quaternion.py,sha256=UEu9ApzQLmT87eeISw6_gcHTlX-4b2scIvHz-uE1p_c,393
|
94
94
|
ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_position.py,sha256=XvHdk1KjacTwtkgx2jUAc9I9N3nvjPDv03FAanpv8jQ,2702
|
95
95
|
ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_velocity.py,sha256=-kd5TZO5TICihbkqDTew2i_tDpggdpe3Yf23046FATM,3057
|
96
|
-
open_space_toolkit_astrodynamics-
|
97
|
-
open_space_toolkit_astrodynamics-
|
98
|
-
open_space_toolkit_astrodynamics-
|
99
|
-
open_space_toolkit_astrodynamics-
|
100
|
-
open_space_toolkit_astrodynamics-
|
96
|
+
open_space_toolkit_astrodynamics-11.0.0.dist-info/METADATA,sha256=0ZTpDEecCCUbgUUTqTyPq-c-1eUWKUEbQ_x1l9tNZcE,1916
|
97
|
+
open_space_toolkit_astrodynamics-11.0.0.dist-info/WHEEL,sha256=q7bGkHj5-uO8ZVDbDA9JExe7sSDQsY_6S4LJ3oOcV_Y,109
|
98
|
+
open_space_toolkit_astrodynamics-11.0.0.dist-info/top_level.txt,sha256=zOR18699uDYnafgarhL8WU_LmTZY_5NVqutv-flp_x4,5
|
99
|
+
open_space_toolkit_astrodynamics-11.0.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
100
|
+
open_space_toolkit_astrodynamics-11.0.0.dist-info/RECORD,,
|
Binary file
|
ostk/astrodynamics/converters.py
CHANGED
@@ -1,18 +1,10 @@
|
|
1
1
|
# Apache License 2.0
|
2
2
|
|
3
|
-
from datetime import datetime,
|
4
|
-
|
5
|
-
import numpy as np
|
6
|
-
|
7
|
-
from ostk.mathematics.geometry.d3.transformation.rotation import Quaternion
|
3
|
+
from datetime import datetime, timezone
|
8
4
|
|
9
5
|
from ostk.physics.time import Instant
|
10
6
|
from ostk.physics.time import Interval
|
11
|
-
from ostk.physics.time import Duration
|
12
7
|
from ostk.physics.time import Scale
|
13
|
-
from ostk.physics.coordinate import Position
|
14
|
-
from ostk.physics.coordinate import Velocity
|
15
|
-
from ostk.physics.coordinate import Frame
|
16
8
|
|
17
9
|
|
18
10
|
def coerce_to_datetime(value: Instant | datetime | str) -> datetime:
|
@@ -33,6 +25,9 @@ def coerce_to_datetime(value: Instant | datetime | str) -> datetime:
|
|
33
25
|
return value.get_date_time(Scale.UTC).replace(tzinfo=timezone.utc)
|
34
26
|
|
35
27
|
if isinstance(value, str):
|
28
|
+
if value.endswith("Z"):
|
29
|
+
value = value.replace("Z", "+00:00")
|
30
|
+
|
36
31
|
return datetime.fromisoformat(value)
|
37
32
|
|
38
33
|
raise TypeError("Argument must be a datetime, an Instant, or a str.")
|
@@ -86,13 +81,15 @@ def coerce_to_iso(value: Instant | datetime | str, timespec: str = "microseconds
|
|
86
81
|
|
87
82
|
|
88
83
|
def coerce_to_interval(
|
89
|
-
value:
|
84
|
+
value: (
|
85
|
+
Interval | tuple[Instant, Instant] | tuple[datetime, datetime] | tuple[str, str]
|
86
|
+
),
|
90
87
|
) -> Interval:
|
91
88
|
"""
|
92
89
|
Return Interval from value.
|
93
90
|
|
94
91
|
Args:
|
95
|
-
value (Interval | tuple[Instant, Instant] | tuple[datetime, datetime]): A value to coerce.
|
92
|
+
value (Interval | tuple[Instant, Instant] | tuple[datetime, datetime] | tuple[str, str]): A value to coerce.
|
96
93
|
|
97
94
|
Returns:
|
98
95
|
Interval: The coerced Interval.
|
@@ -105,81 +102,3 @@ def coerce_to_interval(
|
|
105
102
|
start_instant=coerce_to_instant(value[0]),
|
106
103
|
end_instant=coerce_to_instant(value[1]),
|
107
104
|
)
|
108
|
-
|
109
|
-
|
110
|
-
def coerce_to_duration(value: Duration | timedelta) -> Duration:
|
111
|
-
"""
|
112
|
-
Return Duration from value.
|
113
|
-
|
114
|
-
Args:
|
115
|
-
value (Duration | datetime): A value to coerce.
|
116
|
-
|
117
|
-
Returns:
|
118
|
-
Duration: The coerced Duration.
|
119
|
-
"""
|
120
|
-
|
121
|
-
if isinstance(value, Duration):
|
122
|
-
return value
|
123
|
-
|
124
|
-
return Duration.seconds(value.total_seconds())
|
125
|
-
|
126
|
-
|
127
|
-
def coerce_to_position(
|
128
|
-
value: Position | tuple[float, float, float] | list[float] | np.ndarray,
|
129
|
-
frame: Frame,
|
130
|
-
) -> Position:
|
131
|
-
"""
|
132
|
-
Return Position from value.
|
133
|
-
|
134
|
-
Args:
|
135
|
-
value (Position | tuple[float, float, float] | list[float] | np.ndarray): A value to coerce.
|
136
|
-
frame (Frame): A reference frame.
|
137
|
-
|
138
|
-
Returns:
|
139
|
-
Position: The coerced Position.
|
140
|
-
"""
|
141
|
-
|
142
|
-
if isinstance(value, Position):
|
143
|
-
return value
|
144
|
-
|
145
|
-
return Position.meters(value, frame)
|
146
|
-
|
147
|
-
|
148
|
-
def coerce_to_velocity(
|
149
|
-
value: Velocity | tuple[float, float, float] | list[float] | np.ndarray,
|
150
|
-
frame: Frame,
|
151
|
-
) -> Velocity:
|
152
|
-
"""
|
153
|
-
Return Velocity from value.
|
154
|
-
|
155
|
-
Args:
|
156
|
-
value (Velocity | tuple[float, float, float] | list[float] | np.ndarray): A value to coerce.
|
157
|
-
frame (Frame): A reference frame.
|
158
|
-
|
159
|
-
Returns:
|
160
|
-
Velocity: The coerced Velocity.
|
161
|
-
"""
|
162
|
-
|
163
|
-
if isinstance(value, Velocity):
|
164
|
-
return value
|
165
|
-
|
166
|
-
return Velocity.meters_per_second(value, frame)
|
167
|
-
|
168
|
-
|
169
|
-
def coerce_to_quaternion(
|
170
|
-
value: Quaternion | tuple[float, float, float, float] | list[float] | np.ndarray
|
171
|
-
) -> Quaternion:
|
172
|
-
"""
|
173
|
-
Return quaternion from value.
|
174
|
-
|
175
|
-
Args:
|
176
|
-
value (Quaternion | tuple[float, float, float, float] | list[float] | np.ndarray): A value to coerce.
|
177
|
-
|
178
|
-
Returns:
|
179
|
-
Quaternion: The coerced Quaternion.
|
180
|
-
"""
|
181
|
-
|
182
|
-
if isinstance(value, Quaternion):
|
183
|
-
return value
|
184
|
-
|
185
|
-
return Quaternion(vector=value, format=Quaternion.Format.XYZS)
|
Binary file
|
@@ -4,27 +4,15 @@ import pytest
|
|
4
4
|
|
5
5
|
from datetime import datetime, timedelta, timezone
|
6
6
|
|
7
|
-
import numpy as np
|
8
|
-
|
9
|
-
from ostk.mathematics.geometry.d3.transformation.rotation import Quaternion
|
10
|
-
|
11
7
|
from ostk.physics.time import Instant
|
12
8
|
from ostk.physics.time import Interval
|
13
|
-
from ostk.physics.time import Duration
|
14
9
|
from ostk.physics.time import DateTime
|
15
10
|
from ostk.physics.time import Scale
|
16
|
-
from ostk.physics.coordinate import Position
|
17
|
-
from ostk.physics.coordinate import Velocity
|
18
|
-
from ostk.physics.coordinate import Frame
|
19
11
|
|
20
12
|
from ostk.astrodynamics.converters import coerce_to_datetime
|
21
13
|
from ostk.astrodynamics.converters import coerce_to_instant
|
22
14
|
from ostk.astrodynamics.converters import coerce_to_iso
|
23
15
|
from ostk.astrodynamics.converters import coerce_to_interval
|
24
|
-
from ostk.astrodynamics.converters import coerce_to_duration
|
25
|
-
from ostk.astrodynamics.converters import coerce_to_position
|
26
|
-
from ostk.astrodynamics.converters import coerce_to_velocity
|
27
|
-
from ostk.astrodynamics.converters import coerce_to_quaternion
|
28
16
|
|
29
17
|
|
30
18
|
def test_coerce_to_datetime_success_instant():
|
@@ -303,85 +291,3 @@ def test_coerce_to_interval_success_list_datetime():
|
|
303
291
|
Instant.date_time(DateTime(2020, 1, 1), Scale.UTC),
|
304
292
|
Instant.date_time(DateTime(2020, 1, 2), Scale.UTC),
|
305
293
|
)
|
306
|
-
|
307
|
-
|
308
|
-
def test_coerce_to_duration_success_duration():
|
309
|
-
value = Duration.seconds(1.0)
|
310
|
-
assert coerce_to_duration(value) == value
|
311
|
-
|
312
|
-
|
313
|
-
def test_coerce_to_duration_success_timedelta():
|
314
|
-
value = timedelta(seconds=1.0)
|
315
|
-
assert coerce_to_duration(value) == Duration.seconds(1.0)
|
316
|
-
|
317
|
-
|
318
|
-
def test_coerce_to_position_success_position():
|
319
|
-
value = Position.meters((1.0, 2.0, 3.0), Frame.GCRF())
|
320
|
-
assert coerce_to_position(value, Frame.GCRF()) == value
|
321
|
-
|
322
|
-
|
323
|
-
def test_coerce_to_position_success_tuple_float():
|
324
|
-
value = (1.0, 2.0, 3.0)
|
325
|
-
assert coerce_to_position(value, Frame.GCRF()) == Position.meters(
|
326
|
-
(1.0, 2.0, 3.0), Frame.GCRF()
|
327
|
-
)
|
328
|
-
|
329
|
-
|
330
|
-
def test_coerce_to_position_success_list_float():
|
331
|
-
value = [1.0, 2.0, 3.0]
|
332
|
-
assert coerce_to_position(value, Frame.GCRF()) == Position.meters(
|
333
|
-
(1.0, 2.0, 3.0), Frame.GCRF()
|
334
|
-
)
|
335
|
-
|
336
|
-
|
337
|
-
def test_coerce_to_position_success_np_array():
|
338
|
-
value = np.array((1.0, 2.0, 3.0))
|
339
|
-
assert coerce_to_position(value, Frame.GCRF()) == Position.meters(
|
340
|
-
(1.0, 2.0, 3.0), Frame.GCRF()
|
341
|
-
)
|
342
|
-
|
343
|
-
|
344
|
-
def test_coerce_to_velocity_success_velocity():
|
345
|
-
value = Velocity.meters_per_second((1.0, 2.0, 3.0), Frame.GCRF())
|
346
|
-
assert coerce_to_velocity(value, Frame.GCRF()) == value
|
347
|
-
|
348
|
-
|
349
|
-
def test_coerce_to_velocity_success_tuple_float():
|
350
|
-
value = (1.0, 2.0, 3.0)
|
351
|
-
assert coerce_to_velocity(value, Frame.GCRF()) == Velocity.meters_per_second(
|
352
|
-
(1.0, 2.0, 3.0), Frame.GCRF()
|
353
|
-
)
|
354
|
-
|
355
|
-
|
356
|
-
def test_coerce_to_velocity_success_list_float():
|
357
|
-
value = [1.0, 2.0, 3.0]
|
358
|
-
assert coerce_to_velocity(value, Frame.GCRF()) == Velocity.meters_per_second(
|
359
|
-
(1.0, 2.0, 3.0), Frame.GCRF()
|
360
|
-
)
|
361
|
-
|
362
|
-
|
363
|
-
def test_coerce_to_velocity_success_np_array():
|
364
|
-
value = np.array((1.0, 2.0, 3.0))
|
365
|
-
assert coerce_to_velocity(value, Frame.GCRF()) == Velocity.meters_per_second(
|
366
|
-
(1.0, 2.0, 3.0), Frame.GCRF()
|
367
|
-
)
|
368
|
-
|
369
|
-
|
370
|
-
def test_coerce_to_quaternion_success_quaternion():
|
371
|
-
value = Quaternion.xyzs(1.0, 2.0, 3.0, 4.0)
|
372
|
-
assert coerce_to_quaternion(value) == value
|
373
|
-
|
374
|
-
|
375
|
-
def test_coerce_to_quaternion_success_list_float():
|
376
|
-
value = [1.0, 2.0, 3.0, 4.0]
|
377
|
-
assert coerce_to_quaternion(value) == Quaternion.xyzs(1.0, 2.0, 3.0, 4.0)
|
378
|
-
|
379
|
-
|
380
|
-
def test_coerce_to_quaternion_success_np_array():
|
381
|
-
value = np.array((1.0, 2.0, 3.0, 4.0))
|
382
|
-
assert coerce_to_quaternion(value) == Quaternion.xyzs(1.0, 2.0, 3.0, 4.0)
|
383
|
-
|
384
|
-
|
385
|
-
def test_coerce_to_quaternion_success_tuple_float():
|
386
|
-
value = (1.0, 2.0, 3.0, 4.0)
|
387
|
-
assert coerce_to_quaternion(value) == Quaternion.xyzs(1.0, 2.0, 3.0, 4.0)
|
File without changes
|
File without changes
|
File without changes
|