open-space-toolkit-astrodynamics 13.1.0__py313-none-manylinux2014_x86_64.whl → 14.0.0__py313-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-13.1.0.dist-info → open_space_toolkit_astrodynamics-14.0.0.dist-info}/METADATA +3 -3
- {open_space_toolkit_astrodynamics-13.1.0.dist-info → open_space_toolkit_astrodynamics-14.0.0.dist-info}/RECORD +52 -20
- {open_space_toolkit_astrodynamics-13.1.0.dist-info → open_space_toolkit_astrodynamics-14.0.0.dist-info}/WHEEL +1 -1
- ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-313-x86_64-linux-gnu.so +0 -0
- ostk/astrodynamics/__init__.pyi +785 -0
- ostk/astrodynamics/access.pyi +588 -0
- ostk/astrodynamics/conjunction/__init__.pyi +3 -0
- ostk/astrodynamics/conjunction/message/__init__.pyi +3 -0
- ostk/astrodynamics/conjunction/message/ccsds.pyi +723 -0
- ostk/astrodynamics/converters.pyi +54 -0
- ostk/astrodynamics/data/__init__.pyi +3 -0
- ostk/astrodynamics/data/provider.pyi +22 -0
- ostk/astrodynamics/dynamics.pyi +329 -0
- ostk/astrodynamics/event_condition.pyi +580 -0
- ostk/astrodynamics/flight/__init__.pyi +547 -0
- ostk/astrodynamics/flight/profile/__init__.pyi +102 -0
- ostk/astrodynamics/flight/profile/model.pyi +176 -0
- ostk/astrodynamics/flight/system.pyi +277 -0
- ostk/astrodynamics/guidance_law.pyi +282 -0
- ostk/astrodynamics/{libopen-space-toolkit-astrodynamics.so.13 → libopen-space-toolkit-astrodynamics.so.14} +0 -0
- ostk/astrodynamics/py.typed +0 -0
- ostk/astrodynamics/pytrajectory/__init__.pyi +3 -0
- ostk/astrodynamics/pytrajectory/pystate.py +2 -4
- ostk/astrodynamics/pytrajectory/pystate.pyi +63 -0
- ostk/astrodynamics/solver.pyi +232 -0
- ostk/astrodynamics/test/access/test_generator.py +130 -59
- ostk/astrodynamics/test/access/test_visibility_criterion.py +198 -0
- ostk/astrodynamics/test/data/provider/test_off_nadir.py +58 -0
- ostk/astrodynamics/test/flight/test_maneuver.py +49 -64
- ostk/astrodynamics/test/flight/test_profile.py +4 -2
- ostk/astrodynamics/test/solvers/test_finite_difference_solver.py +24 -11
- ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +9 -1
- ostk/astrodynamics/test/test_display.py +11 -5
- ostk/astrodynamics/test/test_viewer.py +70 -1
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_acceleration.py +136 -0
- ostk/astrodynamics/test/trajectory/state/test_coordinate_subset.py +9 -0
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_factory.py +21 -13
- ostk/astrodynamics/test/trajectory/test_propagator.py +21 -27
- ostk/astrodynamics/test/trajectory/test_segment.py +0 -1
- ostk/astrodynamics/trajectory/__init__.pyi +1794 -0
- ostk/astrodynamics/trajectory/orbit/__init__.pyi +361 -0
- ostk/astrodynamics/trajectory/orbit/message/__init__.pyi +3 -0
- ostk/astrodynamics/trajectory/orbit/message/spacex.pyi +273 -0
- ostk/astrodynamics/trajectory/orbit/model/__init__.pyi +517 -0
- ostk/astrodynamics/trajectory/orbit/model/brouwerLyddaneMean.pyi +127 -0
- ostk/astrodynamics/trajectory/orbit/model/kepler.pyi +581 -0
- ostk/astrodynamics/trajectory/orbit/model/sgp4.pyi +333 -0
- ostk/astrodynamics/trajectory/state/__init__.pyi +406 -0
- ostk/astrodynamics/trajectory/state/coordinate_subset.pyi +223 -0
- ostk/astrodynamics/viewer.py +32 -0
- {open_space_toolkit_astrodynamics-13.1.0.dist-info → open_space_toolkit_astrodynamics-14.0.0.dist-info}/top_level.txt +0 -0
- {open_space_toolkit_astrodynamics-13.1.0.dist-info → open_space_toolkit_astrodynamics-14.0.0.dist-info}/zip-safe +0 -0
@@ -0,0 +1,406 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
import numpy
|
3
|
+
import ostk.astrodynamics
|
4
|
+
import ostk.astrodynamics.trajectory
|
5
|
+
import ostk.core.type
|
6
|
+
import ostk.mathematics.solver
|
7
|
+
import ostk.physics.coordinate
|
8
|
+
import ostk.physics.time
|
9
|
+
import typing
|
10
|
+
from . import coordinate_subset
|
11
|
+
__all__ = ['CoordinateBroker', 'CoordinateSubset', 'NumericalSolver', 'coordinate_subset']
|
12
|
+
class CoordinateBroker:
|
13
|
+
"""
|
14
|
+
|
15
|
+
Class to manage the coordinate subsets of a state.
|
16
|
+
|
17
|
+
|
18
|
+
"""
|
19
|
+
__hash__: typing.ClassVar[None] = None
|
20
|
+
@staticmethod
|
21
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
22
|
+
...
|
23
|
+
def __eq__(self, arg0: CoordinateBroker) -> bool:
|
24
|
+
...
|
25
|
+
@typing.overload
|
26
|
+
def __init__(self) -> None:
|
27
|
+
"""
|
28
|
+
Default constructor.
|
29
|
+
"""
|
30
|
+
@typing.overload
|
31
|
+
def __init__(self, coordinate_subsets: list[...]) -> None:
|
32
|
+
"""
|
33
|
+
Create a broker for ther provided coordinate subsets.
|
34
|
+
|
35
|
+
Args:
|
36
|
+
list[CoordinateSubset]: The list of coordinate subsets.
|
37
|
+
"""
|
38
|
+
def __ne__(self, arg0: CoordinateBroker) -> bool:
|
39
|
+
...
|
40
|
+
def access_subsets(self) -> list[...]:
|
41
|
+
"""
|
42
|
+
Access the list of coordinate subsets.
|
43
|
+
|
44
|
+
Returns:
|
45
|
+
list[CoordinateSubset]: The list of coordinate subsets.
|
46
|
+
"""
|
47
|
+
def add_subset(self, coordinate_subset: ...) -> int:
|
48
|
+
"""
|
49
|
+
Add a coordinate subset.
|
50
|
+
|
51
|
+
Args:
|
52
|
+
coordinate_subset (CoordinateSubset): The coordinate subset to add.
|
53
|
+
"""
|
54
|
+
def extract_coordinate(self, coordinates: numpy.ndarray[numpy.float64[m, 1]], coordinate_subset: ...) -> numpy.ndarray[numpy.float64[m, 1]]:
|
55
|
+
"""
|
56
|
+
Extract the coordinates of a subset from a full coordinates vector.
|
57
|
+
|
58
|
+
Args:
|
59
|
+
coordinates (numpy.ndarray): The full coordinates vector.
|
60
|
+
coordinate_subset (CoordinateSubset): The coordinate subset.
|
61
|
+
|
62
|
+
Returns:
|
63
|
+
numpy.ndarray: The coordinates of the subset.
|
64
|
+
"""
|
65
|
+
def extract_coordinates(self, coordinates: numpy.ndarray[numpy.float64[m, 1]], coordinate_subsets: list[...]) -> numpy.ndarray[numpy.float64[m, 1]]:
|
66
|
+
"""
|
67
|
+
Extract the coordinates of multiple subsets from a full coordinates vector.
|
68
|
+
|
69
|
+
Args:
|
70
|
+
coordinates (numpy.ndarray): The full coordinates vector.
|
71
|
+
coordinate_subsets (list[CoordinateSubset]): The coordinate subsets.
|
72
|
+
|
73
|
+
Returns:
|
74
|
+
numpy.ndarray: The coordinates of the subsets.
|
75
|
+
"""
|
76
|
+
def get_number_of_coordinates(self) -> int:
|
77
|
+
"""
|
78
|
+
Get the total number of coordinates.
|
79
|
+
|
80
|
+
Returns:
|
81
|
+
int: The total number of coordinates.
|
82
|
+
"""
|
83
|
+
def get_number_of_subsets(self) -> int:
|
84
|
+
"""
|
85
|
+
Get the number of coordinate subsets.
|
86
|
+
|
87
|
+
Returns:
|
88
|
+
int: The number of coordinate subsets.
|
89
|
+
"""
|
90
|
+
def get_subsets(self) -> list[...]:
|
91
|
+
"""
|
92
|
+
Get the list of coordinate subsets.
|
93
|
+
|
94
|
+
Returns:
|
95
|
+
list[CoordinateSubset]: The list of coordinate subsets.
|
96
|
+
"""
|
97
|
+
def has_subset(self, coordinate_subset: ...) -> bool:
|
98
|
+
"""
|
99
|
+
Check if the coordinate broker has a given coordinate subset.
|
100
|
+
|
101
|
+
Args:
|
102
|
+
coordinate_subset (CoordinateSubset): The coordinate subset to check.
|
103
|
+
|
104
|
+
Returns:
|
105
|
+
bool: True if the coordinate broker has the coordinate subset, False otherwise.
|
106
|
+
"""
|
107
|
+
class CoordinateSubset:
|
108
|
+
"""
|
109
|
+
|
110
|
+
State coordinate subset. It contains information related to a particular group of coordinates. It does not
|
111
|
+
contain the coordinate values.
|
112
|
+
|
113
|
+
|
114
|
+
"""
|
115
|
+
@staticmethod
|
116
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
117
|
+
...
|
118
|
+
@staticmethod
|
119
|
+
def drag_coefficient() -> CoordinateSubset:
|
120
|
+
"""
|
121
|
+
Get the drag coefficient coordinate subset.
|
122
|
+
|
123
|
+
Returns:
|
124
|
+
CoordinateSubset: The drag coefficient coordinate subset.
|
125
|
+
"""
|
126
|
+
@staticmethod
|
127
|
+
def mass() -> CoordinateSubset:
|
128
|
+
"""
|
129
|
+
Get the mass coordinate subset.
|
130
|
+
|
131
|
+
Returns:
|
132
|
+
CoordinateSubset: The mass coordinate subset.
|
133
|
+
"""
|
134
|
+
@staticmethod
|
135
|
+
def mass_flow_rate() -> CoordinateSubset:
|
136
|
+
"""
|
137
|
+
Get the mass flow rate coordinate subset.
|
138
|
+
|
139
|
+
Returns:
|
140
|
+
CoordinateSubset: The mass flow rate coordinate subset.
|
141
|
+
"""
|
142
|
+
@staticmethod
|
143
|
+
def surface_area() -> CoordinateSubset:
|
144
|
+
"""
|
145
|
+
Get the surface area coordinate subset.
|
146
|
+
|
147
|
+
Returns:
|
148
|
+
CoordinateSubset: The surface area coordinate subset.
|
149
|
+
"""
|
150
|
+
def __eq__(self, arg0: CoordinateSubset) -> bool:
|
151
|
+
...
|
152
|
+
def __hash__(self) -> int:
|
153
|
+
...
|
154
|
+
def __init__(self, name: ostk.core.type.String, size: int) -> None:
|
155
|
+
"""
|
156
|
+
Constructor.
|
157
|
+
|
158
|
+
Args:
|
159
|
+
name (str): The name of the coordinate subset.
|
160
|
+
size (int): The size of the coordinate subset.
|
161
|
+
"""
|
162
|
+
def __ne__(self, arg0: CoordinateSubset) -> bool:
|
163
|
+
...
|
164
|
+
def add(self, instant: ostk.physics.time.Instant, coordinates: numpy.ndarray[numpy.float64[m, 1]], another_coordinates: numpy.ndarray[numpy.float64[m, 1]], frame: ostk.physics.coordinate.Frame, coordinate_broker: CoordinateBroker) -> numpy.ndarray[numpy.float64[m, 1]]:
|
165
|
+
"""
|
166
|
+
Add the coordinates of another state to the coordinates of this state.
|
167
|
+
|
168
|
+
Args:
|
169
|
+
instant (Instant): The instant of the state.
|
170
|
+
coordinates (numpy.ndarray): The coordinates of this state.
|
171
|
+
another_coordinates (numpy.ndarray): The coordinates of the other state.
|
172
|
+
frame (Frame): The reference frame of the coordinates.
|
173
|
+
coordinate_broker (CoordinateBroker): The coordinate broker.
|
174
|
+
|
175
|
+
Returns:
|
176
|
+
numpy.ndarray: The sum of the coordinates.
|
177
|
+
"""
|
178
|
+
def get_id(self) -> ostk.core.type.String:
|
179
|
+
"""
|
180
|
+
Get the identifier of the coordinate subset.
|
181
|
+
|
182
|
+
Returns:
|
183
|
+
str: The identifier of the coordinate subset.
|
184
|
+
"""
|
185
|
+
def get_name(self) -> ostk.core.type.String:
|
186
|
+
"""
|
187
|
+
Get the name of the coordinate subset.
|
188
|
+
|
189
|
+
Returns:
|
190
|
+
str: The name of the coordinate subset.
|
191
|
+
"""
|
192
|
+
def get_size(self) -> int:
|
193
|
+
"""
|
194
|
+
Get the size of the coordinate subset.
|
195
|
+
|
196
|
+
Returns:
|
197
|
+
int: The size of the coordinate subset.
|
198
|
+
"""
|
199
|
+
def in_frame(self, instant: ostk.physics.time.Instant, coordinates: numpy.ndarray[numpy.float64[m, 1]], from_frame: ostk.physics.coordinate.Frame, to_frame: ostk.physics.coordinate.Frame, coordinate_broker: CoordinateBroker) -> numpy.ndarray[numpy.float64[m, 1]]:
|
200
|
+
"""
|
201
|
+
Convert the coordinates of this state from one frame to another.
|
202
|
+
|
203
|
+
Args:
|
204
|
+
instant (Instant): The instant of the state.
|
205
|
+
coordinates (numpy.ndarray): The coordinates of this state.
|
206
|
+
from_frame (Frame): The reference frame of the input coordinates.
|
207
|
+
to_frame (Frame): The reference frame of the output coordinates.
|
208
|
+
coordinate_broker (CoordinateBroker): The coordinate broker.
|
209
|
+
|
210
|
+
Returns:
|
211
|
+
numpy.ndarray: The coordinates in the output frame.
|
212
|
+
"""
|
213
|
+
def subtract(self, instant: ostk.physics.time.Instant, coordinates: numpy.ndarray[numpy.float64[m, 1]], another_coordinates: numpy.ndarray[numpy.float64[m, 1]], frame: ostk.physics.coordinate.Frame, coordinate_broker: CoordinateBroker) -> numpy.ndarray[numpy.float64[m, 1]]:
|
214
|
+
"""
|
215
|
+
Subtract the coordinates of another state from the coordinates of this state.
|
216
|
+
|
217
|
+
Args:
|
218
|
+
instant (Instant): The instant of the state.
|
219
|
+
coordinates (numpy.ndarray): The coordinates of this state.
|
220
|
+
another_coordinates (numpy.ndarray): The coordinates of the other state.
|
221
|
+
frame (Frame): The reference frame of the coordinates.
|
222
|
+
coordinate_broker (CoordinateBroker): The coordinate broker.
|
223
|
+
|
224
|
+
Returns:
|
225
|
+
numpy.ndarray: The difference of the coordinates.
|
226
|
+
"""
|
227
|
+
class NumericalSolver(ostk.mathematics.solver.NumericalSolver):
|
228
|
+
"""
|
229
|
+
|
230
|
+
A numerical solver is used to integrate the trajectory of a dynamical system.
|
231
|
+
|
232
|
+
The numerical solver can be used to integrate the trajectory of a dynamical system to a given instant,
|
233
|
+
or to a set of instants, or until an `Event Condition` is met.
|
234
|
+
|
235
|
+
|
236
|
+
"""
|
237
|
+
class ConditionSolution:
|
238
|
+
"""
|
239
|
+
|
240
|
+
The solution to an event condition.
|
241
|
+
|
242
|
+
|
243
|
+
"""
|
244
|
+
@staticmethod
|
245
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
246
|
+
...
|
247
|
+
@property
|
248
|
+
def condition_is_satisfied(self) -> bool:
|
249
|
+
"""
|
250
|
+
Whether the event condition is satisfied.
|
251
|
+
|
252
|
+
Type:
|
253
|
+
bool
|
254
|
+
"""
|
255
|
+
@property
|
256
|
+
def iteration_count(self) -> int:
|
257
|
+
"""
|
258
|
+
The number of iterations required to find the solution.
|
259
|
+
|
260
|
+
Type:
|
261
|
+
int
|
262
|
+
"""
|
263
|
+
@property
|
264
|
+
def root_solver_has_converged(self) -> bool:
|
265
|
+
"""
|
266
|
+
Whether the root solver has converged.
|
267
|
+
|
268
|
+
Type:
|
269
|
+
bool
|
270
|
+
"""
|
271
|
+
@property
|
272
|
+
def state(self) -> ostk.astrodynamics.trajectory.State:
|
273
|
+
"""
|
274
|
+
The state of the trajectory.
|
275
|
+
|
276
|
+
Type:
|
277
|
+
State
|
278
|
+
"""
|
279
|
+
__hash__: typing.ClassVar[None] = None
|
280
|
+
@staticmethod
|
281
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
282
|
+
...
|
283
|
+
@staticmethod
|
284
|
+
def conditional(arg0: ostk.core.type.Real, arg1: ostk.core.type.Real, arg2: ostk.core.type.Real, arg3: typing.Callable[[ostk.astrodynamics.trajectory.State], None]) -> NumericalSolver:
|
285
|
+
"""
|
286
|
+
Return a conditional numerical solver.
|
287
|
+
|
288
|
+
Returns:
|
289
|
+
NumericalSolver: The conditional numerical solver.
|
290
|
+
"""
|
291
|
+
@staticmethod
|
292
|
+
def default() -> NumericalSolver:
|
293
|
+
"""
|
294
|
+
Return the default numerical solver.
|
295
|
+
|
296
|
+
Returns:
|
297
|
+
NumericalSolver: The default numerical solver.
|
298
|
+
"""
|
299
|
+
@staticmethod
|
300
|
+
def default_conditional(state_logger: typing.Callable[[ostk.astrodynamics.trajectory.State], None] = None) -> NumericalSolver:
|
301
|
+
"""
|
302
|
+
Return the default conditional numerical solver.
|
303
|
+
|
304
|
+
Args:
|
305
|
+
state_logger (StateLogger, optional): The state logger. Defaults to None.
|
306
|
+
|
307
|
+
Returns:
|
308
|
+
NumericalSolver: The default conditional numerical solver.
|
309
|
+
"""
|
310
|
+
@staticmethod
|
311
|
+
def fixed_step_size(stepper_type: ostk.mathematics.solver.NumericalSolver.StepperType, time_step: ostk.core.type.Real) -> NumericalSolver:
|
312
|
+
"""
|
313
|
+
Return a Numerical Solver using a fixed stepper.
|
314
|
+
|
315
|
+
Returns:
|
316
|
+
NumericalSolver: The numerical solver.
|
317
|
+
"""
|
318
|
+
@staticmethod
|
319
|
+
def undefined() -> NumericalSolver:
|
320
|
+
"""
|
321
|
+
Return an undefined numerical solver.
|
322
|
+
|
323
|
+
Returns:
|
324
|
+
NumericalSolver: The undefined numerical solver.
|
325
|
+
"""
|
326
|
+
def __eq__(self, arg0: NumericalSolver) -> bool:
|
327
|
+
...
|
328
|
+
def __init__(self, log_type: ostk.mathematics.solver.NumericalSolver.LogType, stepper_type: ostk.mathematics.solver.NumericalSolver.StepperType, time_step: ostk.core.type.Real, relative_tolerance: ostk.core.type.Real, absolute_tolerance: ostk.core.type.Real, root_solver: ostk.astrodynamics.RootSolver = ...) -> None:
|
329
|
+
"""
|
330
|
+
Constructor.
|
331
|
+
|
332
|
+
Args:
|
333
|
+
log_type (NumericalSolver.LogType): The type of logging.
|
334
|
+
stepper_type (NumericalSolver.StepperType): The type of stepper.
|
335
|
+
time_step (float): The time step.
|
336
|
+
relative_tolerance (float): The relative tolerance.
|
337
|
+
absolute_tolerance (float): The absolute tolerance.
|
338
|
+
root_solver (RootSolver, optional): The root solver. Defaults to RootSolver.Default().
|
339
|
+
"""
|
340
|
+
def __ne__(self, arg0: NumericalSolver) -> bool:
|
341
|
+
...
|
342
|
+
def __repr__(self) -> str:
|
343
|
+
...
|
344
|
+
def __str__(self) -> str:
|
345
|
+
...
|
346
|
+
def get_observed_states(self) -> list[ostk.astrodynamics.trajectory.State]:
|
347
|
+
"""
|
348
|
+
Get the observed states.
|
349
|
+
|
350
|
+
Returns:
|
351
|
+
list[State]: The observed states.
|
352
|
+
"""
|
353
|
+
def get_root_solver(self) -> ostk.astrodynamics.RootSolver:
|
354
|
+
"""
|
355
|
+
Get the root solver.
|
356
|
+
|
357
|
+
Returns:
|
358
|
+
RootSolver: The root solver.
|
359
|
+
"""
|
360
|
+
@typing.overload
|
361
|
+
def integrate_time(self, state: ostk.astrodynamics.trajectory.State, instant: ostk.physics.time.Instant, system_of_equations: typing.Any) -> ostk.astrodynamics.trajectory.State:
|
362
|
+
"""
|
363
|
+
Integrate the trajectory to a given instant.
|
364
|
+
|
365
|
+
Args:
|
366
|
+
state (State): The initial state of the trajectory.
|
367
|
+
instant (Instant): The instant to integrate to.
|
368
|
+
system_of_equations (callable): The system of equations.
|
369
|
+
|
370
|
+
Returns:
|
371
|
+
State: The state at the requested time.
|
372
|
+
"""
|
373
|
+
@typing.overload
|
374
|
+
def integrate_time(self, state: ostk.astrodynamics.trajectory.State, instants: list[ostk.physics.time.Instant], system_of_equations: typing.Any) -> list[ostk.astrodynamics.trajectory.State]:
|
375
|
+
"""
|
376
|
+
Integrate the trajectory to a set of instants.
|
377
|
+
|
378
|
+
Args:
|
379
|
+
state (State): The initial state of the trajectory.
|
380
|
+
instants (list[Instant]): The instants to integrate to.
|
381
|
+
system_of_equations (callable): The system of equations.
|
382
|
+
|
383
|
+
Returns:
|
384
|
+
list[State]: The states at the requested times.
|
385
|
+
"""
|
386
|
+
@typing.overload
|
387
|
+
def integrate_time(self, state: ostk.astrodynamics.trajectory.State, instant: ostk.physics.time.Instant, system_of_equations: typing.Any, event_condition: ...) -> NumericalSolver.ConditionSolution:
|
388
|
+
"""
|
389
|
+
Integrate the trajectory to a given instant, with an event condition.
|
390
|
+
|
391
|
+
Args:
|
392
|
+
state (State): The initial state of the trajectory.
|
393
|
+
instant (Instant): The instant to integrate to.
|
394
|
+
system_of_equations (callable): The system of equations.
|
395
|
+
event_condition (EventCondition): The event condition.
|
396
|
+
|
397
|
+
Returns:
|
398
|
+
ConditionSolution: The solution to the event condition.
|
399
|
+
"""
|
400
|
+
def is_defined(self) -> bool:
|
401
|
+
"""
|
402
|
+
Check if the numerical solver is defined.
|
403
|
+
|
404
|
+
Returns:
|
405
|
+
bool: True if the numerical solver is defined, False otherwise.
|
406
|
+
"""
|
@@ -0,0 +1,223 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
import numpy
|
3
|
+
import ostk.astrodynamics.trajectory.state
|
4
|
+
import ostk.core.type
|
5
|
+
import ostk.physics.coordinate
|
6
|
+
import ostk.physics.time
|
7
|
+
__all__ = ['AngularVelocity', 'AttitudeQuaternion', 'CartesianAcceleration', 'CartesianPosition', 'CartesianVelocity']
|
8
|
+
class AngularVelocity(ostk.astrodynamics.trajectory.state.CoordinateSubset):
|
9
|
+
"""
|
10
|
+
|
11
|
+
Angular velocity coordinate subset.
|
12
|
+
|
13
|
+
Defined with respect to a reference frame and a Attitude quaternion.
|
14
|
+
|
15
|
+
|
16
|
+
"""
|
17
|
+
@staticmethod
|
18
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
19
|
+
...
|
20
|
+
@staticmethod
|
21
|
+
def default() -> AngularVelocity:
|
22
|
+
"""
|
23
|
+
Get the default Angular velocity subset.
|
24
|
+
|
25
|
+
Returns:
|
26
|
+
AngularVelocity: The default Angular velocity subset.
|
27
|
+
"""
|
28
|
+
def __init__(self, attitude_quaternion: ..., name: ostk.core.type.String) -> None:
|
29
|
+
"""
|
30
|
+
Constructor.
|
31
|
+
|
32
|
+
Args:
|
33
|
+
attitude_quaternion (AttitudeQuaternion): The Attitude quaternion.
|
34
|
+
name (str): The name of the subset.
|
35
|
+
"""
|
36
|
+
def in_frame(self, instant: ostk.physics.time.Instant, coordinates: numpy.ndarray[numpy.float64[m, 1]], from_frame: ostk.physics.coordinate.Frame, to_frame: ostk.physics.coordinate.Frame, coordinate_broker: ostk.astrodynamics.trajectory.state.CoordinateBroker) -> numpy.ndarray[numpy.float64[m, 1]]:
|
37
|
+
"""
|
38
|
+
Convert a Angular velocity from one reference frame to another.
|
39
|
+
|
40
|
+
Args:
|
41
|
+
instant (Instant): The instant of the conversion.
|
42
|
+
coordinates (numpy.ndarray): The Angular velocity to convert.
|
43
|
+
from_frame (str): The reference frame of the input Angular velocity.
|
44
|
+
to_frame (str): The reference frame of the output Angular velocity.
|
45
|
+
coordinate_broker (CoordinateBroker): The coordinate broker.
|
46
|
+
|
47
|
+
Returns:
|
48
|
+
numpy.ndarray: The Angular velocity in the output reference frame.
|
49
|
+
"""
|
50
|
+
class AttitudeQuaternion(ostk.astrodynamics.trajectory.state.CoordinateSubset):
|
51
|
+
"""
|
52
|
+
|
53
|
+
Attitude quaternion coordinate subset.
|
54
|
+
|
55
|
+
Defined with respect to a reference frame.
|
56
|
+
|
57
|
+
|
58
|
+
"""
|
59
|
+
@staticmethod
|
60
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
61
|
+
...
|
62
|
+
@staticmethod
|
63
|
+
def default() -> AttitudeQuaternion:
|
64
|
+
"""
|
65
|
+
Get the default Attitude quaternion subset.
|
66
|
+
|
67
|
+
Returns:
|
68
|
+
AttitudeQuaternion: The default Attitude quaternion subset.
|
69
|
+
"""
|
70
|
+
def __init__(self, name: ostk.core.type.String) -> None:
|
71
|
+
"""
|
72
|
+
Constructor.
|
73
|
+
|
74
|
+
Args:
|
75
|
+
name (str): The name of the subset.
|
76
|
+
"""
|
77
|
+
def in_frame(self, instant: ostk.physics.time.Instant, coordinates: numpy.ndarray[numpy.float64[m, 1]], from_frame: ostk.physics.coordinate.Frame, to_frame: ostk.physics.coordinate.Frame, coordinate_broker: ostk.astrodynamics.trajectory.state.CoordinateBroker) -> numpy.ndarray[numpy.float64[m, 1]]:
|
78
|
+
"""
|
79
|
+
Convert a Attitude quaternion from one reference frame to another.
|
80
|
+
|
81
|
+
Args:
|
82
|
+
instant (Instant): The instant of the conversion.
|
83
|
+
coordinates (numpy.ndarray): The Attitude quaternion to convert.
|
84
|
+
from_frame (str): The reference frame of the input Attitude quaternion.
|
85
|
+
to_frame (str): The reference frame of the output Attitude quaternion.
|
86
|
+
coordinate_broker (CoordinateBroker): The coordinate broker.
|
87
|
+
|
88
|
+
Returns:
|
89
|
+
numpy.ndarray: The Attitude quaternion in the output reference frame.
|
90
|
+
"""
|
91
|
+
class CartesianAcceleration(ostk.astrodynamics.trajectory.state.CoordinateSubset):
|
92
|
+
"""
|
93
|
+
|
94
|
+
Cartesian acceleration coordinate subset.
|
95
|
+
|
96
|
+
Defined with respect to a reference frame.
|
97
|
+
|
98
|
+
"""
|
99
|
+
@staticmethod
|
100
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
101
|
+
...
|
102
|
+
@staticmethod
|
103
|
+
def default() -> CartesianAcceleration:
|
104
|
+
"""
|
105
|
+
Get the default Cartesian acceleration subset.
|
106
|
+
|
107
|
+
Returns:
|
108
|
+
CartesianAcceleration: The default Cartesian acceleration subset.
|
109
|
+
"""
|
110
|
+
@staticmethod
|
111
|
+
def thrust_acceleration() -> CartesianAcceleration:
|
112
|
+
"""
|
113
|
+
Get the Cartesian acceleration subset for thrust acceleration.
|
114
|
+
|
115
|
+
Returns:
|
116
|
+
CartesianAcceleration: The Cartesian acceleration subset for thrust acceleration.
|
117
|
+
"""
|
118
|
+
def __init__(self, cartesian_position: CartesianPosition, cartesian_velocity: CartesianVelocity, name: ostk.core.type.String) -> None:
|
119
|
+
"""
|
120
|
+
Constructor.
|
121
|
+
|
122
|
+
Args:
|
123
|
+
cartesian_position (CartesianPosition): The Cartesian position.
|
124
|
+
cartesian_velocity (CartesianVelocity): The Cartesian velocity.
|
125
|
+
name (str): The name of the subset.
|
126
|
+
"""
|
127
|
+
def in_frame(self, instant: ostk.physics.time.Instant, coordinates: numpy.ndarray[numpy.float64[m, 1]], from_frame: ostk.physics.coordinate.Frame, to_frame: ostk.physics.coordinate.Frame, coordinate_broker: ostk.astrodynamics.trajectory.state.CoordinateBroker) -> numpy.ndarray[numpy.float64[m, 1]]:
|
128
|
+
"""
|
129
|
+
Convert a Cartesian acceleration from one reference frame to another.
|
130
|
+
|
131
|
+
Args:
|
132
|
+
instant (Instant): The instant of the conversion.
|
133
|
+
coordinates (np.ndarray): The Cartesian acceleration to convert.
|
134
|
+
from_frame (Frame): The reference frame of the input Cartesian acceleration.
|
135
|
+
to_frame (Frame): The reference frame of the output Cartesian acceleration.
|
136
|
+
coordinate_broker (CoordinateBroker): The coordinate broker.
|
137
|
+
|
138
|
+
Returns:
|
139
|
+
numpy.ndarray: The Cartesian acceleration in the output reference frame.
|
140
|
+
"""
|
141
|
+
class CartesianPosition(ostk.astrodynamics.trajectory.state.CoordinateSubset):
|
142
|
+
"""
|
143
|
+
|
144
|
+
Cartesian position coordinate subset.
|
145
|
+
|
146
|
+
Defined with respect to a reference frame.
|
147
|
+
|
148
|
+
|
149
|
+
"""
|
150
|
+
@staticmethod
|
151
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
152
|
+
...
|
153
|
+
@staticmethod
|
154
|
+
def default() -> CartesianPosition:
|
155
|
+
"""
|
156
|
+
Get the default Cartesian position subset.
|
157
|
+
|
158
|
+
Returns:
|
159
|
+
CartesianPosition: The default Cartesian position subset.
|
160
|
+
"""
|
161
|
+
def __init__(self, name: ostk.core.type.String) -> None:
|
162
|
+
"""
|
163
|
+
Constructor.
|
164
|
+
|
165
|
+
Args:
|
166
|
+
name (str): The name of the subset.
|
167
|
+
"""
|
168
|
+
def in_frame(self, instant: ostk.physics.time.Instant, coordinates: numpy.ndarray[numpy.float64[m, 1]], from_frame: ostk.physics.coordinate.Frame, to_frame: ostk.physics.coordinate.Frame, coordinate_broker: ostk.astrodynamics.trajectory.state.CoordinateBroker) -> numpy.ndarray[numpy.float64[m, 1]]:
|
169
|
+
"""
|
170
|
+
Convert a Cartesian position from one reference frame to another.
|
171
|
+
|
172
|
+
Args:
|
173
|
+
instant (Instant): The instant of the conversion.
|
174
|
+
coordinates (numpy.ndarray): The Cartesian position to convert.
|
175
|
+
from_frame (str): The reference frame of the input Cartesian position.
|
176
|
+
to_frame (str): The reference frame of the output Cartesian position.
|
177
|
+
coordinate_broker (CoordinateBroker): The coordinate broker.
|
178
|
+
|
179
|
+
Returns:
|
180
|
+
numpy.ndarray: The Cartesian position in the output reference frame.
|
181
|
+
"""
|
182
|
+
class CartesianVelocity(ostk.astrodynamics.trajectory.state.CoordinateSubset):
|
183
|
+
"""
|
184
|
+
|
185
|
+
Cartesian velocity coordinate subset.
|
186
|
+
|
187
|
+
Defined with respect to a reference frame and a Cartesian position.
|
188
|
+
|
189
|
+
|
190
|
+
"""
|
191
|
+
@staticmethod
|
192
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
193
|
+
...
|
194
|
+
@staticmethod
|
195
|
+
def default() -> CartesianVelocity:
|
196
|
+
"""
|
197
|
+
Get the default Cartesian velocity subset.
|
198
|
+
|
199
|
+
Returns:
|
200
|
+
CartesianVelocity: The default Cartesian velocity subset.
|
201
|
+
"""
|
202
|
+
def __init__(self, cartesian_position: CartesianPosition, name: ostk.core.type.String) -> None:
|
203
|
+
"""
|
204
|
+
Constructor.
|
205
|
+
|
206
|
+
Args:
|
207
|
+
cartesian_position (CartesianPosition): The Cartesian position.
|
208
|
+
name (str): The name of the subset.
|
209
|
+
"""
|
210
|
+
def in_frame(self, instant: ostk.physics.time.Instant, coordinates: numpy.ndarray[numpy.float64[m, 1]], from_frame: ostk.physics.coordinate.Frame, to_frame: ostk.physics.coordinate.Frame, coordinate_broker: ostk.astrodynamics.trajectory.state.CoordinateBroker) -> numpy.ndarray[numpy.float64[m, 1]]:
|
211
|
+
"""
|
212
|
+
Convert a Cartesian velocity from one reference frame to another.
|
213
|
+
|
214
|
+
Args:
|
215
|
+
instant (Instant): The instant of the conversion.
|
216
|
+
coordinates (numpy.ndarray): The Cartesian velocity to convert.
|
217
|
+
from_frame (str): The reference frame of the input Cartesian velocity.
|
218
|
+
to_frame (str): The reference frame of the output Cartesian velocity.
|
219
|
+
coordinate_broker (CoordinateBroker): The coordinate broker.
|
220
|
+
|
221
|
+
Returns:
|
222
|
+
numpy.ndarray: The Cartesian velocity in the output reference frame.
|
223
|
+
"""
|
ostk/astrodynamics/viewer.py
CHANGED
@@ -188,6 +188,7 @@ class Viewer:
|
|
188
188
|
position: Position,
|
189
189
|
size: int | None = None,
|
190
190
|
color: str | None = None,
|
191
|
+
label: str | None = None,
|
191
192
|
) -> None:
|
192
193
|
"""
|
193
194
|
Add target to Viewer.
|
@@ -196,6 +197,7 @@ class Viewer:
|
|
196
197
|
position (Position): Target position.
|
197
198
|
size (int, optional): Target size. Defaults to None.
|
198
199
|
color (str, optional): Target color. Defaults to None.
|
200
|
+
label (str, optional): Target label. Defaults to None.
|
199
201
|
"""
|
200
202
|
|
201
203
|
self._viewer.entities.add(
|
@@ -206,6 +208,9 @@ class Viewer:
|
|
206
208
|
)
|
207
209
|
)
|
208
210
|
|
211
|
+
if label:
|
212
|
+
self.add_label(position, label, size, color)
|
213
|
+
|
209
214
|
def add_line(
|
210
215
|
self,
|
211
216
|
positions: list[Position],
|
@@ -242,6 +247,33 @@ class Viewer:
|
|
242
247
|
)
|
243
248
|
)
|
244
249
|
|
250
|
+
def add_label(
|
251
|
+
self,
|
252
|
+
position: Position,
|
253
|
+
text: str,
|
254
|
+
size: int | None = None,
|
255
|
+
color: str | None = None,
|
256
|
+
) -> None:
|
257
|
+
"""
|
258
|
+
Add label to Viewer.
|
259
|
+
|
260
|
+
Args:
|
261
|
+
position (Position): Label position.
|
262
|
+
text (str): Label text.
|
263
|
+
size (int, optional): Label size. Defaults to None.
|
264
|
+
color (str, optional): Label color. Defaults to None.
|
265
|
+
|
266
|
+
"""
|
267
|
+
|
268
|
+
self._viewer.entities.add(
|
269
|
+
cesiumpy.Label(
|
270
|
+
position=_cesium_from_ostk_position(position),
|
271
|
+
text=text,
|
272
|
+
scale=size or 10,
|
273
|
+
fill_color=color or cesiumpy.color.WHITE,
|
274
|
+
)
|
275
|
+
)
|
276
|
+
|
245
277
|
def render(self) -> str:
|
246
278
|
"""
|
247
279
|
Render Viewer as HTML string.
|