open-space-toolkit-astrodynamics 12.2.1__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-12.2.1.dist-info/METADATA +30 -0
- open_space_toolkit_astrodynamics-12.2.1.dist-info/RECORD +100 -0
- open_space_toolkit_astrodynamics-12.2.1.dist-info/WHEEL +5 -0
- open_space_toolkit_astrodynamics-12.2.1.dist-info/top_level.txt +1 -0
- open_space_toolkit_astrodynamics-12.2.1.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/converters.py +128 -0
- ostk/astrodynamics/dataframe.py +477 -0
- ostk/astrodynamics/display.py +220 -0
- ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.12 +0 -0
- ostk/astrodynamics/pytrajectory/__init__.py +1 -0
- ostk/astrodynamics/pytrajectory/pystate.py +220 -0
- ostk/astrodynamics/test/__init__.py +1 -0
- ostk/astrodynamics/test/access/__init__.py +1 -0
- ostk/astrodynamics/test/access/test_generator.py +248 -0
- ostk/astrodynamics/test/conftest.py +119 -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/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 +142 -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_coe_condition.py +87 -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/system/__init__.py +1 -0
- ostk/astrodynamics/test/flight/system/test_propulsion_system.py +73 -0
- ostk/astrodynamics/test/flight/system/test_satellite_system.py +91 -0
- ostk/astrodynamics/test/flight/system/test_satellite_system_builder.py +71 -0
- ostk/astrodynamics/test/flight/test_maneuver.py +212 -0
- ostk/astrodynamics/test/flight/test_profile.py +242 -0
- ostk/astrodynamics/test/flight/test_system.py +55 -0
- ostk/astrodynamics/test/guidance_law/test_constant_thrust.py +91 -0
- ostk/astrodynamics/test/guidance_law/test_qlaw.py +138 -0
- ostk/astrodynamics/test/solvers/__init__.py +1 -0
- ostk/astrodynamics/test/solvers/test_finite_difference_solver.py +181 -0
- ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +153 -0
- ostk/astrodynamics/test/test_access.py +128 -0
- ostk/astrodynamics/test/test_converters.py +290 -0
- ostk/astrodynamics/test/test_dataframe.py +875 -0
- ostk/astrodynamics/test/test_display.py +114 -0
- ostk/astrodynamics/test/test_event_condition.py +58 -0
- ostk/astrodynamics/test/test_import.py +26 -0
- ostk/astrodynamics/test/test_root_solver.py +70 -0
- ostk/astrodynamics/test/test_trajectory.py +118 -0
- ostk/astrodynamics/test/test_utilities.py +106 -0
- ostk/astrodynamics/test/test_viewer.py +129 -0
- ostk/astrodynamics/test/trajectory/__init__.py +1 -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 +180 -0
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +331 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +130 -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_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 +46 -0
- ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +314 -0
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_direction.py +81 -0
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_factory.py +108 -0
- ostk/astrodynamics/test/trajectory/test_model.py +1 -0
- ostk/astrodynamics/test/trajectory/test_orbit.py +196 -0
- ostk/astrodynamics/test/trajectory/test_propagator.py +458 -0
- ostk/astrodynamics/test/trajectory/test_segment.py +305 -0
- ostk/astrodynamics/test/trajectory/test_sequence.py +477 -0
- ostk/astrodynamics/test/trajectory/test_state.py +467 -0
- ostk/astrodynamics/test/trajectory/test_state_builder.py +171 -0
- ostk/astrodynamics/utilities.py +245 -0
- ostk/astrodynamics/viewer.py +392 -0
@@ -0,0 +1,108 @@
|
|
1
|
+
# Apache License 2.0
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
from ostk.physics.time import Instant
|
6
|
+
from ostk.physics.time import DateTime
|
7
|
+
from ostk.physics.time import Scale
|
8
|
+
from ostk.physics.coordinate import Frame
|
9
|
+
from ostk.physics.coordinate import Transform
|
10
|
+
|
11
|
+
from ostk.astrodynamics.trajectory import LocalOrbitalFrameFactory
|
12
|
+
from ostk.astrodynamics.trajectory import LocalOrbitalFrameTransformProvider
|
13
|
+
|
14
|
+
|
15
|
+
@pytest.fixture
|
16
|
+
def parent_frame() -> Frame:
|
17
|
+
return Frame.GCRF()
|
18
|
+
|
19
|
+
|
20
|
+
@pytest.fixture
|
21
|
+
def local_orbital_transform_provider_type() -> LocalOrbitalFrameTransformProvider.Type:
|
22
|
+
return LocalOrbitalFrameTransformProvider.Type.VNC
|
23
|
+
|
24
|
+
|
25
|
+
@pytest.fixture
|
26
|
+
def transform_generator() -> callable:
|
27
|
+
return lambda instant, position, velocity: Transform.identity(Transform.Type.passive)
|
28
|
+
|
29
|
+
|
30
|
+
@pytest.fixture
|
31
|
+
def local_orbital_frame_factory(parent_frame: Frame) -> LocalOrbitalFrameFactory:
|
32
|
+
return LocalOrbitalFrameFactory.VNC(parent_frame)
|
33
|
+
|
34
|
+
|
35
|
+
@pytest.fixture
|
36
|
+
def instant() -> Instant:
|
37
|
+
return Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
38
|
+
|
39
|
+
|
40
|
+
@pytest.fixture
|
41
|
+
def position_vector() -> list:
|
42
|
+
return [7500000.0, 0.0, 0.0]
|
43
|
+
|
44
|
+
|
45
|
+
@pytest.fixture
|
46
|
+
def velocity_vector() -> list:
|
47
|
+
return [0.0, 5335.865450622126, 5335.865450622126]
|
48
|
+
|
49
|
+
|
50
|
+
class TestLocalOrbitalFrameFactory:
|
51
|
+
def test_constructors(self):
|
52
|
+
assert LocalOrbitalFrameFactory.VNC(Frame.GCRF()) is not None
|
53
|
+
assert LocalOrbitalFrameFactory.NED(Frame.GCRF()) is not None
|
54
|
+
assert LocalOrbitalFrameFactory.LVLH(Frame.GCRF()) is not None
|
55
|
+
assert LocalOrbitalFrameFactory.QSW(Frame.GCRF()) is not None
|
56
|
+
assert LocalOrbitalFrameFactory.TNW(Frame.GCRF()) is not None
|
57
|
+
assert LocalOrbitalFrameFactory.VVLH(Frame.GCRF()) is not None
|
58
|
+
|
59
|
+
def test_accessors(
|
60
|
+
self,
|
61
|
+
parent_frame: Frame,
|
62
|
+
local_orbital_frame_factory: LocalOrbitalFrameFactory,
|
63
|
+
):
|
64
|
+
assert parent_frame == local_orbital_frame_factory.access_parent_frame()
|
65
|
+
|
66
|
+
def test_generate_frame(
|
67
|
+
self,
|
68
|
+
local_orbital_frame_factory: LocalOrbitalFrameFactory,
|
69
|
+
instant: Instant,
|
70
|
+
position_vector: list,
|
71
|
+
velocity_vector: list,
|
72
|
+
):
|
73
|
+
frame = local_orbital_frame_factory.generate_frame(
|
74
|
+
instant,
|
75
|
+
position_vector,
|
76
|
+
velocity_vector,
|
77
|
+
)
|
78
|
+
|
79
|
+
assert frame is not None
|
80
|
+
assert frame.is_defined()
|
81
|
+
|
82
|
+
def test_is_defined(
|
83
|
+
self,
|
84
|
+
local_orbital_frame_factory: LocalOrbitalFrameFactory,
|
85
|
+
):
|
86
|
+
assert local_orbital_frame_factory.is_defined()
|
87
|
+
|
88
|
+
def test_constructor(
|
89
|
+
self,
|
90
|
+
local_orbital_transform_provider_type: LocalOrbitalFrameTransformProvider.Type,
|
91
|
+
parent_frame: Frame,
|
92
|
+
):
|
93
|
+
assert (
|
94
|
+
LocalOrbitalFrameFactory.construct(
|
95
|
+
local_orbital_transform_provider_type, parent_frame
|
96
|
+
)
|
97
|
+
is not None
|
98
|
+
)
|
99
|
+
|
100
|
+
def test_custom_constructor(
|
101
|
+
self,
|
102
|
+
transform_generator: callable,
|
103
|
+
parent_frame: Frame,
|
104
|
+
):
|
105
|
+
assert (
|
106
|
+
LocalOrbitalFrameFactory.construct(transform_generator, parent_frame)
|
107
|
+
is not None
|
108
|
+
)
|
@@ -0,0 +1 @@
|
|
1
|
+
# Apache License 2.0
|
@@ -0,0 +1,196 @@
|
|
1
|
+
# Apache License 2.0
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
from ostk.physics.environment.object.celestial import Earth
|
6
|
+
from ostk.physics.unit import Length, Angle
|
7
|
+
from ostk.physics.time import Scale, Instant, DateTime, Time, Duration, Interval
|
8
|
+
|
9
|
+
from ostk.astrodynamics.trajectory import Orbit, State
|
10
|
+
from ostk.astrodynamics.trajectory.orbit import Pass
|
11
|
+
from ostk.astrodynamics.trajectory.orbit import Pass
|
12
|
+
from ostk.astrodynamics.trajectory.orbit.model import SGP4
|
13
|
+
from ostk.astrodynamics.trajectory.orbit.model.sgp4 import TLE
|
14
|
+
|
15
|
+
|
16
|
+
@pytest.fixture
|
17
|
+
def earth() -> Earth:
|
18
|
+
return Earth.default()
|
19
|
+
|
20
|
+
|
21
|
+
@pytest.fixture
|
22
|
+
def epoch() -> Instant:
|
23
|
+
return Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
24
|
+
|
25
|
+
|
26
|
+
@pytest.fixture
|
27
|
+
def orbit(earth: Earth, epoch: Instant):
|
28
|
+
return Orbit.sun_synchronous(epoch, Length.kilometers(500.0), Time.midnight(), earth)
|
29
|
+
|
30
|
+
|
31
|
+
@pytest.fixture
|
32
|
+
def states(orbit: Orbit, epoch: Instant) -> list[State]:
|
33
|
+
instants: list[Instant] = Interval.closed(
|
34
|
+
epoch, epoch + Duration.days(1.0)
|
35
|
+
).generate_grid(Duration.seconds(20.0))
|
36
|
+
|
37
|
+
return orbit.get_states_at(instants)
|
38
|
+
|
39
|
+
|
40
|
+
class TestOrbit:
|
41
|
+
def test_constructors(self, earth):
|
42
|
+
# Construct Two-Line Element set
|
43
|
+
tle = TLE(
|
44
|
+
"1 25544U 98067A 18231.17878740 .00000187 00000-0 10196-4 0 9994",
|
45
|
+
"2 25544 51.6447 64.7824 0005971 73.1467 36.4366 15.53848234128316",
|
46
|
+
)
|
47
|
+
|
48
|
+
# Construct orbit using SGP4 model
|
49
|
+
orbit = Orbit(SGP4(tle), earth)
|
50
|
+
|
51
|
+
assert orbit is not None
|
52
|
+
assert isinstance(orbit, Orbit)
|
53
|
+
assert orbit.is_defined()
|
54
|
+
|
55
|
+
# Construct get state at current epoch
|
56
|
+
state: State = orbit.get_state_at(Instant.now())
|
57
|
+
|
58
|
+
assert state is not None
|
59
|
+
assert isinstance(state, State)
|
60
|
+
|
61
|
+
@pytest.mark.parametrize(
|
62
|
+
"frame_type",
|
63
|
+
[
|
64
|
+
(Orbit.FrameType.NED),
|
65
|
+
(Orbit.FrameType.LVLH),
|
66
|
+
(Orbit.FrameType.VVLH),
|
67
|
+
(Orbit.FrameType.LVLHGD),
|
68
|
+
(Orbit.FrameType.LVLHGDGT),
|
69
|
+
(Orbit.FrameType.QSW),
|
70
|
+
(Orbit.FrameType.TNW),
|
71
|
+
(Orbit.FrameType.VNC),
|
72
|
+
],
|
73
|
+
)
|
74
|
+
def test_get_orbital_frame(self, orbit: Orbit, frame_type: Orbit.FrameType):
|
75
|
+
assert orbit.get_orbital_frame(frame_type) is not None
|
76
|
+
|
77
|
+
def test_get_revolution_number_at(self, orbit: Orbit):
|
78
|
+
assert (
|
79
|
+
orbit.get_revolution_number_at(
|
80
|
+
Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
81
|
+
)
|
82
|
+
== 1
|
83
|
+
)
|
84
|
+
|
85
|
+
def test_get_pass_at(self, orbit: Orbit):
|
86
|
+
pass_ = orbit.get_pass_at(
|
87
|
+
Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
88
|
+
)
|
89
|
+
|
90
|
+
assert pass_ is not None
|
91
|
+
assert isinstance(pass_, Pass)
|
92
|
+
assert pass_.is_defined()
|
93
|
+
|
94
|
+
def test_get_pass_with_revolution_number(self, orbit: Orbit):
|
95
|
+
pass_ = orbit.get_pass_with_revolution_number(1)
|
96
|
+
|
97
|
+
assert pass_ is not None
|
98
|
+
assert isinstance(pass_, Pass)
|
99
|
+
assert pass_.is_defined()
|
100
|
+
|
101
|
+
assert (
|
102
|
+
orbit.get_pass_with_revolution_number(2, Duration.minutes(10.0)) is not None
|
103
|
+
)
|
104
|
+
|
105
|
+
def test_get_passes_within_interval(self, orbit: Orbit):
|
106
|
+
passes: list[Pass] = orbit.get_passes_within_interval(
|
107
|
+
Interval.closed(
|
108
|
+
Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC),
|
109
|
+
Instant.date_time(DateTime(2018, 1, 1, 0, 10, 0), Scale.UTC),
|
110
|
+
)
|
111
|
+
)
|
112
|
+
|
113
|
+
assert len(passes) > 0
|
114
|
+
|
115
|
+
def test_undefined(self):
|
116
|
+
assert Orbit.undefined().is_defined() is False
|
117
|
+
|
118
|
+
def test_circular(self, earth):
|
119
|
+
epoch = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
120
|
+
altitude = Length.kilometers(500.0)
|
121
|
+
inclination = Angle.degrees(45.0)
|
122
|
+
|
123
|
+
orbit: Orbit = Orbit.circular(epoch, altitude, inclination, earth)
|
124
|
+
|
125
|
+
assert orbit is not None
|
126
|
+
assert isinstance(orbit, Orbit)
|
127
|
+
assert orbit.is_defined()
|
128
|
+
|
129
|
+
def test_equatorial(self, earth):
|
130
|
+
epoch = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
131
|
+
apoapsis_altitude = Length.kilometers(500.1)
|
132
|
+
periapsis_altitude = Length.kilometers(499.9)
|
133
|
+
|
134
|
+
orbit: Orbit = Orbit.equatorial(
|
135
|
+
epoch, apoapsis_altitude, periapsis_altitude, earth
|
136
|
+
)
|
137
|
+
|
138
|
+
assert orbit is not None
|
139
|
+
assert isinstance(orbit, Orbit)
|
140
|
+
assert orbit.is_defined()
|
141
|
+
|
142
|
+
def test_circular_equatorial(self, earth):
|
143
|
+
epoch = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
144
|
+
altitude = Length.kilometers(500.0)
|
145
|
+
|
146
|
+
orbit: Orbit = Orbit.circular_equatorial(epoch, altitude, earth)
|
147
|
+
|
148
|
+
assert orbit is not None
|
149
|
+
assert isinstance(orbit, Orbit)
|
150
|
+
assert orbit.is_defined()
|
151
|
+
|
152
|
+
def test_geo_synchronous(self, earth):
|
153
|
+
epoch = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
154
|
+
inclination = Angle.degrees(45.0)
|
155
|
+
longitude = Angle.degrees(45.0)
|
156
|
+
|
157
|
+
orbit: Orbit = Orbit.geo_synchronous(epoch, inclination, longitude, earth)
|
158
|
+
|
159
|
+
assert orbit is not None
|
160
|
+
assert isinstance(orbit, Orbit)
|
161
|
+
assert orbit.is_defined()
|
162
|
+
|
163
|
+
def test_sun_synchronous(self, earth):
|
164
|
+
epoch = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
165
|
+
altitude = Length.kilometers(500.0)
|
166
|
+
local_time_at_descending_node = Time.midnight()
|
167
|
+
|
168
|
+
orbit: Orbit = Orbit.sun_synchronous(
|
169
|
+
epoch, altitude, local_time_at_descending_node, earth
|
170
|
+
)
|
171
|
+
|
172
|
+
assert orbit is not None
|
173
|
+
assert isinstance(orbit, Orbit)
|
174
|
+
assert orbit.is_defined()
|
175
|
+
|
176
|
+
assert Orbit.sun_synchronous(
|
177
|
+
epoch=epoch,
|
178
|
+
altitude=altitude,
|
179
|
+
local_time_at_descending_node=local_time_at_descending_node,
|
180
|
+
celestial_object=earth,
|
181
|
+
argument_of_latitude=Angle.degrees(50.0),
|
182
|
+
).is_defined()
|
183
|
+
|
184
|
+
def test_compute_passes(self, states: list[State]):
|
185
|
+
passes: list[tuple[int, Pass]] = Orbit.compute_passes(states, 1)
|
186
|
+
assert passes is not None
|
187
|
+
|
188
|
+
def test_compute_passes_with_model(self, orbit: Orbit):
|
189
|
+
passes: list[tuple[int, Pass]] = Orbit.compute_passes_with_model(
|
190
|
+
model=orbit.access_kepler_model(),
|
191
|
+
start_instant=Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC),
|
192
|
+
end_instant=Instant.date_time(DateTime(2018, 1, 1, 0, 10, 0), Scale.UTC),
|
193
|
+
initial_revolution_number=1,
|
194
|
+
)
|
195
|
+
|
196
|
+
assert len(passes) > 0
|