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,281 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import warnings
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
import pandas as pd
|
|
9
|
+
|
|
10
|
+
import plotly.graph_objs as go
|
|
11
|
+
|
|
12
|
+
from ostk.mathematics.object import RealInterval
|
|
13
|
+
|
|
14
|
+
from ostk.physics.coordinate import Frame
|
|
15
|
+
from ostk.physics.coordinate.spherical import LLA
|
|
16
|
+
from ostk.physics.environment.object import Celestial
|
|
17
|
+
from ostk.physics.time import Duration
|
|
18
|
+
from ostk.physics.time import Instant
|
|
19
|
+
|
|
20
|
+
from ostk.astrodynamics import Access
|
|
21
|
+
from ostk.astrodynamics import Trajectory
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
DEFAULT_COLOR: str = "rgba(255, 0, 0, 0.5)"
|
|
25
|
+
|
|
26
|
+
DEFAULT_LAYOUT_2D: go.Layout = go.Layout(
|
|
27
|
+
title=None,
|
|
28
|
+
showlegend=False,
|
|
29
|
+
height=1000,
|
|
30
|
+
geo=go.layout.Geo(
|
|
31
|
+
showland=True,
|
|
32
|
+
landcolor="rgb(243, 243, 243)",
|
|
33
|
+
countrycolor="rgb(204, 204, 204)",
|
|
34
|
+
lonaxis=dict(
|
|
35
|
+
showgrid=True,
|
|
36
|
+
gridcolor="rgb(102, 102, 102)",
|
|
37
|
+
gridwidth=0.1,
|
|
38
|
+
),
|
|
39
|
+
lataxis=dict(
|
|
40
|
+
showgrid=True,
|
|
41
|
+
gridcolor="rgb(102, 102, 102)",
|
|
42
|
+
gridwidth=0.1,
|
|
43
|
+
),
|
|
44
|
+
),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
DEFAULT_LAYOUT_3D: go.Layout = go.Layout(
|
|
48
|
+
title=None,
|
|
49
|
+
showlegend=False,
|
|
50
|
+
height=1000,
|
|
51
|
+
geo=go.layout.Geo(
|
|
52
|
+
showland=True,
|
|
53
|
+
showlakes=True,
|
|
54
|
+
showcountries=False,
|
|
55
|
+
showocean=True,
|
|
56
|
+
countrywidth=0.0,
|
|
57
|
+
landcolor="rgb(100, 100, 100)",
|
|
58
|
+
lakecolor="rgb(240, 240, 240)",
|
|
59
|
+
oceancolor="rgb(240, 240, 240)",
|
|
60
|
+
projection=dict(
|
|
61
|
+
type="orthographic",
|
|
62
|
+
rotation=dict(
|
|
63
|
+
lon=0,
|
|
64
|
+
lat=0,
|
|
65
|
+
roll=0,
|
|
66
|
+
),
|
|
67
|
+
),
|
|
68
|
+
lonaxis=dict(
|
|
69
|
+
showgrid=True,
|
|
70
|
+
gridcolor="rgb(102, 102, 102)",
|
|
71
|
+
gridwidth=0.5,
|
|
72
|
+
),
|
|
73
|
+
lataxis=dict(
|
|
74
|
+
showgrid=True,
|
|
75
|
+
gridcolor="rgb(102, 102, 102)",
|
|
76
|
+
gridwidth=0.5,
|
|
77
|
+
),
|
|
78
|
+
),
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def convert_to_ground_track_plotting_data(
|
|
83
|
+
longitude: list,
|
|
84
|
+
latitude: list,
|
|
85
|
+
color: str = DEFAULT_COLOR,
|
|
86
|
+
) -> go.Scattergeo:
|
|
87
|
+
return go.Scattergeo(
|
|
88
|
+
lon=longitude,
|
|
89
|
+
lat=latitude,
|
|
90
|
+
mode="lines",
|
|
91
|
+
line=dict(
|
|
92
|
+
width=1,
|
|
93
|
+
color=color,
|
|
94
|
+
),
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def create_plotly_figure(
|
|
99
|
+
data: Any,
|
|
100
|
+
layout: go.Layout,
|
|
101
|
+
) -> go.Figure:
|
|
102
|
+
return go.Figure(
|
|
103
|
+
data=data,
|
|
104
|
+
layout=layout,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def create_2d_map(
|
|
109
|
+
data: Any,
|
|
110
|
+
) -> go.Figure:
|
|
111
|
+
return create_plotly_figure(data, DEFAULT_LAYOUT_2D)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def create_3d_globe(
|
|
115
|
+
data: Any,
|
|
116
|
+
) -> go.Figure:
|
|
117
|
+
return create_plotly_figure(data, DEFAULT_LAYOUT_3D)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class AccessesPlot:
|
|
121
|
+
"""
|
|
122
|
+
Accesses plot. Display a 2D world map, with 1 ground station and
|
|
123
|
+
multiple satellites, highlighting the accesses.
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
def __init__(
|
|
127
|
+
self,
|
|
128
|
+
earth: Celestial,
|
|
129
|
+
interval: RealInterval,
|
|
130
|
+
trajectory_step: Duration,
|
|
131
|
+
access_step: Duration,
|
|
132
|
+
):
|
|
133
|
+
self._data = []
|
|
134
|
+
self._earth = earth
|
|
135
|
+
self._trajectory_grid: list[Instant] = interval.generate_grid(trajectory_step)
|
|
136
|
+
self._access_step: Duration = access_step
|
|
137
|
+
|
|
138
|
+
def _generate_and_append_data(
|
|
139
|
+
self,
|
|
140
|
+
data: list[list[float]],
|
|
141
|
+
trajectory: Trajectory,
|
|
142
|
+
grid: list[Instant],
|
|
143
|
+
) -> None:
|
|
144
|
+
for state in trajectory.get_states_at(grid):
|
|
145
|
+
lla: LLA = LLA.cartesian(
|
|
146
|
+
state.get_position()
|
|
147
|
+
.in_frame(Frame.ITRF(), state.get_instant())
|
|
148
|
+
.get_coordinates(),
|
|
149
|
+
self._earth.get_equatorial_radius(),
|
|
150
|
+
self._earth.get_flattening(),
|
|
151
|
+
)
|
|
152
|
+
data.append(
|
|
153
|
+
[
|
|
154
|
+
float(lla.get_longitude().in_degrees()),
|
|
155
|
+
float(lla.get_latitude().in_degrees()),
|
|
156
|
+
]
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
def _append_line(
|
|
160
|
+
self,
|
|
161
|
+
df: pd.DataFrame,
|
|
162
|
+
width: int,
|
|
163
|
+
rgb: str,
|
|
164
|
+
) -> None:
|
|
165
|
+
self._data.append(
|
|
166
|
+
dict(
|
|
167
|
+
type="scattergeo",
|
|
168
|
+
lon=df["Longitude"],
|
|
169
|
+
lat=df["Latitude"],
|
|
170
|
+
mode="lines",
|
|
171
|
+
line=dict(
|
|
172
|
+
width=width,
|
|
173
|
+
color=rgb,
|
|
174
|
+
),
|
|
175
|
+
)
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
def add_ground_station(
|
|
179
|
+
self,
|
|
180
|
+
ground_station_lla: LLA,
|
|
181
|
+
color: str | tuple[int, int, int],
|
|
182
|
+
) -> None:
|
|
183
|
+
"""
|
|
184
|
+
Add a ground station to the plot.
|
|
185
|
+
|
|
186
|
+
Args:
|
|
187
|
+
ground_station_lla (LLA): The ground station location.
|
|
188
|
+
color (str | tuple[int, int, int]): The color of the ground station.
|
|
189
|
+
"""
|
|
190
|
+
if isinstance(color, (tuple, list)):
|
|
191
|
+
color = f"rgba({str(color[0])},{str(color[1])},{str(color[2])},1.0)"
|
|
192
|
+
|
|
193
|
+
self._data.append(
|
|
194
|
+
dict(
|
|
195
|
+
type="scattergeo",
|
|
196
|
+
lon=[float(ground_station_lla.get_longitude().in_degrees())],
|
|
197
|
+
lat=[float(ground_station_lla.get_latitude().in_degrees())],
|
|
198
|
+
mode="markers",
|
|
199
|
+
marker=dict(
|
|
200
|
+
size=10,
|
|
201
|
+
color=color,
|
|
202
|
+
),
|
|
203
|
+
)
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
def add_accesses(
|
|
207
|
+
self,
|
|
208
|
+
trajectory: Trajectory,
|
|
209
|
+
accesses: list[Access],
|
|
210
|
+
rgb: str | tuple[int, int, int],
|
|
211
|
+
) -> None:
|
|
212
|
+
"""
|
|
213
|
+
Add accesses to the plot.
|
|
214
|
+
|
|
215
|
+
Args:
|
|
216
|
+
trajectory (Trajectory): The satellite trajectory.
|
|
217
|
+
accesses (list[Access]): The list of accesses.
|
|
218
|
+
rgb (str | tuple[int, int, int]): The color of the accesses, as a string or tuple of RGB values.
|
|
219
|
+
"""
|
|
220
|
+
if isinstance(rgb, (tuple, list)):
|
|
221
|
+
rgb = f"rgba({str(rgb[0])},{str(rgb[1])},{str(rgb[2])},1.0)"
|
|
222
|
+
|
|
223
|
+
for access in accesses:
|
|
224
|
+
satellite_access_data: list[list[float]] = []
|
|
225
|
+
self._generate_and_append_data(
|
|
226
|
+
satellite_access_data,
|
|
227
|
+
trajectory,
|
|
228
|
+
access.get_interval().generate_grid(self._access_step),
|
|
229
|
+
)
|
|
230
|
+
satellite_access_df: pd.DataFrame = pd.DataFrame(
|
|
231
|
+
satellite_access_data,
|
|
232
|
+
columns=["Longitude", "Latitude"],
|
|
233
|
+
)
|
|
234
|
+
self._append_line(
|
|
235
|
+
satellite_access_df,
|
|
236
|
+
2,
|
|
237
|
+
rgb,
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
def add_satellite(
|
|
241
|
+
self,
|
|
242
|
+
trajectory: Trajectory,
|
|
243
|
+
rgb: str | tuple[int, int, int] | None = None,
|
|
244
|
+
opacity: float = 0.3,
|
|
245
|
+
) -> None:
|
|
246
|
+
"""
|
|
247
|
+
Add a satellite trajectory to the plot.
|
|
248
|
+
|
|
249
|
+
Args:
|
|
250
|
+
trajectory (Trajectory): The satellite trajectory.
|
|
251
|
+
rgb (str | tuple[int, int, int] | None, optional): The color of the satellite, as a string or tuple of RGB values.
|
|
252
|
+
opacity (float, optional): Opacity of the satellite trajectory line.
|
|
253
|
+
"""
|
|
254
|
+
if rgb is None:
|
|
255
|
+
rgb = f"rgba(255, 0, 0, {opacity})"
|
|
256
|
+
|
|
257
|
+
elif isinstance(rgb, (tuple, list)):
|
|
258
|
+
rgb = f"rgba({str(rgb[0])},{str(rgb[1])},{str(rgb[2])},{opacity})"
|
|
259
|
+
|
|
260
|
+
satellite_trajectory_data: list[list[float]] = []
|
|
261
|
+
self._generate_and_append_data(
|
|
262
|
+
satellite_trajectory_data,
|
|
263
|
+
trajectory,
|
|
264
|
+
self._trajectory_grid,
|
|
265
|
+
)
|
|
266
|
+
satellite_trajectory_df: pd.DataFrame = pd.DataFrame(
|
|
267
|
+
satellite_trajectory_data,
|
|
268
|
+
columns=["Longitude", "Latitude"],
|
|
269
|
+
)
|
|
270
|
+
self._append_line(
|
|
271
|
+
satellite_trajectory_df,
|
|
272
|
+
1,
|
|
273
|
+
rgb,
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
def show(self):
|
|
277
|
+
"""
|
|
278
|
+
Display the figure.
|
|
279
|
+
"""
|
|
280
|
+
figure = create_2d_map(data=self._data)
|
|
281
|
+
figure.show()
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import numpy
|
|
3
|
+
import ostk.astrodynamics
|
|
4
|
+
import ostk.astrodynamics.flight.system
|
|
5
|
+
import ostk.astrodynamics.trajectory.state
|
|
6
|
+
import ostk.core.type
|
|
7
|
+
import ostk.mathematics.curve_fitting
|
|
8
|
+
import ostk.physics.coordinate
|
|
9
|
+
import ostk.physics.environment.object
|
|
10
|
+
import ostk.physics.time
|
|
11
|
+
__all__ = ['AtmosphericDrag', 'CentralBodyGravity', 'PositionDerivative', 'Tabulated', 'ThirdBodyGravity', 'Thruster']
|
|
12
|
+
class AtmosphericDrag(ostk.astrodynamics.Dynamics):
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
The atmospheric drag dynamics.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
"""
|
|
19
|
+
def __init__(self, celestial: ostk.physics.environment.object.Celestial) -> None:
|
|
20
|
+
"""
|
|
21
|
+
Constructor.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
celestial (Celestial): The celestial body.
|
|
25
|
+
"""
|
|
26
|
+
def __repr__(self) -> str:
|
|
27
|
+
...
|
|
28
|
+
def __str__(self) -> str:
|
|
29
|
+
...
|
|
30
|
+
def compute_contribution(self, instant: ostk.physics.time.Instant, x: numpy.ndarray[numpy.float64[m, 1]], frame: ostk.physics.coordinate.Frame) -> numpy.ndarray[numpy.float64[m, 1]]:
|
|
31
|
+
"""
|
|
32
|
+
Compute the contribution of the atmospheric drag to the state vector.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
instant (Instant): The instant of the state vector.
|
|
36
|
+
x (numpy.ndarray): The state vector.
|
|
37
|
+
frame (Frame): The reference frame.
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
numpy.ndarray: The contribution of the atmospheric drag to the state vector.
|
|
41
|
+
"""
|
|
42
|
+
def get_celestial(self) -> ostk.physics.environment.object.Celestial:
|
|
43
|
+
"""
|
|
44
|
+
Get the celestial body.
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
Celestial: The celestial body.
|
|
48
|
+
"""
|
|
49
|
+
def is_defined(self) -> bool:
|
|
50
|
+
"""
|
|
51
|
+
Check if the atmospheric drag is defined.
|
|
52
|
+
|
|
53
|
+
Returns:
|
|
54
|
+
bool: True if the atmospheric drag is defined, False otherwise.
|
|
55
|
+
"""
|
|
56
|
+
class CentralBodyGravity(ostk.astrodynamics.Dynamics):
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
The central-body gravity model.
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
"""
|
|
63
|
+
def __init__(self, celestial: ostk.physics.environment.object.Celestial) -> None:
|
|
64
|
+
"""
|
|
65
|
+
Constructor.
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
celestial (Celestial): The central body.
|
|
69
|
+
"""
|
|
70
|
+
def __repr__(self) -> str:
|
|
71
|
+
...
|
|
72
|
+
def __str__(self) -> str:
|
|
73
|
+
...
|
|
74
|
+
def compute_contribution(self, instant: ostk.physics.time.Instant, x: numpy.ndarray[numpy.float64[m, 1]], frame: ostk.physics.coordinate.Frame) -> numpy.ndarray[numpy.float64[m, 1]]:
|
|
75
|
+
"""
|
|
76
|
+
Compute the contribution of the central-body gravity to the state vector.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
instant (Instant): The instant of the state vector.
|
|
80
|
+
x (numpy.ndarray): The state vector.
|
|
81
|
+
frame (Frame): The reference frame.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
numpy.ndarray: The contribution of the central-body gravity to the state vector.
|
|
85
|
+
"""
|
|
86
|
+
def get_celestial(self) -> ostk.physics.environment.object.Celestial:
|
|
87
|
+
"""
|
|
88
|
+
Get the central body.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
Celestial: The central body.
|
|
92
|
+
"""
|
|
93
|
+
def is_defined(self) -> bool:
|
|
94
|
+
"""
|
|
95
|
+
Check if the central-body gravity is defined.
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
bool: True if the central-body gravity is defined, False otherwise.
|
|
99
|
+
"""
|
|
100
|
+
class PositionDerivative(ostk.astrodynamics.Dynamics):
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
The position derivative model.
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
"""
|
|
107
|
+
def __init__(self) -> None:
|
|
108
|
+
"""
|
|
109
|
+
Constructor.
|
|
110
|
+
"""
|
|
111
|
+
def __repr__(self) -> str:
|
|
112
|
+
...
|
|
113
|
+
def __str__(self) -> str:
|
|
114
|
+
...
|
|
115
|
+
def compute_contribution(self, instant: ostk.physics.time.Instant, x: numpy.ndarray[numpy.float64[m, 1]], frame: ostk.physics.coordinate.Frame) -> numpy.ndarray[numpy.float64[m, 1]]:
|
|
116
|
+
"""
|
|
117
|
+
Compute the contribution of the position derivative to the state vector.
|
|
118
|
+
|
|
119
|
+
Args:
|
|
120
|
+
instant (Instant): The instant of the state vector.
|
|
121
|
+
x (numpy.ndarray): The state vector.
|
|
122
|
+
frame (Frame): The reference frame.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
numpy.ndarray: The contribution of the position derivative to the state vector.
|
|
126
|
+
"""
|
|
127
|
+
def is_defined(self) -> bool:
|
|
128
|
+
"""
|
|
129
|
+
Check if the position derivative is defined.
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
bool: True if the position derivative is defined, False otherwise.
|
|
133
|
+
"""
|
|
134
|
+
class Tabulated(ostk.astrodynamics.Dynamics):
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
The tabulated dynamics.
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
"""
|
|
141
|
+
def __init__(self, instants: list[ostk.physics.time.Instant], contribution_profile: numpy.ndarray[numpy.float64[m, n]], coordinate_subsets: list[ostk.astrodynamics.trajectory.state.CoordinateSubset], frame: ostk.physics.coordinate.Frame, interpolation_type: ostk.mathematics.curve_fitting.Interpolator.Type = ...) -> None:
|
|
142
|
+
"""
|
|
143
|
+
Constructor.
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
instants (list[Instant]): An array of instants.
|
|
147
|
+
contribution_profile (numpy.ndarray): A contribution profile.
|
|
148
|
+
coordinate_subsets (list[CoordinateSubset]): An array of coordinate subsets related to the contribution profile.
|
|
149
|
+
frame (Frame): A frame.
|
|
150
|
+
interpolation_type (Interpolator.Type, optional): The interpolation type. Defaults to Barycentric Rational.
|
|
151
|
+
"""
|
|
152
|
+
def __repr__(self) -> str:
|
|
153
|
+
...
|
|
154
|
+
def __str__(self) -> str:
|
|
155
|
+
...
|
|
156
|
+
def access_contribution_profile(self) -> numpy.ndarray[numpy.float64[m, n]]:
|
|
157
|
+
"""
|
|
158
|
+
Access the contribution profile.
|
|
159
|
+
|
|
160
|
+
Returns:
|
|
161
|
+
np.ndarray: The contribution profile.
|
|
162
|
+
"""
|
|
163
|
+
def access_frame(self) -> ostk.physics.coordinate.Frame:
|
|
164
|
+
"""
|
|
165
|
+
Access the reference frame.
|
|
166
|
+
|
|
167
|
+
Returns:
|
|
168
|
+
Frame: The reference frame.
|
|
169
|
+
"""
|
|
170
|
+
def access_instants(self) -> list[ostk.physics.time.Instant]:
|
|
171
|
+
"""
|
|
172
|
+
Access the contribution instants.
|
|
173
|
+
|
|
174
|
+
Returns:
|
|
175
|
+
list[Instant]: The contribution instants.
|
|
176
|
+
"""
|
|
177
|
+
def compute_contribution(self, instant: ostk.physics.time.Instant, x: numpy.ndarray[numpy.float64[m, 1]], frame: ostk.physics.coordinate.Frame) -> numpy.ndarray[numpy.float64[m, 1]]:
|
|
178
|
+
"""
|
|
179
|
+
Compute the contribution from the contribution profile to the state vector.
|
|
180
|
+
|
|
181
|
+
Args:
|
|
182
|
+
instant (Instant): The instant of the state vector.
|
|
183
|
+
x (numpy.ndarray): The state vector.
|
|
184
|
+
frame (Frame): The reference frame.
|
|
185
|
+
|
|
186
|
+
Returns:
|
|
187
|
+
numpy.ndarray: The contribution from the contribution profile to the state vector.
|
|
188
|
+
"""
|
|
189
|
+
def get_contribution_profile_from_coordinate_subsets(self, coordinate_subsets: list[ostk.astrodynamics.trajectory.state.CoordinateSubset]) -> numpy.ndarray[numpy.float64[m, n]]:
|
|
190
|
+
"""
|
|
191
|
+
Get the contribution profile corresponding to a subset of coordinates.
|
|
192
|
+
|
|
193
|
+
Args:
|
|
194
|
+
coordinate_subsets (list[CoordinateSubset]): The coordinate subsets.
|
|
195
|
+
|
|
196
|
+
Returns:
|
|
197
|
+
numpy.ndarray: The contribution profile.
|
|
198
|
+
"""
|
|
199
|
+
def get_interpolation_type(self) -> ostk.mathematics.curve_fitting.Interpolator.Type:
|
|
200
|
+
"""
|
|
201
|
+
Get the interpolation type used for each row of the contribution profile (they are all the same).
|
|
202
|
+
|
|
203
|
+
Returns:
|
|
204
|
+
Interpolator.Type: The interpolation type.
|
|
205
|
+
"""
|
|
206
|
+
def is_defined(self) -> bool:
|
|
207
|
+
"""
|
|
208
|
+
Check if the tabulated dynamics is defined.
|
|
209
|
+
|
|
210
|
+
Returns:
|
|
211
|
+
bool: True if the tabulated dynamics is defined, False otherwise.
|
|
212
|
+
"""
|
|
213
|
+
class ThirdBodyGravity(ostk.astrodynamics.Dynamics):
|
|
214
|
+
"""
|
|
215
|
+
|
|
216
|
+
The third body gravity model.
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
"""
|
|
220
|
+
def __init__(self, celestial: ostk.physics.environment.object.Celestial) -> None:
|
|
221
|
+
"""
|
|
222
|
+
Constructor.
|
|
223
|
+
|
|
224
|
+
Args:
|
|
225
|
+
celestial (Celestial): The celestial body.
|
|
226
|
+
"""
|
|
227
|
+
def __repr__(self) -> str:
|
|
228
|
+
...
|
|
229
|
+
def __str__(self) -> str:
|
|
230
|
+
...
|
|
231
|
+
def compute_contribution(self, instant: ostk.physics.time.Instant, x: numpy.ndarray[numpy.float64[m, 1]], frame: ostk.physics.coordinate.Frame) -> numpy.ndarray[numpy.float64[m, 1]]:
|
|
232
|
+
"""
|
|
233
|
+
Compute the contribution of the third-body gravity to the state vector.
|
|
234
|
+
|
|
235
|
+
Args:
|
|
236
|
+
instant (Instant): The instant of the state vector.
|
|
237
|
+
x (numpy.ndarray): The state vector.
|
|
238
|
+
frame (Frame): The reference frame.
|
|
239
|
+
|
|
240
|
+
Returns:
|
|
241
|
+
numpy.ndarray: The contribution of the third-body gravity to the state vector.
|
|
242
|
+
"""
|
|
243
|
+
def get_celestial(self) -> ostk.physics.environment.object.Celestial:
|
|
244
|
+
"""
|
|
245
|
+
Get the celestial body.
|
|
246
|
+
|
|
247
|
+
Returns:
|
|
248
|
+
Celestial: The celestial body.
|
|
249
|
+
"""
|
|
250
|
+
def is_defined(self) -> bool:
|
|
251
|
+
"""
|
|
252
|
+
Check if the third-body gravity is defined.
|
|
253
|
+
|
|
254
|
+
Returns:
|
|
255
|
+
bool: True if the third-body gravity is defined, False otherwise.
|
|
256
|
+
"""
|
|
257
|
+
class Thruster(ostk.astrodynamics.Dynamics):
|
|
258
|
+
"""
|
|
259
|
+
|
|
260
|
+
Abstract Thruster Class.
|
|
261
|
+
|
|
262
|
+
Base class to derive other thruster classes from. Cannot be instantiated.
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
"""
|
|
266
|
+
def __init__(self, satellite_system: ostk.astrodynamics.flight.system.SatelliteSystem, guidance_law: typing.Any, name: ostk.core.type.String = ...) -> None:
|
|
267
|
+
"""
|
|
268
|
+
Constructor.
|
|
269
|
+
|
|
270
|
+
Args:
|
|
271
|
+
satellite_system (SatelliteSystem): The satellite system.
|
|
272
|
+
guidance_law (GuidanceLaw): The guidance law used to compute the acceleration vector.
|
|
273
|
+
name (str, optional): The name of the thruster. Defaults to String.empty().
|
|
274
|
+
"""
|
|
275
|
+
def __repr__(self) -> str:
|
|
276
|
+
...
|
|
277
|
+
def __str__(self) -> str:
|
|
278
|
+
...
|
|
279
|
+
def compute_contribution(self, instant: ostk.physics.time.Instant, state_vector: numpy.ndarray[numpy.float64[m, 1]], frame: ostk.physics.coordinate.Frame) -> numpy.ndarray[numpy.float64[m, 1]]:
|
|
280
|
+
"""
|
|
281
|
+
Compute the contribution of the thruster to the state vector.
|
|
282
|
+
|
|
283
|
+
Args:
|
|
284
|
+
instant (Instant): The instant of the state vector.
|
|
285
|
+
state_vector (numpy.ndarray): The state vector.
|
|
286
|
+
frame (Frame): The reference frame.
|
|
287
|
+
|
|
288
|
+
Returns:
|
|
289
|
+
numpy.ndarray: The contribution of the thruster to the state vector.
|
|
290
|
+
"""
|
|
291
|
+
def get_guidance_law(self) -> ...:
|
|
292
|
+
"""
|
|
293
|
+
Get the guidance law of the thruster.
|
|
294
|
+
|
|
295
|
+
Returns:
|
|
296
|
+
GuidanceLaw: The guidance law.
|
|
297
|
+
"""
|
|
298
|
+
def get_satellite_system(self) -> ostk.astrodynamics.flight.system.SatelliteSystem:
|
|
299
|
+
"""
|
|
300
|
+
Get the satellite system of the thruster.
|
|
301
|
+
|
|
302
|
+
Returns:
|
|
303
|
+
SatelliteSystem: The satellite system.
|
|
304
|
+
"""
|
|
305
|
+
def is_defined(self) -> bool:
|
|
306
|
+
"""
|
|
307
|
+
Check if the thruster is defined.
|
|
308
|
+
|
|
309
|
+
Returns:
|
|
310
|
+
bool: True if the thruster is defined, False otherwise.
|
|
311
|
+
"""
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import ostk.astrodynamics
|
|
3
|
+
import ostk.core.type
|
|
4
|
+
import ostk.physics
|
|
5
|
+
import ostk.physics.environment.utility
|
|
6
|
+
import ostk.physics.time
|
|
7
|
+
import typing
|
|
8
|
+
__all__ = ['Generator']
|
|
9
|
+
class Generator:
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
An eclipse generator.
|
|
13
|
+
|
|
14
|
+
"""
|
|
15
|
+
@typing.overload
|
|
16
|
+
def __init__(self, environment: ostk.physics.Environment = ..., search_step_size: ostk.physics.time.Duration = ..., search_tolerance: ostk.physics.time.Duration = ...) -> None:
|
|
17
|
+
"""
|
|
18
|
+
Constructor.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
environment (Environment): The Environment to use during the search. Defaults to the Environment.default().
|
|
22
|
+
search_step_size (Duration): The step size to use during the search. Defaults to Duration.seconds(60.0).
|
|
23
|
+
search_tolerance (Duration): The tolerance to use during the search. Defaults to Duration.milliseconds(1.0).
|
|
24
|
+
"""
|
|
25
|
+
@typing.overload
|
|
26
|
+
def __init__(self) -> None:
|
|
27
|
+
"""
|
|
28
|
+
Default constructor with default parameters.
|
|
29
|
+
"""
|
|
30
|
+
def generate(self, trajectory: ostk.astrodynamics.Trajectory, analysis_interval: ostk.physics.time.Interval, occulted_celestial_object_name: ostk.core.type.String = 'Sun', occulting_celestial_object_name: ostk.core.type.String = 'Earth') -> list[ostk.physics.environment.utility.Eclipse]:
|
|
31
|
+
"""
|
|
32
|
+
Generate eclipses for a given trajectory over the provided analysis interval.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
trajectory (Trajectory): The trajectory to search for eclipses.
|
|
36
|
+
analysis_interval (Interval): The analysis interval.
|
|
37
|
+
occulted_celestial_object_name (str): The name of the occulted celestial object. Defaults to "Sun".
|
|
38
|
+
occulting_celestial_object_name (str): The name of the occulting celestial object. Defaults to "Earth".
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
Array[Eclipse]: Array of eclipses found within the analysis interval.
|
|
42
|
+
"""
|
|
43
|
+
def get_environment(self) -> ostk.physics.Environment:
|
|
44
|
+
"""
|
|
45
|
+
Get the environment.
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
Environment: The environment used during the search.
|
|
49
|
+
"""
|
|
50
|
+
def get_search_step_size(self) -> ostk.physics.time.Duration:
|
|
51
|
+
"""
|
|
52
|
+
Get the search step size.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
Duration: The step size used during the search.
|
|
56
|
+
"""
|
|
57
|
+
def get_search_tolerance(self) -> ostk.physics.time.Duration:
|
|
58
|
+
"""
|
|
59
|
+
Get the search tolerance.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
Duration: The tolerance used during the search.
|
|
63
|
+
"""
|
|
64
|
+
def is_defined(self) -> bool:
|
|
65
|
+
"""
|
|
66
|
+
Check if eclipse generator is defined.
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
bool: True if eclipse generator is defined, False otherwise.
|
|
70
|
+
"""
|