open-space-toolkit-astrodynamics 16.0.0__py310-none-manylinux2014_x86_64.whl → 16.1.0__py310-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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: open-space-toolkit-astrodynamics
3
- Version: 16.0.0
3
+ Version: 16.1.0
4
4
  Summary: Orbit, attitude, access.
5
5
  Author: Open Space Collective
6
6
  Author-email: contact@open-space-collective.org
@@ -1,7 +1,7 @@
1
1
  ostk/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
2
2
  ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-310-x86_64-linux-gnu.so,sha256=OkZEmNvtEUdUR2CeaBLPBENFe65SgVBbW41iurUYqAE,2840848
3
3
  ostk/astrodynamics/__init__.py,sha256=3gWyqFIbhAfcdeMhmfBPQPlPQTmaOzm-6flkJe745Zk,251
4
- ostk/astrodynamics/__init__.pyi,sha256=i9DJa2OYbH23iMWK_iZPCfDnk3hs9wPuRdvSDnwv8yI,32193
4
+ ostk/astrodynamics/__init__.pyi,sha256=Y5kY-6XRKF0pfiBTgJmv84us9MhK1gAdeXpMvmcBiIM,32193
5
5
  ostk/astrodynamics/access.pyi,sha256=t2CF0TU6_6ow_rkV_I4rVKap7ZIdC4jYKL3WkTDHRXg,25157
6
6
  ostk/astrodynamics/converters.py,sha256=luPh30qMp9bzEkN7hUccmxlLf7zRp_AzqmBe8IUjPhU,3314
7
7
  ostk/astrodynamics/converters.pyi,sha256=HrZFyizkc6Hv_K38ZKZ80fX_bAxd6keA_NFWNQygvbs,1745
@@ -14,7 +14,7 @@ ostk/astrodynamics/guidance_law.pyi,sha256=rVmbpV2Y5FsIXejaInxINS67nVHmTIxVEkhaD
14
14
  ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.16,sha256=K8Pnig_cKlxFlypbFxHQAIRtFp1_3pI_9ezyr5jjOR4,122033672
15
15
  ostk/astrodynamics/solver.pyi,sha256=sPqyYPXBfFGC24dzzYyFyt01VfMAlWQ5_gh_RpeaBFk,17734
16
16
  ostk/astrodynamics/utilities.py,sha256=y8mr3M46J5z-GhS1oIEnuEJA6otwcyJ9YDhvn_5JxHM,6976
17
- ostk/astrodynamics/viewer.py,sha256=-Q4migLFOB9dNzs6TRPIXHNewyV5udsDSpcSma0kv8A,16376
17
+ ostk/astrodynamics/viewer.py,sha256=PLznIOEArRlx-pfMHpGoszNRf2F8mf2SHe8CGvZrVnw,16740
18
18
  ostk/astrodynamics/conjunction/__init__.pyi,sha256=HFvWl8bCmrq3cBkUh5X5RGIh8webmVGxaZdpsz3WN-E,79
19
19
  ostk/astrodynamics/conjunction/message/__init__.pyi,sha256=5H__sg_QUx7ybf9jtVWvXzrUHeK3ECotfhddAdHjJUc,75
20
20
  ostk/astrodynamics/conjunction/message/ccsds.pyi,sha256=1Peto19hRqlD7KHf1cyLP3CT4OAKzwtemqvO6_4FZ0g,28162
@@ -26,8 +26,8 @@ ostk/astrodynamics/flight/profile/__init__.pyi,sha256=WBTG17V59UwD-X1r6TOrXT_rA3
26
26
  ostk/astrodynamics/flight/profile/model.pyi,sha256=g5Uy2ZLxImuETrMP4jqXr5FXl2dGAoKuNgzOH07EdBo,6807
27
27
  ostk/astrodynamics/pytrajectory/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
28
28
  ostk/astrodynamics/pytrajectory/__init__.pyi,sha256=QWrGyQNiICBEI3pKku2wJYdu-SQCBKXjJ_93XTEgkP8,79
