open-space-toolkit-astrodynamics 17.2.0__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-17.2.0.dist-info/METADATA +30 -0
- open_space_toolkit_astrodynamics-17.2.0.dist-info/RECORD +151 -0
- open_space_toolkit_astrodynamics-17.2.0.dist-info/WHEEL +5 -0
- open_space_toolkit_astrodynamics-17.2.0.dist-info/top_level.txt +1 -0
- open_space_toolkit_astrodynamics-17.2.0.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/__init__.pyi +720 -0
- ostk/astrodynamics/access.pyi +577 -0
- ostk/astrodynamics/conjunction/__init__.pyi +121 -0
- ostk/astrodynamics/conjunction/close_approach.pyi +89 -0
- ostk/astrodynamics/conjunction/message/__init__.pyi +3 -0
- ostk/astrodynamics/conjunction/message/ccsds.pyi +705 -0
- ostk/astrodynamics/converters.py +130 -0
- ostk/astrodynamics/converters.pyi +58 -0
- ostk/astrodynamics/data/__init__.pyi +3 -0
- ostk/astrodynamics/data/provider.pyi +22 -0
- ostk/astrodynamics/dataframe.py +597 -0
- ostk/astrodynamics/display.py +281 -0
- ostk/astrodynamics/dynamics.pyi +311 -0
- ostk/astrodynamics/eclipse.pyi +70 -0
- ostk/astrodynamics/estimator.pyi +268 -0
- ostk/astrodynamics/event_condition.pyi +910 -0
- ostk/astrodynamics/flight/__init__.pyi +626 -0
- ostk/astrodynamics/flight/profile/__init__.pyi +99 -0
- ostk/astrodynamics/flight/profile/model.pyi +179 -0
- ostk/astrodynamics/flight/system.pyi +268 -0
- ostk/astrodynamics/guidance_law.pyi +416 -0
- ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.17 +0 -0
- ostk/astrodynamics/pytrajectory/__init__.py +1 -0
- ostk/astrodynamics/pytrajectory/__init__.pyi +3 -0
- ostk/astrodynamics/pytrajectory/pystate.py +263 -0
- ostk/astrodynamics/pytrajectory/pystate.pyi +66 -0
- ostk/astrodynamics/solver.pyi +432 -0
- ostk/astrodynamics/test/__init__.py +1 -0
- ostk/astrodynamics/test/access/__init__.py +1 -0
- ostk/astrodynamics/test/access/test_generator.py +319 -0
- ostk/astrodynamics/test/access/test_visibility_criterion.py +201 -0
- ostk/astrodynamics/test/conftest.py +119 -0
- ostk/astrodynamics/test/conjunction/close_approach/__init__.py +0 -0
- ostk/astrodynamics/test/conjunction/close_approach/test_generator.py +228 -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/conjunction/test_close_approach.py +244 -0
- ostk/astrodynamics/test/data/provider/test_off_nadir.py +58 -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 +157 -0
- ostk/astrodynamics/test/eclipse/__init__.py +1 -0
- ostk/astrodynamics/test/eclipse/test_generator.py +138 -0
- ostk/astrodynamics/test/estimator/test_orbit_determination_solver.py +261 -0
- ostk/astrodynamics/test/estimator/test_tle_solver.py +216 -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_brouwer_lyddane_mean_long_condition.py +135 -0
- ostk/astrodynamics/test/event_condition/test_coe_condition.py +135 -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/profile/model/test_tabulated_profile.py +115 -0
- ostk/astrodynamics/test/flight/system/__init__.py +1 -0
- ostk/astrodynamics/test/flight/system/test_propulsion_system.py +64 -0
- ostk/astrodynamics/test/flight/system/test_satellite_system.py +83 -0
- ostk/astrodynamics/test/flight/system/test_satellite_system_builder.py +71 -0
- ostk/astrodynamics/test/flight/test_maneuver.py +231 -0
- ostk/astrodynamics/test/flight/test_profile.py +293 -0
- ostk/astrodynamics/test/flight/test_system.py +45 -0
- ostk/astrodynamics/test/guidance_law/test_constant_thrust.py +177 -0
- ostk/astrodynamics/test/guidance_law/test_guidance_law.py +60 -0
- ostk/astrodynamics/test/guidance_law/test_heterogeneous_guidance_law.py +164 -0
- ostk/astrodynamics/test/guidance_law/test_qlaw.py +209 -0
- ostk/astrodynamics/test/solvers/__init__.py +1 -0
- ostk/astrodynamics/test/solvers/test_finite_difference_solver.py +196 -0
- ostk/astrodynamics/test/solvers/test_least_squares_solver.py +334 -0
- ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +161 -0
- ostk/astrodynamics/test/test_access.py +128 -0
- ostk/astrodynamics/test/test_converters.py +290 -0
- ostk/astrodynamics/test/test_dataframe.py +1355 -0
- ostk/astrodynamics/test/test_display.py +184 -0
- ostk/astrodynamics/test/test_event_condition.py +80 -0
- ostk/astrodynamics/test/test_import.py +26 -0
- ostk/astrodynamics/test/test_root_solver.py +70 -0
- ostk/astrodynamics/test/test_trajectory.py +126 -0
- ostk/astrodynamics/test/test_utilities.py +338 -0
- ostk/astrodynamics/test/test_viewer.py +318 -0
- ostk/astrodynamics/test/trajectory/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/model/test_nadir_trajectory.py +87 -0
- ostk/astrodynamics/test/trajectory/model/test_tabulated_trajectory.py +303 -0
- ostk/astrodynamics/test/trajectory/model/test_target_scan_trajectory.py +126 -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 +305 -0
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +337 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +130 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_modified_equinoctial.py +142 -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_acceleration.py +136 -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 +58 -0
- ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +316 -0
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_direction.py +81 -0
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_factory.py +119 -0
- ostk/astrodynamics/test/trajectory/test_model.py +1 -0
- ostk/astrodynamics/test/trajectory/test_orbit.py +212 -0
- ostk/astrodynamics/test/trajectory/test_propagator.py +452 -0
- ostk/astrodynamics/test/trajectory/test_segment.py +694 -0
- ostk/astrodynamics/test/trajectory/test_sequence.py +550 -0
- ostk/astrodynamics/test/trajectory/test_state.py +629 -0
- ostk/astrodynamics/test/trajectory/test_state_builder.py +172 -0
- ostk/astrodynamics/trajectory/__init__.pyi +1982 -0
- ostk/astrodynamics/trajectory/model.pyi +259 -0
- ostk/astrodynamics/trajectory/orbit/__init__.pyi +349 -0
- ostk/astrodynamics/trajectory/orbit/message/__init__.pyi +3 -0
- ostk/astrodynamics/trajectory/orbit/message/spacex.pyi +264 -0
- ostk/astrodynamics/trajectory/orbit/model/__init__.pyi +648 -0
- ostk/astrodynamics/trajectory/orbit/model/brouwerLyddaneMean.pyi +121 -0
- ostk/astrodynamics/trajectory/orbit/model/kepler.pyi +709 -0
- ostk/astrodynamics/trajectory/orbit/model/sgp4.pyi +330 -0
- ostk/astrodynamics/trajectory/state/__init__.pyi +402 -0
- ostk/astrodynamics/trajectory/state/coordinate_subset.pyi +208 -0
- ostk/astrodynamics/utilities.py +396 -0
- ostk/astrodynamics/viewer.py +851 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import numpy as np
|
|
3
|
+
from ostk.astrodynamics.converters import coerce_to_instant
|
|
4
|
+
import ostk.astrodynamics.trajectory
|
|
5
|
+
from ostk.astrodynamics.trajectory import State
|
|
6
|
+
from ostk.astrodynamics.trajectory import StateBuilder
|
|
7
|
+
from ostk.astrodynamics.trajectory.state import CoordinateSubset
|
|
8
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import AngularVelocity
|
|
9
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import AttitudeQuaternion
|
|
10
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianPosition
|
|
11
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianVelocity
|
|
12
|
+
import ostk.physics.coordinate
|
|
13
|
+
from ostk.physics.coordinate import Frame
|
|
14
|
+
from ostk.physics.time import Instant
|
|
15
|
+
import re as 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
|
+
def custom_class_generator(frame: ostk.physics.coordinate.Frame, coordinate_subsets: list) -> type:
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
Emit a custom class type for States. This is meta-programming syntactic sugar on top of the StateBuilder class.
|
|
21
|
+
|
|
22
|
+
StateType = State.template(frame, coordinate_subsets)
|
|
23
|
+
state = StateType(instant, coordinates)
|
|
24
|
+
|
|
25
|
+
is equivalent to
|
|
26
|
+
|
|
27
|
+
state_builder = StateBuilder(frame, coordinate_subsets)
|
|
28
|
+
state = state_builder.build(instant, coordinates)
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
def from_dict(data: dict) -> ostk.astrodynamics.trajectory.State:
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
Create a State from a dictionary.
|
|
35
|
+
|
|
36
|
+
Note: Implicit assumption that ECEF = ITRF, and ECI = GCRF.
|
|
37
|
+
|
|
38
|
+
The dictionary must contain the following:
|
|
39
|
+
- 'timestamp': The timestamp of the state.
|
|
40
|
+
- 'r_ITRF_x'/'rx'/'rx_eci'/'rx_ecef': The x-coordinate of the position.
|
|
41
|
+
- 'r_ITRF_y'/'ry'/'ry_eci'/'ry_ecef': The y-coordinate of the position.
|
|
42
|
+
- 'r_ITRF_z'/'rz'/'rz_eci'/'rz_ecef': The z-coordinate of the position.
|
|
43
|
+
- 'v_ITRF_x'/'vx'/'vx_eci'/'vx_ecef': The x-coordinate of the velocity.
|
|
44
|
+
- 'v_ITRF_y'/'vy'/'vy_eci'/'vy_ecef': The y-coordinate of the velocity.
|
|
45
|
+
- 'v_ITRF_z'/'vz'/'vz_eci'/'vz_ecef': The z-coordinate of the velocity.
|
|
46
|
+
- 'frame': The frame of the state. Required if 'rx', 'ry', 'rz', 'vx', 'vy', 'vz' are provided.
|
|
47
|
+
- 'q_B_ECI_x': The x-coordinate of the quaternion. Optional.
|
|
48
|
+
- 'q_B_ECI_y': The y-coordinate of the quaternion. Optional.
|
|
49
|
+
- 'q_B_ECI_z': The z-coordinate of the quaternion. Optional.
|
|
50
|
+
- 'q_B_ECI_s': The s-coordinate of the quaternion. Optional.
|
|
51
|
+
- 'w_B_ECI_in_B_x': The x-coordinate of the angular velocity. Optional.
|
|
52
|
+
- 'w_B_ECI_in_B_y': The y-coordinate of the angular velocity. Optional.
|
|
53
|
+
- 'w_B_ECI_in_B_z': The z-coordinate of the angular velocity. Optional.
|
|
54
|
+
- 'drag_coefficient'/'cd': The drag coefficient. Optional.
|
|
55
|
+
- 'cross_sectional_area'/'surface_area': The cross-sectional area. Optional.
|
|
56
|
+
- 'mass': The mass. Optional.
|
|
57
|
+
- 'ballistic_coefficient'/'bc': The ballistic coefficient. Optional.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
data (dict): The dictionary.
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
State: The State.
|
|
64
|
+
|
|
65
|
+
"""
|
|
66
|
+
POS_VEL_CANONICAL_FORMAT: str = '(r|v)_(.*?)_(x|y|z)'
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import numpy
|
|
3
|
+
import ostk.core.type
|
|
4
|
+
import ostk.physics.time
|
|
5
|
+
import typing
|
|
6
|
+
__all__ = ['FiniteDifferenceSolver', 'LeastSquaresSolver', 'TemporalConditionSolver']
|
|
7
|
+
class FiniteDifferenceSolver:
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
A Finite Difference Solver to compute the gradient, state transition matrix, and jacobian of a function.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
class Type:
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
Type of finite difference scheme.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
Members:
|
|
22
|
+
|
|
23
|
+
Forward : Forward difference scheme.
|
|
24
|
+
|
|
25
|
+
Backward : Backward difference scheme.
|
|
26
|
+
|
|
27
|
+
Central : Central difference scheme.
|
|
28
|
+
"""
|
|
29
|
+
Backward: typing.ClassVar[FiniteDifferenceSolver.Type] # value = <Type.Backward: 1>
|
|
30
|
+
Central: typing.ClassVar[FiniteDifferenceSolver.Type] # value = <Type.Central: 2>
|
|
31
|
+
Forward: typing.ClassVar[FiniteDifferenceSolver.Type] # value = <Type.Forward: 0>
|
|
32
|
+
__members__: typing.ClassVar[dict[str, FiniteDifferenceSolver.Type]] # value = {'Forward': <Type.Forward: 0>, 'Backward': <Type.Backward: 1>, 'Central': <Type.Central: 2>}
|
|
33
|
+
def __eq__(self, other: typing.Any) -> bool:
|
|
34
|
+
...
|
|
35
|
+
def __getstate__(self) -> int:
|
|
36
|
+
...
|
|
37
|
+
def __hash__(self) -> int:
|
|
38
|
+
...
|
|
39
|
+
def __index__(self) -> int:
|
|
40
|
+
...
|
|
41
|
+
def __init__(self, value: int) -> None:
|
|
42
|
+
...
|
|
43
|
+
def __int__(self) -> int:
|
|
44
|
+
...
|
|
45
|
+
def __ne__(self, other: typing.Any) -> bool:
|
|
46
|
+
...
|
|
47
|
+
def __repr__(self) -> str:
|
|
48
|
+
...
|
|
49
|
+
def __setstate__(self, state: int) -> None:
|
|
50
|
+
...
|
|
51
|
+
def __str__(self) -> str:
|
|
52
|
+
...
|
|
53
|
+
@property
|
|
54
|
+
def name(self) -> str:
|
|
55
|
+
...
|
|
56
|
+
@property
|
|
57
|
+
def value(self) -> int:
|
|
58
|
+
...
|
|
59
|
+
@staticmethod
|
|
60
|
+
def default() -> FiniteDifferenceSolver:
|
|
61
|
+
"""
|
|
62
|
+
Get the default Finite Difference Solver.
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
FiniteDifferenceSolver: The default Finite Difference Solver.
|
|
66
|
+
"""
|
|
67
|
+
@staticmethod
|
|
68
|
+
def string_from_type(type: FiniteDifferenceSolver.Type) -> ostk.core.type.String:
|
|
69
|
+
"""
|
|
70
|
+
Convert a type to string.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
type (FiniteDifferenceSolver.Type): The type.
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
str: The string name of the type.
|
|
77
|
+
"""
|
|
78
|
+
def __init__(self, type: FiniteDifferenceSolver.Type, step_percentage: ostk.core.type.Real, step_duration: ostk.physics.time.Duration) -> None:
|
|
79
|
+
"""
|
|
80
|
+
Construct a FiniteDifferenceSolver.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
type (FiniteDifferenceSolver.Type): Type of finite difference scheme.
|
|
84
|
+
step_percentage (float): The step percentage to use for computing the STM/Jacobian.
|
|
85
|
+
step_duration (Duration): The step duration to use for computing the gradient.
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
FiniteDifferenceSolver: The FiniteDifferenceSolver.
|
|
89
|
+
"""
|
|
90
|
+
def __repr__(self) -> str:
|
|
91
|
+
...
|
|
92
|
+
def __str__(self) -> str:
|
|
93
|
+
...
|
|
94
|
+
def compute_gradient(self, state: typing.Any, generate_state_coordinates: typing.Callable[[..., ostk.physics.time.Instant], numpy.ndarray[numpy.float64[m, 1]]]) -> numpy.ndarray[numpy.float64[m, 1]]:
|
|
95
|
+
"""
|
|
96
|
+
Compute the gradient.
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
state (State): The state.
|
|
100
|
+
generate_state_coordinates (function): The function to generate the state coordinates.
|
|
101
|
+
|
|
102
|
+
Returns:
|
|
103
|
+
np.array: The gradient of the state, matching the coordinates from generate_state_coordinates.
|
|
104
|
+
"""
|
|
105
|
+
def compute_jacobian(self, state: typing.Any, generate_state_coordinates: typing.Callable[[..., ostk.physics.time.Instant], numpy.ndarray[numpy.float64[m, 1]]]) -> numpy.ndarray[numpy.float64[m, n]]:
|
|
106
|
+
"""
|
|
107
|
+
Compute the jacobian.
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
state (State): The state.
|
|
111
|
+
generate_state_coordinates (function): The function to generate the state coordinates.
|
|
112
|
+
|
|
113
|
+
Returns:
|
|
114
|
+
np.array: The jacobian.
|
|
115
|
+
"""
|
|
116
|
+
@typing.overload
|
|
117
|
+
def compute_state_transition_matrix(self, state: typing.Any, instants: list[ostk.physics.time.Instant], generate_states_coordinates: typing.Callable[[..., list[ostk.physics.time.Instant]], numpy.ndarray[numpy.float64[m, n]]]) -> list[numpy.ndarray[numpy.float64[m, n]]]:
|
|
118
|
+
"""
|
|
119
|
+
Compute a list of state transition matrix (STM) at the provided instants.
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
state (State): The state.
|
|
123
|
+
instants (Array(Instant)): The instants at which to calculate the STM.
|
|
124
|
+
generate_states_coordinates (callable): The function to get the states coordinates as a matrix. Each column is a set of state coordinates.
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
np.array: The list of state transition matrices.
|
|
128
|
+
"""
|
|
129
|
+
@typing.overload
|
|
130
|
+
def compute_state_transition_matrix(self, state: typing.Any, instant: ostk.physics.time.Instant, generate_state_coordinates: typing.Callable[[..., ostk.physics.time.Instant], numpy.ndarray[numpy.float64[m, 1]]]) -> numpy.ndarray[numpy.float64[m, n]]:
|
|
131
|
+
"""
|
|
132
|
+
Compute the state transition matrix (STM).
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
state (State): The state.
|
|
136
|
+
instant (Instant): The instant at which to calculate the STM.
|
|
137
|
+
generate_state_coordinates (callable): The function to get the state coordinates. Must be a column vector.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
np.array: The state transition matrix.
|
|
141
|
+
"""
|
|
142
|
+
def get_step_duration(self) -> ostk.physics.time.Duration:
|
|
143
|
+
"""
|
|
144
|
+
Get the step duration used for computing the gradient.
|
|
145
|
+
|
|
146
|
+
Returns:
|
|
147
|
+
Duration: The step duration.
|
|
148
|
+
"""
|
|
149
|
+
def get_step_percentage(self) -> ostk.core.type.Real:
|
|
150
|
+
"""
|
|
151
|
+
Get the step percentage used for computing the STM.
|
|
152
|
+
|
|
153
|
+
Returns:
|
|
154
|
+
float: The step percentage.
|
|
155
|
+
"""
|
|
156
|
+
def get_type(self) -> FiniteDifferenceSolver.Type:
|
|
157
|
+
"""
|
|
158
|
+
Get the type.
|
|
159
|
+
|
|
160
|
+
Returns:
|
|
161
|
+
FiniteDifferenceSolver.Type: The type.
|
|
162
|
+
"""
|
|
163
|
+
class LeastSquaresSolver:
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
Class to solve non-linear least squares problems.
|
|
167
|
+
|
|
168
|
+
"""
|
|
169
|
+
class Analysis:
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
Class representing the analysis of the least squares solver.
|
|
173
|
+
|
|
174
|
+
"""
|
|
175
|
+
def __init__(self, termination_criteria: ostk.core.type.String, estimated_state: typing.Any, estimated_covariance: numpy.ndarray[numpy.float64[m, n]], estimated_frisbee_covariance: numpy.ndarray[numpy.float64[m, n]], computed_observations: list[...], steps: list[LeastSquaresSolver.Step]) -> None:
|
|
176
|
+
"""
|
|
177
|
+
Constructor.
|
|
178
|
+
|
|
179
|
+
Args:
|
|
180
|
+
termination_criteria (str): The termination criteria.
|
|
181
|
+
estimated_state (State): The estimated state.
|
|
182
|
+
estimated_covariance (np.ndarray): The estimated covariance matrix.
|
|
183
|
+
estimated_frisbee_covariance (np.ndarray): The estimated Frisbee covariance matrix.
|
|
184
|
+
computed_observations (list[State]): The computed observations of the final iteration.
|
|
185
|
+
steps (list[LeastSquaresSolver.Step]): The steps.
|
|
186
|
+
"""
|
|
187
|
+
def __repr__(self) -> str:
|
|
188
|
+
...
|
|
189
|
+
def __str__(self) -> str:
|
|
190
|
+
...
|
|
191
|
+
def compute_residual_states(self, observations: list[...]) -> list[...]:
|
|
192
|
+
"""
|
|
193
|
+
Compute the residual states.
|
|
194
|
+
|
|
195
|
+
Args:
|
|
196
|
+
observations (list[State]): The observations.
|
|
197
|
+
|
|
198
|
+
Returns:
|
|
199
|
+
list[State]: The residuals.
|
|
200
|
+
"""
|
|
201
|
+
@property
|
|
202
|
+
def computed_observations(self) -> list[...]:
|
|
203
|
+
"""
|
|
204
|
+
The computed observations of the final iteration.
|
|
205
|
+
|
|
206
|
+
:type: np.ndarray
|
|
207
|
+
"""
|
|
208
|
+
@property
|
|
209
|
+
def estimated_covariance(self) -> numpy.ndarray[numpy.float64[m, n]]:
|
|
210
|
+
"""
|
|
211
|
+
The estimated covariance matrix.
|
|
212
|
+
|
|
213
|
+
:type: np.ndarray
|
|
214
|
+
"""
|
|
215
|
+
@property
|
|
216
|
+
def estimated_frisbee_covariance(self) -> numpy.ndarray[numpy.float64[m, n]]:
|
|
217
|
+
"""
|
|
218
|
+
The estimated Frisbee covariance matrix.
|
|
219
|
+
|
|
220
|
+
:type: np.ndarray
|
|
221
|
+
"""
|
|
222
|
+
@property
|
|
223
|
+
def estimated_state(self) -> ...:
|
|
224
|
+
"""
|
|
225
|
+
The estimated state.
|
|
226
|
+
|
|
227
|
+
:type: State
|
|
228
|
+
"""
|
|
229
|
+
@property
|
|
230
|
+
def iteration_count(self) -> int:
|
|
231
|
+
"""
|
|
232
|
+
The iteration count.
|
|
233
|
+
|
|
234
|
+
:type: int
|
|
235
|
+
"""
|
|
236
|
+
@property
|
|
237
|
+
def observation_count(self) -> int:
|
|
238
|
+
"""
|
|
239
|
+
The observation count.
|
|
240
|
+
|
|
241
|
+
:type: int
|
|
242
|
+
"""
|
|
243
|
+
@property
|
|
244
|
+
def rms_error(self) -> ostk.core.type.Real:
|
|
245
|
+
"""
|
|
246
|
+
The RMS error.
|
|
247
|
+
|
|
248
|
+
:type: float
|
|
249
|
+
"""
|
|
250
|
+
@property
|
|
251
|
+
def steps(self) -> list[LeastSquaresSolver.Step]:
|
|
252
|
+
"""
|
|
253
|
+
The steps.
|
|
254
|
+
|
|
255
|
+
:type: list[LeastSquaresSolver.Step]
|
|
256
|
+
"""
|
|
257
|
+
@property
|
|
258
|
+
def termination_criteria(self) -> ostk.core.type.String:
|
|
259
|
+
"""
|
|
260
|
+
The termination criteria.
|
|
261
|
+
|
|
262
|
+
:type: str
|
|
263
|
+
"""
|
|
264
|
+
class Step:
|
|
265
|
+
"""
|
|
266
|
+
|
|
267
|
+
Class representing a step in the least squares solver.
|
|
268
|
+
|
|
269
|
+
"""
|
|
270
|
+
def __init__(self, rms_error: ostk.core.type.Real, x_hat: numpy.ndarray[numpy.float64[m, 1]]) -> None:
|
|
271
|
+
"""
|
|
272
|
+
Constructor.
|
|
273
|
+
|
|
274
|
+
Args:
|
|
275
|
+
rms_error (float): The RMS error.
|
|
276
|
+
x_hat (np.ndarray): The X hat vector.
|
|
277
|
+
"""
|
|
278
|
+
def __repr__(self) -> str:
|
|
279
|
+
...
|
|
280
|
+
def __str__(self) -> str:
|
|
281
|
+
...
|
|
282
|
+
@property
|
|
283
|
+
def rms_error(self) -> ostk.core.type.Real:
|
|
284
|
+
"""
|
|
285
|
+
The RMS error.
|
|
286
|
+
|
|
287
|
+
:type: float
|
|
288
|
+
"""
|
|
289
|
+
@property
|
|
290
|
+
def x_hat(self) -> numpy.ndarray[numpy.float64[m, 1]]:
|
|
291
|
+
"""
|
|
292
|
+
The X hat vector.
|
|
293
|
+
|
|
294
|
+
:type: np.ndarray
|
|
295
|
+
"""
|
|
296
|
+
@staticmethod
|
|
297
|
+
def calculate_empirical_covariance(residuals: list[...]) -> numpy.ndarray[numpy.float64[m, n]]:
|
|
298
|
+
"""
|
|
299
|
+
Calculate the empirical covariance matrix from an array of state residuals.
|
|
300
|
+
|
|
301
|
+
Args:
|
|
302
|
+
residuals (list[State]): A list of state residuals.
|
|
303
|
+
|
|
304
|
+
Returns:
|
|
305
|
+
np.ndarray: The empirical covariance matrix.
|
|
306
|
+
|
|
307
|
+
Throws:
|
|
308
|
+
ostk::core::error::runtime::Undefined: If the residual array is empty.
|
|
309
|
+
"""
|
|
310
|
+
@staticmethod
|
|
311
|
+
def default() -> LeastSquaresSolver:
|
|
312
|
+
"""
|
|
313
|
+
Create a default instance of LeastSquaresSolver.
|
|
314
|
+
|
|
315
|
+
Returns:
|
|
316
|
+
LeastSquaresSolver: A default instance of LeastSquaresSolver.
|
|
317
|
+
"""
|
|
318
|
+
def __init__(self, maximum_iteration_count: int, rms_update_threshold: ostk.core.type.Real, finite_difference_solver: FiniteDifferenceSolver = ...) -> None:
|
|
319
|
+
"""
|
|
320
|
+
Constructor.
|
|
321
|
+
|
|
322
|
+
Args:
|
|
323
|
+
maximum_iteration_count (int): Maximum number of iterations.
|
|
324
|
+
rms_update_threshold (float): Minimum RMS threshold.
|
|
325
|
+
finite_difference_solver (FiniteDifferenceSolver): Finite difference solver. Defaults to FiniteDifferenceSolver.Default().
|
|
326
|
+
"""
|
|
327
|
+
def get_finite_difference_solver(self) -> FiniteDifferenceSolver:
|
|
328
|
+
"""
|
|
329
|
+
Get the finite difference solver.
|
|
330
|
+
|
|
331
|
+
Returns:
|
|
332
|
+
FiniteDifferenceSolver: The finite difference solver.
|
|
333
|
+
"""
|
|
334
|
+
def get_max_iteration_count(self) -> int:
|
|
335
|
+
"""
|
|
336
|
+
Get the maximum iteration count.
|
|
337
|
+
|
|
338
|
+
Returns:
|
|
339
|
+
int: The maximum iteration count.
|
|
340
|
+
"""
|
|
341
|
+
def get_rms_update_threshold(self) -> ostk.core.type.Real:
|
|
342
|
+
"""
|
|
343
|
+
Get the RMS update threshold.
|
|
344
|
+
|
|
345
|
+
Returns:
|
|
346
|
+
float: The RMS update threshold.
|
|
347
|
+
"""
|
|
348
|
+
def solve(self, initial_guess: typing.Any, observations: list[...], state_generator: typing.Callable[[..., list[ostk.physics.time.Instant]], list[...]], initial_guess_sigmas: dict[..., numpy.ndarray[numpy.float64[m, 1]]] = {}, observation_sigmas: dict[..., numpy.ndarray[numpy.float64[m, 1]]] = {}) -> LeastSquaresSolver.Analysis:
|
|
349
|
+
"""
|
|
350
|
+
Solve the non-linear least squares problem.
|
|
351
|
+
|
|
352
|
+
Args:
|
|
353
|
+
initial_guess (State): Initial guess state (the Estimated State is of the same domain as this state).
|
|
354
|
+
observations (list[State]): List of observations.
|
|
355
|
+
state_generator (callable[list[State],[State, list[Instant]]]): Function to generate states.
|
|
356
|
+
initial_guess_sigmas (dict[CoordinateSubset, np.ndarray], optional): Dictionary of sigmas for initial guess.
|
|
357
|
+
observation_sigmas (dict[CoordinateSubset, np.ndarray], optional): Dictionary of sigmas for observations.
|
|
358
|
+
|
|
359
|
+
Returns:
|
|
360
|
+
LeastSquaresSolver::Analysis: The analysis of the estimate.
|
|
361
|
+
"""
|
|
362
|
+
class TemporalConditionSolver:
|
|
363
|
+
"""
|
|
364
|
+
|
|
365
|
+
Given a set of conditions and a time interval, the solver computes all sub-intervals over which conditions are met.
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
"""
|
|
369
|
+
def __init__(self, time_step: ostk.physics.time.Duration, tolerance: ostk.physics.time.Duration, maximum_iteration_count: int = 500) -> None:
|
|
370
|
+
"""
|
|
371
|
+
Constructor.
|
|
372
|
+
|
|
373
|
+
Note:
|
|
374
|
+
Be careful When selecting the time_step.
|
|
375
|
+
A very small step can lead to higher precision, but increased runtime and memory consumption.
|
|
376
|
+
On the other hand, a step that is too large, can result in missing event windows that are shorter than the time_step.
|
|
377
|
+
For example:
|
|
378
|
+
5 min -> 1----1----0----0----0----1----0 => 2 windows
|
|
379
|
+
1 min -> 110011100011000000000111100 => 4 windows
|
|
380
|
+
|
|
381
|
+
Args:
|
|
382
|
+
time_step (Duration): The time step used to generate the temporal grid, within which condition switching instants are
|
|
383
|
+
searched. This must be set to be smaller than the smallest expected interval over which the condition changes
|
|
384
|
+
state in order to avoid missing any switching instants.
|
|
385
|
+
tolerance (Duration): The tolerance of the solver.
|
|
386
|
+
maximum_iteration_count (int): The maximum number of iterations allowed.
|
|
387
|
+
"""
|
|
388
|
+
def get_maximum_iteration_count(self) -> int:
|
|
389
|
+
"""
|
|
390
|
+
Get the maximum number of iterations allowed.
|
|
391
|
+
|
|
392
|
+
Returns:
|
|
393
|
+
int: The maximum number of iterations allowed.
|
|
394
|
+
"""
|
|
395
|
+
def get_time_step(self) -> ostk.physics.time.Duration:
|
|
396
|
+
"""
|
|
397
|
+
Get the time step.
|
|
398
|
+
|
|
399
|
+
Returns:
|
|
400
|
+
Duration: The time step.
|
|
401
|
+
"""
|
|
402
|
+
def get_tolerance(self) -> ostk.physics.time.Duration:
|
|
403
|
+
"""
|
|
404
|
+
Get the tolerance.
|
|
405
|
+
|
|
406
|
+
Returns:
|
|
407
|
+
Duration: The tolerance.
|
|
408
|
+
"""
|
|
409
|
+
@typing.overload
|
|
410
|
+
def solve(self, condition: typing.Callable[[ostk.physics.time.Instant], bool], interval: ostk.physics.time.Interval) -> list[ostk.physics.time.Interval]:
|
|
411
|
+
"""
|
|
412
|
+
Solve a temporal condition.
|
|
413
|
+
|
|
414
|
+
Args:
|
|
415
|
+
condition (function): The condition to solve.
|
|
416
|
+
interval (Interval): The interval to solve the condition over.
|
|
417
|
+
|
|
418
|
+
Returns:
|
|
419
|
+
Duration: The time at which the condition is satisfied.
|
|
420
|
+
"""
|
|
421
|
+
@typing.overload
|
|
422
|
+
def solve(self, conditions: list[typing.Callable[[ostk.physics.time.Instant], bool]], interval: ostk.physics.time.Interval) -> list[ostk.physics.time.Interval]:
|
|
423
|
+
"""
|
|
424
|
+
Solve an array of temporal conditions.
|
|
425
|
+
|
|
426
|
+
Args:
|
|
427
|
+
conditions (list): The conditions to solve.
|
|
428
|
+
interval (Interval): The interval to solve the conditions over.
|
|
429
|
+
|
|
430
|
+
Returns:
|
|
431
|
+
list: The times at which the conditions are satisfied.
|
|
432
|
+
"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Apache License 2.0
|