29
- ostk/astrodynamics/pytrajectory/pystate.py,sha256=c0wR5OJn070ImwVJtW25XhEW7d2_8jkAd168Fo9u6K8,7959
30
- ostk/astrodynamics/pytrajectory/pystate.pyi,sha256=dbYwAoyZo9ZgLjms8nH9s_OhxlmxMLLILR-wXGqphbw,3320
29
+ ostk/astrodynamics/pytrajectory/pystate.py,sha256=HbWtj1_FXGXTuvSu52ewMaO3ahwLBLStyJ4e5xqL-jw,8415
30
+ ostk/astrodynamics/pytrajectory/pystate.pyi,sha256=ljE5Q9Y56dpWgxY75ji9ibrTWIJTXeO29_foHBPxGs4,3413
31
31
  ostk/astrodynamics/test/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
32
32
  ostk/astrodynamics/test/conftest.py,sha256=stmQOt7UXjBlXKJzNN6RkS2miv1xXSOX-YNpFhaHTqI,2771
33
33
  ostk/astrodynamics/test/test_access.py,sha256=MCBsUPtuVm7NgHZR0z0DpWnPZ_qBu4aRhLI2PnRNUYs,3940
@@ -89,7 +89,7 @@ ostk/astrodynamics/test/trajectory/test_orbit.py,sha256=vp7gDMtjO7nqERe0yq1OQZ0p
89
89
  ostk/astrodynamics/test/trajectory/test_propagator.py,sha256=ALjMvzndO9r6dVVXllk0iqu61tEoqu2j25MtzEitDIQ,14076
90
90
  ostk/astrodynamics/test/trajectory/test_segment.py,sha256=aXdF5CpNLwN_hKRU5sG3ID3hJR-NZ1_kgtNA-xHMBkM,12223
91
91
  ostk/astrodynamics/test/trajectory/test_sequence.py,sha256=4piYpMZ9C_eCXxaOcdz2We67wZxhsNBnETgKwvq6dl0,15083
92
- ostk/astrodynamics/test/trajectory/test_state.py,sha256=th1BvTIhmgsPPFTbVnpR3URvqYFrf0oyluJyoPP7TPI,17135
92
+ ostk/astrodynamics/test/trajectory/test_state.py,sha256=JO-SnUCRZ6sfVNwB5soT5c1f8c5DXuFN5lHZkiiTcYc,18119
93
93
  ostk/astrodynamics/test/trajectory/test_state_builder.py,sha256=LpCCYdCaLu_D2npm9wgA2sMlcekrtbRqP-afe5IE5L4,4871
94
94
  ostk/astrodynamics/test/trajectory/orbit/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
95
95
  ostk/astrodynamics/test/trajectory/orbit/test_model.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
@@ -119,7 +119,7 @@ ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_attitude_quatern
119
119
  ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_acceleration.py,sha256=1p37_FYN85d9SrOqO3iCkNecovJJayhnFeZ4QCOw2ao,3528
120
120
  ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_position.py,sha256=XvHdk1KjacTwtkgx2jUAc9I9N3nvjPDv03FAanpv8jQ,2702
121
121
  ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_velocity.py,sha256=-kd5TZO5TICihbkqDTew2i_tDpggdpe3Yf23046FATM,3057
122
- ostk/astrodynamics/trajectory/__init__.pyi,sha256=dxNnpdnDid4GRXiBs_Lr6WNn1L7jx42pwu_eq4Nk9Ss,76183
122
+ ostk/astrodynamics/trajectory/__init__.pyi,sha256=uC9WD4s1XZpnJy8GhSTap818vHPMgMNieusLaxlzh4U,76264
123
123
  ostk/astrodynamics/trajectory/orbit/__init__.pyi,sha256=wbuRK7Yp_NYBr3ta5-NpnJYMX4baUl7yIlUWhaRlR4o,12899
124
124
  ostk/astrodynamics/trajectory/orbit/message/__init__.pyi,sha256=-GNBlYPrsjelhKxWorYQYhIWzFsibiIQNZvMXjhRpfM,77
125
125
  ostk/astrodynamics/trajectory/orbit/message/spacex.pyi,sha256=fnUVJGWlSPo8AmLVuu08LubsAuVGo-gFaT86yd4f4CI,10558
@@ -129,8 +129,8 @@ ostk/astrodynamics/trajectory/orbit/model/kepler.pyi,sha256=OZMznHuU7e6m1rfqtOgX
129
129
  ostk/astrodynamics/trajectory/orbit/model/sgp4.pyi,sha256=OhFzoPPQHlYy7m3LiZ8TXF89M4uBTfNk6tGsBEp0sjI,14235
130
130
  ostk/astrodynamics/trajectory/state/__init__.pyi,sha256=bq__Fii35czVrTeNxc9eQVjXdqwbbQxUdNQWK3vLrMo,17649
131
131
  ostk/astrodynamics/trajectory/state/coordinate_subset.pyi,sha256=kYMfMwEjCqO1NepMYFT4QS6kIPBkVL6sGCLeLbogcMw,10176
132
- open_space_toolkit_astrodynamics-16.0.0.dist-info/METADATA,sha256=QZzoZmh6ksKVxnXob_SRtfRykp2hf20s2fLMk70AXtk,1913
133
- open_space_toolkit_astrodynamics-16.0.0.dist-info/WHEEL,sha256=T9LN2NZIbRzW_NMBvL-Wx3BjkFw14mmvFvaC5ClfXRs,110
134
- open_space_toolkit_astrodynamics-16.0.0.dist-info/top_level.txt,sha256=zOR18699uDYnafgarhL8WU_LmTZY_5NVqutv-flp_x4,5
135
- open_space_toolkit_astrodynamics-16.0.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
136
- open_space_toolkit_astrodynamics-16.0.0.dist-info/RECORD,,
132
+ open_space_toolkit_astrodynamics-16.1.0.dist-info/METADATA,sha256=-oOEr23wSU5vy8jOZpmEflURSXpN7wm-K4nMa6S9JPc,1913
133
+ open_space_toolkit_astrodynamics-16.1.0.dist-info/WHEEL,sha256=T9LN2NZIbRzW_NMBvL-Wx3BjkFw14mmvFvaC5ClfXRs,110
134
+ open_space_toolkit_astrodynamics-16.1.0.dist-info/top_level.txt,sha256=zOR18699uDYnafgarhL8WU_LmTZY_5NVqutv-flp_x4,5
135
+ open_space_toolkit_astrodynamics-16.1.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
136
+ open_space_toolkit_astrodynamics-16.1.0.dist-info/RECORD,,
@@ -5,8 +5,8 @@ from ostk.astrodynamics.trajectory import State as PyState
5
5
  from ostk import core as OpenSpaceToolkitCorePy
6
6
  from ostk.core import container
7
7
  from ostk.core import filesystem
8
- from ostk.core import type
9
8
  import ostk.core.type
9
+ from ostk.core import type
10
10
  from ostk import io as OpenSpaceToolkitIOPy
11
11
  from ostk.io import URL
12
12
  from ostk.io import ip
@@ -19,13 +19,13 @@ import ostk.physics
19
19
  from ostk.physics import Environment
20
20
  from ostk.physics import Manager
21
21
  from ostk.physics import Unit
22
- import ostk.physics.coordinate
23
22
  from ostk.physics import coordinate
23
+ import ostk.physics.coordinate
24
24
  import ostk.physics.coordinate.spherical
25
25
  from ostk.physics import environment
26
26
  import ostk.physics.environment.object
27
- import ostk.physics.time
28
27
  from ostk.physics import time
28
+ import ostk.physics.time
29
29
  from ostk.physics import unit
30
30
  import ostk.physics.unit
31
31
  import typing
@@ -18,7 +18,7 @@ from ostk.astrodynamics.trajectory.state.coordinate_subset import (
18
18
  AngularVelocity,
19
19
  )
20
20
 
21
- CANONICAL_FORMAT: str = r"(r|v)_(.*?)_(x|y|z)"
21
+ POS_VEL_CANONICAL_FORMAT: str = r"(r|v)_(.*?)_(x|y|z)"
22
22
 
23
23
 
24
24
  def custom_class_generator(frame: Frame, coordinate_subsets: list) -> type:
@@ -68,6 +68,7 @@ def from_dict(data: dict) -> State:
68
68
  - 'drag_coefficient'/'cd': The drag coefficient. Optional.
69
69
  - 'cross_sectional_area'/'surface_area': The cross-sectional area. Optional.
70
70
  - 'mass': The mass. Optional.
71
+ - 'ballistic_coefficient'/'bc': The ballistic coefficient. Optional.
71
72
 
72
73
  Args:
73
74
  data (dict): The dictionary.
@@ -76,7 +77,7 @@ def from_dict(data: dict) -> State:
76
77
  State: The State.
77
78
  """
78
79
 
79
- instant: Instant = coerce_to_instant(data["timestamp"])
80
+ # Position and velocity subsets
80
81
 
81
82
  eci_columns: list[str] = [
82
83
  "rx_eci",
@@ -123,7 +124,7 @@ def from_dict(data: dict) -> State:
123
124
  ]
124
125
 
125
126
  match_groups: list[re.Match] = [
126
- re.match(CANONICAL_FORMAT, column) for column in data.keys()
127
+ re.match(POS_VEL_CANONICAL_FORMAT, column) for column in data.keys()
127
128
  ]
128
129
 
129
130
  if len(matches := [match for match in match_groups if match is not None]) == 6:
@@ -188,6 +189,8 @@ def from_dict(data: dict) -> State:
188
189
  else:
189
190
  raise ValueError("Invalid state data.")
190
191
 
192
+ # Attitude and angular velocity subsets
193
+
191
194
  if all(
192
195
  column in data for column in ["q_B_ECI_x", "q_B_ECI_y", "q_B_ECI_z", "q_B_ECI_s"]
193
196
  ):
@@ -216,6 +219,8 @@ def from_dict(data: dict) -> State:
216
219
  ],
217
220
  )
218
221
 
222
+ # Extra subsets
223
+
219
224
  if (data.get("drag_coefficient") is not None) or (data.get("cd") is not None):
220
225
  coordinate_subsets.append(CoordinateSubset.drag_coefficient())
221
226
  coordinates = np.append(
@@ -239,8 +244,15 @@ def from_dict(data: dict) -> State:
239
244
  data["mass"],
240
245
  )
241
246
 
247
+ if (data.get("ballistic_coefficient") is not None) or (data.get("bc") is not None):
248
+ coordinate_subsets.append(CoordinateSubset.ballistic_coefficient())
249
+ coordinates = np.append(
250
+ coordinates,
251
+ data.get("ballistic_coefficient", data.get("bc")),
252
+ )
253
+
242
254
  return State(
243
- instant=instant,
255
+ instant=coerce_to_instant(data["timestamp"]),
244
256
  coordinates=coordinates,
245
257
  frame=frame,
246
258
  coordinate_subsets=coordinate_subsets,
@@ -13,7 +13,7 @@ import ostk.physics.coordinate
13
13
  from ostk.physics.coordinate import Frame
14
14
  from ostk.physics.time import Instant
15
15
  import re as re
16
- __all__ = ['AngularVelocity', 'AttitudeQuaternion', 'CANONICAL_FORMAT', 'CartesianPosition', 'CartesianVelocity', 'CoordinateSubset', 'Frame', 'Instant', 'State', 'StateBuilder', 'coerce_to_instant', 'custom_class_generator', 'from_dict', 'np', 're']
16
+ __all__ = ['AngularVelocity', 'AttitudeQuaternion', 'CartesianPosition', 'CartesianVelocity', 'CoordinateSubset', 'Frame', 'Instant', 'POS_VEL_CANONICAL_FORMAT', 'State', 'StateBuilder', 'coerce_to_instant', 'custom_class_generator', 'from_dict', 'np', 're']
17
17
  def custom_class_generator(frame: ostk.physics.coordinate.Frame, coordinate_subsets: list) -> type:
18
18
  """
19
19
 
@@ -54,6 +54,7 @@ def from_dict(data: dict) -> ostk.astrodynamics.trajectory.State:
54
54
  - 'drag_coefficient'/'cd': The drag coefficient. Optional.
55
55
  - 'cross_sectional_area'/'surface_area': The cross-sectional area. Optional.
56
56
  - 'mass': The mass. Optional.
57
+ - 'ballistic_coefficient'/'bc': The ballistic coefficient. Optional.
57
58
 
58
59
  Args:
59
60
  data (dict): The dictionary.
@@ -62,4 +63,4 @@ def from_dict(data: dict) -> ostk.astrodynamics.trajectory.State:
62
63
  State: The State.
63
64
 
64
65
  """
65
- CANONICAL_FORMAT: str = '(r|v)_(.*?)_(x|y|z)'
66
+ POS_VEL_CANONICAL_FORMAT: str = '(r|v)_(.*?)_(x|y|z)'
@@ -458,6 +458,41 @@ class TestState:
458
458
  assert isinstance(state, State)
459
459
  assert state.get_size() == 6
460
460
 
461
+ def test_from_dict_with_ballistic_coefficient(self):
462
+ data: dict = {
463
+ "timestamp": datetime.now(timezone.utc).isoformat(),
464
+ "rx_eci": 7000.0,
465
+ "ry_eci": 0.0,
466
+ "rz_eci": 0.0,
467
+ "vx_eci": 0.0,
468
+ "vy_eci": 7.5,
469
+ "vz_eci": 0.0,
470
+ "ballistic_coefficient": 2.2,
471
+ }
472
+
473
+ state: State = State.from_dict(data)
474
+
475
+ assert state is not None
476
+ assert isinstance(state, State)
477
+ assert state.get_size() == 7
478
+
479
+ data: dict = {
480
+ "timestamp": datetime.now(timezone.utc).isoformat(),
481
+ "rx_eci": 7000.0,
482
+ "ry_eci": 0.0,
483
+ "rz_eci": 0.0,
484
+ "vx_eci": 0.0,
485
+ "vy_eci": 7.5,
486
+ "vz_eci": 0.0,
487
+ "ballistic_coefficient": None,
488
+ }
489
+
490
+ state: State = State.from_dict(data)
491
+
492
+ assert state is not None
493
+ assert isinstance(state, State)
494
+ assert state.get_size() == 6
495
+
461
496
  @pytest.mark.parametrize(
462
497
  ("data", "expected_length", "expected_frame"),
463
498
  [
@@ -1414,6 +1414,7 @@ class State:
1414
1414
  - 'drag_coefficient'/'cd': The drag coefficient. Optional.
1415
1415
  - 'cross_sectional_area'/'surface_area': The cross-sectional area. Optional.
1416
1416
  - 'mass': The mass. Optional.
1417
+ - 'ballistic_coefficient'/'bc': The ballistic coefficient. Optional.
1417
1418
 
1418
1419
  Args:
1419
1420
  data (dict): The dictionary.
@@ -105,7 +105,7 @@ class Viewer:
105
105
  show_orbital_track: bool = False,
106
106
  color: str | None = None,
107
107
  image: str | None = None,
108
- ) -> None:
108
+ ) -> Viewer:
109
109
  """
110
110
  Add Orbit to Viewer.
111
111
 
@@ -116,6 +116,9 @@ class Viewer:
116
116
  show_orbital_track (bool, optional): Whether to show the orbital track. Defaults to False.
117
117
  color (str, optional): Color of the orbit. Defaults to None.
118
118
  image (str, optional): Logo to be added. Defaults to None.
119
+
120
+ Returns:
121
+ Viewer: The Viewer.
119
122
  """
120
123
  instants: list[Instant] = self._interval.generate_grid(step)
121
124
  states: list[State] = orbit.get_states_at(instants)
@@ -164,6 +167,8 @@ class Viewer:
164
167
  )
165
168
  )
166
169
 
170
+ return self
171
+
167
172
  def add_profile(
168
173
  self,
169
174
  profile: Profile,
@@ -172,7 +177,7 @@ class Viewer:
172
177
  cesium_asset_id: int | None = None,
173
178
  sensors: list[Sensor] | None = None,
174
179
  show_xyz_axes: bool = False,
175
- ) -> None:
180
+ ) -> Viewer:
176
181
  """
177
182
  Add Profile to Viewer.
178
183
 
@@ -183,6 +188,9 @@ class Viewer:
183
188
  cesium_asset_id (int, optional): The Cesium asset ID. Defaults to None.
184
189
  sensors (list[Sensor], optional): Sensors to be added to the asset. Defaults to None.
185
190
  show_xyz_axes (bool, optional): Whether to show the XYZ axes. Defaults to False.
191
+
192
+ Returns:
193
+ Viewer: The Viewer.
186
194
  """
187
195
 
188
196
  instants: list[Instant] = self._interval.generate_grid(step)
@@ -257,13 +265,15 @@ class Viewer:
257
265
  )
258
266
  )
259
267
 
268
+ return self
269
+
260
270
  def add_target(
261
271
  self,
262
272
  position: Position,
263
273
  size: int | None = None,
264
274
  color: str | None = None,
265
275
  label: str | None = None,
266
- ) -> None:
276
+ ) -> Viewer:
267
277
  """
268
278
  Add target to Viewer.
269
279
 
@@ -272,6 +282,9 @@ class Viewer:
272
282
  size (int, optional): Target size. Defaults to None.
273
283
  color (str, optional): Target color. Defaults to None.
274
284
  label (str, optional): Target label. Defaults to None.
285
+
286
+ Returns:
287
+ Viewer: The Viewer.
275
288
  """
276
289
 
277
290
  self._viewer.entities.add(
@@ -285,12 +298,14 @@ class Viewer:
285
298
  if label:
286
299
  self.add_label(position, label, size, color)
287
300
 
301
+ return self
302
+
288
303
  def add_line(
289
304
  self,
290
305
  positions: list[Position],
291
306
  size: int | None = None,
292
307
  color: str | None = None,
293
- ) -> None:
308
+ ) -> Viewer:
294
309
  """
295
310
  Add line to Viewer.
296
311
 
@@ -298,6 +313,9 @@ class Viewer:
298
313
  positions (list[Position]): Line positions.
299
314
  size (int, optional): Line size. Defaults to None.
300
315
  color (str, optional): Line color. Defaults to None.
316
+
317
+ Returns:
318
+ Viewer: The Viewer.
301
319
  """
302
320
 
303
321
  self._viewer.entities.add(
@@ -321,13 +339,15 @@ class Viewer:
321
339
  )
322
340
  )
323
341
 
342
+ return self
343
+
324
344
  def add_label(
325
345
  self,
326
346
  position: Position,
327
347
  text: str,
328
348
  size: int | None = None,
329
349
  color: str | None = None,
330
- ) -> None:
350
+ ) -> Viewer:
331
351
  """
332
352
  Add label to Viewer.
333
353
 
@@ -337,6 +357,8 @@ class Viewer:
337
357
  size (int, optional): Label size. Defaults to None.
338
358
  color (str, optional): Label color. Defaults to None.
339
359
 
360
+ Returns:
361
+ Viewer: The Viewer.
340
362
  """
341
363
 
342
364
  self._viewer.entities.add(
@@ -348,6 +370,8 @@ class Viewer:
348
370
  )
349
371
  )
350
372
 
373
+ return self
374
+
351
375
  def render(self) -> str:
352
376
  """
353
377
  Render Viewer as HTML string.