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
@@ -192,11 +192,13 @@ class TestProfile:
|
|
192
192
|
assert isinstance(profile, Profile)
|
193
193
|
assert profile.is_defined()
|
194
194
|
|
195
|
-
def
|
195
|
+
def test_local_orbital_frame_pointing(
|
196
196
|
self,
|
197
197
|
orbit: Orbit,
|
198
198
|
):
|
199
|
-
profile: Profile = Profile.
|
199
|
+
profile: Profile = Profile.local_orbital_frame_pointing(
|
200
|
+
orbit, Orbit.FrameType.VVLH
|
201
|
+
)
|
200
202
|
|
201
203
|
assert profile is not None
|
202
204
|
assert isinstance(profile, Profile)
|
@@ -84,11 +84,11 @@ def generate_states_coordinates() -> callable:
|
|
84
84
|
x: float = x0 * math.cos(omega * t) + v0 / omega * math.sin(omega * t)
|
85
85
|
v: float = -x0 * omega * math.sin(omega * t) + v0 * math.cos(omega * t)
|
86
86
|
|
87
|
-
coordinates: list[float] = [x, v]
|
87
|
+
coordinates: list[float] = np.array([x, v])
|
88
88
|
|
89
89
|
states_coordinates.append(coordinates)
|
90
90
|
|
91
|
-
return np.array(states_coordinates)
|
91
|
+
return np.array(states_coordinates).transpose()
|
92
92
|
|
93
93
|
return state_fn
|
94
94
|
|
@@ -126,37 +126,37 @@ class TestFiniteDifferenceSolver:
|
|
126
126
|
== "Forward"
|
127
127
|
)
|
128
128
|
|
129
|
-
def
|
129
|
+
def test_compute_state_transition_matrix_array(
|
130
130
|
self,
|
131
131
|
finite_difference_solver: FiniteDifferenceSolver,
|
132
132
|
state: State,
|
133
133
|
instants: list[Instant],
|
134
134
|
generate_states_coordinates: callable,
|
135
135
|
):
|
136
|
-
|
136
|
+
stms: list[np.ndarray] = finite_difference_solver.compute_state_transition_matrix(
|
137
137
|
state=state,
|
138
138
|
instants=instants,
|
139
139
|
generate_states_coordinates=generate_states_coordinates,
|
140
|
-
coordinates_dimension=2,
|
141
140
|
)
|
142
|
-
|
143
|
-
assert
|
144
|
-
|
141
|
+
|
142
|
+
assert len(stms) == len(instants)
|
143
|
+
|
144
|
+
assert stms[0].shape == (
|
145
|
+
len(state.get_coordinates()),
|
145
146
|
len(state.get_coordinates()),
|
146
147
|
)
|
147
148
|
|
148
|
-
def
|
149
|
+
def test_compute_state_transition_matrix_single(
|
149
150
|
self,
|
150
151
|
finite_difference_solver: FiniteDifferenceSolver,
|
151
152
|
state: State,
|
152
153
|
generate_state_coordinates: callable,
|
153
154
|
instant: Instant,
|
154
155
|
):
|
155
|
-
stm = finite_difference_solver.
|
156
|
+
stm: np.ndarray = finite_difference_solver.compute_state_transition_matrix(
|
156
157
|
state=state,
|
157
158
|
instant=instant,
|
158
159
|
generate_state_coordinates=generate_state_coordinates,
|
159
|
-
coordinates_dimension=2,
|
160
160
|
)
|
161
161
|
assert isinstance(stm, np.ndarray)
|
162
162
|
assert stm.shape == (
|
@@ -177,5 +177,18 @@ class TestFiniteDifferenceSolver:
|
|
177
177
|
assert isinstance(gradient, np.ndarray)
|
178
178
|
assert all(gradient - np.array([0.0, -1.0]) < 1e-6)
|
179
179
|
|
180
|
+
def test_compute_jacobian(
|
181
|
+
self,
|
182
|
+
finite_difference_solver: FiniteDifferenceSolver,
|
183
|
+
state: State,
|
184
|
+
generate_state_coordinates: callable,
|
185
|
+
):
|
186
|
+
gradient = finite_difference_solver.compute_jacobian(
|
187
|
+
state=state,
|
188
|
+
generate_state_coordinates=generate_state_coordinates,
|
189
|
+
)
|
190
|
+
assert isinstance(gradient, np.ndarray)
|
191
|
+
assert np.all(gradient - np.array([[0.0, 1.0], [-1.0, 0.0]]) < 1e-6)
|
192
|
+
|
180
193
|
def test_default(self):
|
181
194
|
assert isinstance(FiniteDifferenceSolver.default(), FiniteDifferenceSolver)
|
@@ -16,6 +16,8 @@ from ostk.astrodynamics.trajectory.orbit.model import Kepler
|
|
16
16
|
from ostk.astrodynamics.trajectory.orbit.model.kepler import COE
|
17
17
|
from ostk.astrodynamics.access import Generator
|
18
18
|
from ostk.astrodynamics.solver import TemporalConditionSolver
|
19
|
+
from ostk.astrodynamics.access import AccessTarget
|
20
|
+
from ostk.astrodynamics.access import VisibilityCriterion
|
19
21
|
|
20
22
|
|
21
23
|
@pytest.fixture
|
@@ -141,9 +143,15 @@ class TestTemporalConditionSolver:
|
|
141
143
|
celestial_object=earth,
|
142
144
|
)
|
143
145
|
|
146
|
+
visibility_criterion: VisibilityCriterion = (
|
147
|
+
VisibilityCriterion.from_line_of_sight(environment)
|
148
|
+
)
|
149
|
+
|
150
|
+
access_target = AccessTarget.from_trajectory(visibility_criterion, trajectory)
|
151
|
+
|
144
152
|
solution: list[Interval] = temporal_condition_solver.solve(
|
145
153
|
condition=generator.get_condition_function(
|
146
|
-
|
154
|
+
access_target=access_target,
|
147
155
|
to_trajectory=trajectory,
|
148
156
|
),
|
149
157
|
interval=interval,
|
@@ -15,12 +15,13 @@ from ostk.physics.time import Scale
|
|
15
15
|
from ostk.physics.unit import Length
|
16
16
|
from ostk.physics.unit import Angle
|
17
17
|
|
18
|
-
from ostk.astrodynamics import Trajectory
|
19
18
|
from ostk.astrodynamics import display
|
20
19
|
from ostk.astrodynamics.access import Generator as AccessGenerator
|
21
20
|
from ostk.astrodynamics.trajectory import Orbit
|
22
21
|
from ostk.astrodynamics.trajectory.orbit.model import SGP4
|
23
22
|
from ostk.astrodynamics.trajectory.orbit.model.sgp4 import TLE
|
23
|
+
from ostk.astrodynamics.access import AccessTarget
|
24
|
+
from ostk.astrodynamics.access import VisibilityCriterion
|
24
25
|
|
25
26
|
|
26
27
|
class TestDisplay:
|
@@ -29,7 +30,7 @@ class TestDisplay:
|
|
29
30
|
DateTime(2023, 1, 3, 0, 0, 0),
|
30
31
|
Scale.UTC,
|
31
32
|
)
|
32
|
-
duration: Duration = Duration.hours(
|
33
|
+
duration: Duration = Duration.hours(1.0)
|
33
34
|
step: Duration = Duration.seconds(10.0)
|
34
35
|
tolerance: Duration = Duration.seconds(1.0)
|
35
36
|
|
@@ -52,7 +53,12 @@ class TestDisplay:
|
|
52
53
|
environment: Environment = Environment.default()
|
53
54
|
earth: Celestial = environment.access_celestial_object_with_name("Earth")
|
54
55
|
|
55
|
-
|
56
|
+
visibility_criterion: VisibilityCriterion = (
|
57
|
+
VisibilityCriterion.from_line_of_sight(environment)
|
58
|
+
)
|
59
|
+
|
60
|
+
access_target: AccessTarget = AccessTarget.from_position(
|
61
|
+
visibility_criterion,
|
56
62
|
Position.meters(
|
57
63
|
ground_station_lla.to_cartesian(
|
58
64
|
earth.get_equatorial_radius(),
|
@@ -76,7 +82,7 @@ class TestDisplay:
|
|
76
82
|
|
77
83
|
accesses_1 = generator.compute_accesses(
|
78
84
|
interval=search_interval,
|
79
|
-
|
85
|
+
access_target=access_target,
|
80
86
|
to_trajectory=orbit_1,
|
81
87
|
)
|
82
88
|
|
@@ -84,7 +90,7 @@ class TestDisplay:
|
|
84
90
|
|
85
91
|
accesses_2 = generator.compute_accesses(
|
86
92
|
interval=search_interval,
|
87
|
-
|
93
|
+
access_target=access_target,
|
88
94
|
to_trajectory=orbit_2,
|
89
95
|
)
|
90
96
|
|
@@ -38,7 +38,7 @@ def orbit(environment: Environment) -> Orbit:
|
|
38
38
|
|
39
39
|
@pytest.fixture
|
40
40
|
def profile(orbit: Orbit) -> Profile:
|
41
|
-
return Profile.
|
41
|
+
return Profile.local_orbital_frame_pointing(
|
42
42
|
orbit=orbit,
|
43
43
|
orbital_frame_type=Orbit.FrameType.VVLH,
|
44
44
|
)
|
@@ -127,3 +127,72 @@ class TestViewer:
|
|
127
127
|
in rendered_html
|
128
128
|
)
|
129
129
|
assert rendered_html.endswith("</script>")
|
130
|
+
|
131
|
+
def test_add_target_with_label_success(
|
132
|
+
self,
|
133
|
+
viewer: Viewer,
|
134
|
+
):
|
135
|
+
viewer.add_target(
|
136
|
+
position=Position.meters([1.0, 2.0, 3.0], Frame.ITRF()),
|
137
|
+
size=123,
|
138
|
+
color="red",
|
139
|
+
label="TEST",
|
140
|
+
)
|
141
|
+
|
142
|
+
rendered_html: str = viewer.render()
|
143
|
+
|
144
|
+
assert rendered_html.startswith('<meta charset="utf-8">')
|
145
|
+
assert "var widget = new Cesium.Viewer" in rendered_html
|
146
|
+
assert (
|
147
|
+
"widget.entities.add({position: Cesium.Cartesian3.fromDegrees(63.43494882292201, 18.22447811510915, -6376045.535225509), point: {pixelSize: 123.0, color: Cesium.Color.RED}});"
|
148
|
+
in rendered_html
|
149
|
+
)
|
150
|
+
assert (
|
151
|
+
'widget.entities.add({position: Cesium.Cartesian3.fromDegrees(63.43494882292201, 18.22447811510915, -6376045.535225509), label: {text: "TEST", fillColor: Cesium.Color.RED, scale: 123.0}});'
|
152
|
+
in rendered_html
|
153
|
+
)
|
154
|
+
assert rendered_html.endswith("</script>")
|
155
|
+
|
156
|
+
def test_add_line_success(
|
157
|
+
self,
|
158
|
+
viewer: Viewer,
|
159
|
+
):
|
160
|
+
viewer.add_line(
|
161
|
+
positions=[
|
162
|
+
Position.meters([1.0, 2.0, 3.0], Frame.ITRF()),
|
163
|
+
Position.meters([4.0, 5.0, 6.0], Frame.ITRF()),
|
164
|
+
],
|
165
|
+
size=10.0,
|
166
|
+
color="red",
|
167
|
+
)
|
168
|
+
|
169
|
+
rendered_html: str = viewer.render()
|
170
|
+
|
171
|
+
assert rendered_html.startswith('<meta charset="utf-8">')
|
172
|
+
assert "var widget = new Cesium.Viewer" in rendered_html
|
173
|
+
assert (
|
174
|
+
"widget.entities.add({polyline: {positions: Cesium.Cartesian3.fromDegreesArrayHeights([63.43494882292201, 18.22447811510915, 10.0, 51.34019174590991, 10.165199393640696, 10.0]), width: 10.0, material: Cesium.Color.RED}});"
|
175
|
+
in rendered_html
|
176
|
+
)
|
177
|
+
assert rendered_html.endswith("</script>")
|
178
|
+
|
179
|
+
def test_add_label_success(
|
180
|
+
self,
|
181
|
+
viewer: Viewer,
|
182
|
+
):
|
183
|
+
viewer.add_label(
|
184
|
+
position=Position.meters([6671000.0, 0.0, 0.0], Frame.ITRF()),
|
185
|
+
text="Hello, World!",
|
186
|
+
size=1.0,
|
187
|
+
color="red",
|
188
|
+
)
|
189
|
+
|
190
|
+
rendered_html: str = viewer.render()
|
191
|
+
|
192
|
+
assert rendered_html.startswith('<meta charset="utf-8">')
|
193
|
+
assert "var widget = new Cesium.Viewer" in rendered_html
|
194
|
+
assert (
|
195
|
+
'widget.entities.add({position: Cesium.Cartesian3.fromDegrees(0.0, 0.0, 292863.0000000001), label: {text: "Hello, World!", fillColor: Cesium.Color.RED, scale: 1.0}});'
|
196
|
+
in rendered_html
|
197
|
+
)
|
198
|
+
assert rendered_html.endswith("</script>")
|
@@ -0,0 +1,136 @@
|
|
1
|
+
# Apache License 2.0
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
from ostk.physics.time import Instant
|
6
|
+
from ostk.physics.coordinate import Frame
|
7
|
+
|
8
|
+
from ostk.astrodynamics.trajectory.state import CoordinateBroker, CoordinateSubset
|
9
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianAcceleration
|
10
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianPosition
|
11
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianVelocity
|
12
|
+
|
13
|
+
|
14
|
+
@pytest.fixture
|
15
|
+
def name() -> str:
|
16
|
+
return "Cartesian Acceleration"
|
17
|
+
|
18
|
+
|
19
|
+
@pytest.fixture
|
20
|
+
def cartesian_position() -> CartesianPosition:
|
21
|
+
return CartesianPosition.default()
|
22
|
+
|
23
|
+
|
24
|
+
@pytest.fixture
|
25
|
+
def cartesian_velocity() -> CartesianVelocity:
|
26
|
+
return CartesianVelocity.default()
|
27
|
+
|
28
|
+
|
29
|
+
@pytest.fixture
|
30
|
+
def cartesian_acceleration() -> CartesianAcceleration:
|
31
|
+
return CartesianAcceleration.default()
|
32
|
+
|
33
|
+
|
34
|
+
@pytest.fixture
|
35
|
+
def coordinate_subsets(
|
36
|
+
cartesian_acceleration: CartesianAcceleration,
|
37
|
+
) -> list[CoordinateSubset]:
|
38
|
+
return [cartesian_acceleration]
|
39
|
+
|
40
|
+
|
41
|
+
@pytest.fixture
|
42
|
+
def instant() -> Instant:
|
43
|
+
return Instant.J2000()
|
44
|
+
|
45
|
+
|
46
|
+
@pytest.fixture
|
47
|
+
def frame() -> Frame:
|
48
|
+
return Frame.GCRF()
|
49
|
+
|
50
|
+
|
51
|
+
@pytest.fixture
|
52
|
+
def coordinate_broker(
|
53
|
+
coordinate_subsets: list[CoordinateSubset],
|
54
|
+
) -> CoordinateBroker:
|
55
|
+
return CoordinateBroker(coordinate_subsets)
|
56
|
+
|
57
|
+
|
58
|
+
@pytest.fixture
|
59
|
+
def coordinates() -> list[float]:
|
60
|
+
return [9.81, 0.0, 0.0]
|
61
|
+
|
62
|
+
|
63
|
+
@pytest.fixture
|
64
|
+
def another_coordinates() -> list[float]:
|
65
|
+
return [0.0, 9.81, 0.0]
|
66
|
+
|
67
|
+
|
68
|
+
class TestCartesianAcceleration:
|
69
|
+
def test_constructor(
|
70
|
+
self,
|
71
|
+
cartesian_position: CartesianPosition,
|
72
|
+
cartesian_velocity: CartesianVelocity,
|
73
|
+
name: str,
|
74
|
+
):
|
75
|
+
assert (
|
76
|
+
CartesianAcceleration(cartesian_position, cartesian_velocity, name)
|
77
|
+
is not None
|
78
|
+
)
|
79
|
+
|
80
|
+
def test_add(
|
81
|
+
self,
|
82
|
+
cartesian_acceleration: CartesianAcceleration,
|
83
|
+
instant: Instant,
|
84
|
+
frame: Frame,
|
85
|
+
coordinates: list[float],
|
86
|
+
another_coordinates: list[float],
|
87
|
+
coordinate_broker: CoordinateBroker,
|
88
|
+
):
|
89
|
+
assert all(
|
90
|
+
cartesian_acceleration.add(
|
91
|
+
instant, coordinates, another_coordinates, frame, coordinate_broker
|
92
|
+
)
|
93
|
+
== [9.81, 9.81, 0.0]
|
94
|
+
)
|
95
|
+
|
96
|
+
def test_subtract(
|
97
|
+
self,
|
98
|
+
cartesian_acceleration: CartesianAcceleration,
|
99
|
+
instant: Instant,
|
100
|
+
frame: Frame,
|
101
|
+
coordinates: list[float],
|
102
|
+
another_coordinates: list[float],
|
103
|
+
coordinate_broker: CoordinateBroker,
|
104
|
+
):
|
105
|
+
assert all(
|
106
|
+
cartesian_acceleration.subtract(
|
107
|
+
instant, coordinates, another_coordinates, frame, coordinate_broker
|
108
|
+
)
|
109
|
+
== [9.81, -9.81, 0.0]
|
110
|
+
)
|
111
|
+
|
112
|
+
def test_in_frame(
|
113
|
+
self,
|
114
|
+
cartesian_acceleration: CartesianAcceleration,
|
115
|
+
instant: Instant,
|
116
|
+
frame: Frame,
|
117
|
+
coordinates: list[float],
|
118
|
+
coordinate_broker: CoordinateBroker,
|
119
|
+
):
|
120
|
+
assert (
|
121
|
+
cartesian_acceleration.in_frame(
|
122
|
+
instant, coordinates, frame, frame, coordinate_broker
|
123
|
+
)
|
124
|
+
is not None
|
125
|
+
)
|
126
|
+
|
127
|
+
with pytest.raises(RuntimeError):
|
128
|
+
cartesian_acceleration.in_frame(
|
129
|
+
instant, coordinates, frame, Frame.ITRF(), coordinate_broker
|
130
|
+
)
|
131
|
+
|
132
|
+
def test_default(self):
|
133
|
+
assert CartesianAcceleration.default() is not None
|
134
|
+
|
135
|
+
def test_thrust_acceleration(self):
|
136
|
+
assert CartesianAcceleration.thrust_acceleration() is not None
|
@@ -44,3 +44,12 @@ class TestCoordinateSubset:
|
|
44
44
|
|
45
45
|
def test_mass(self):
|
46
46
|
assert CoordinateSubset.mass() is not None
|
47
|
+
|
48
|
+
def test_surface_area(self):
|
49
|
+
assert CoordinateSubset.surface_area() is not None
|
50
|
+
|
51
|
+
def test_drag_coefficient(self):
|
52
|
+
assert CoordinateSubset.drag_coefficient() is not None
|
53
|
+
|
54
|
+
def test_mass_flow_rate(self):
|
55
|
+
assert CoordinateSubset.mass_flow_rate() is not None
|
@@ -7,7 +7,10 @@ from ostk.physics.time import DateTime
|
|
7
7
|
from ostk.physics.time import Scale
|
8
8
|
from ostk.physics.coordinate import Frame
|
9
9
|
from ostk.physics.coordinate import Transform
|
10
|
+
from ostk.physics.coordinate import Position
|
11
|
+
from ostk.physics.coordinate import Velocity
|
10
12
|
|
13
|
+
from ostk.astrodynamics.trajectory import State
|
11
14
|
from ostk.astrodynamics.trajectory import LocalOrbitalFrameFactory
|
12
15
|
from ostk.astrodynamics.trajectory import LocalOrbitalFrameTransformProvider
|
13
16
|
|
@@ -24,7 +27,7 @@ def local_orbital_transform_provider_type() -> LocalOrbitalFrameTransformProvide
|
|
24
27
|
|
25
28
|
@pytest.fixture
|
26
29
|
def transform_generator() -> callable:
|
27
|
-
return lambda
|
30
|
+
return lambda state: Transform.identity(Transform.Type.passive)
|
28
31
|
|
29
32
|
|
30
33
|
@pytest.fixture
|
@@ -38,13 +41,24 @@ def instant() -> Instant:
|
|
38
41
|
|
39
42
|
|
40
43
|
@pytest.fixture
|
41
|
-
def
|
42
|
-
return [7500000.0, 0.0, 0.0]
|
44
|
+
def position() -> Position:
|
45
|
+
return Position.meters([7500000.0, 0.0, 0.0], Frame.GCRF())
|
43
46
|
|
44
47
|
|
45
48
|
@pytest.fixture
|
46
|
-
def
|
47
|
-
return
|
49
|
+
def velocity() -> Velocity:
|
50
|
+
return Velocity.meters_per_second(
|
51
|
+
[0.0, 5335.865450622126, 5335.865450622126], Frame.GCRF()
|
52
|
+
)
|
53
|
+
|
54
|
+
|
55
|
+
@pytest.fixture
|
56
|
+
def state(
|
57
|
+
instant: Instant,
|
58
|
+
position: Position,
|
59
|
+
velocity: Velocity,
|
60
|
+
) -> State:
|
61
|
+
return State(instant, position, velocity)
|
48
62
|
|
49
63
|
|
50
64
|
class TestLocalOrbitalFrameFactory:
|
@@ -66,15 +80,9 @@ class TestLocalOrbitalFrameFactory:
|
|
66
80
|
def test_generate_frame(
|
67
81
|
self,
|
68
82
|
local_orbital_frame_factory: LocalOrbitalFrameFactory,
|
69
|
-
|
70
|
-
position_vector: list,
|
71
|
-
velocity_vector: list,
|
83
|
+
state: State,
|
72
84
|
):
|
73
|
-
frame = local_orbital_frame_factory.generate_frame(
|
74
|
-
instant,
|
75
|
-
position_vector,
|
76
|
-
velocity_vector,
|
77
|
-
)
|
85
|
+
frame = local_orbital_frame_factory.generate_frame(state=state)
|
78
86
|
|
79
87
|
assert frame is not None
|
80
88
|
assert frame.is_defined()
|
@@ -15,8 +15,6 @@ from ostk.physics.time import Instant
|
|
15
15
|
from ostk.physics.time import DateTime
|
16
16
|
from ostk.physics.time import Scale
|
17
17
|
from ostk.physics.time import Duration
|
18
|
-
from ostk.physics.coordinate import Position
|
19
|
-
from ostk.physics.coordinate import Velocity
|
20
18
|
from ostk.physics.coordinate import Frame
|
21
19
|
from ostk.physics.environment.object.celestial import Earth, Sun
|
22
20
|
from ostk.physics.environment.gravitational import Earth as EarthGravitationalModel
|
@@ -25,13 +23,12 @@ from ostk.physics.environment.atmospheric import Earth as EarthAtmosphericModel
|
|
25
23
|
|
26
24
|
from ostk.astrodynamics.trajectory import LocalOrbitalFrameFactory
|
27
25
|
from ostk.astrodynamics.trajectory import LocalOrbitalFrameDirection
|
28
|
-
|
29
26
|
from ostk.astrodynamics.trajectory.state import CoordinateSubset
|
30
27
|
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianPosition
|
31
28
|
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianVelocity
|
29
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianAcceleration
|
32
30
|
from ostk.astrodynamics.trajectory.state import CoordinateBroker
|
33
31
|
from ostk.astrodynamics.trajectory.state import NumericalSolver
|
34
|
-
|
35
32
|
from ostk.astrodynamics import Dynamics
|
36
33
|
from ostk.astrodynamics.dynamics import Thruster
|
37
34
|
from ostk.astrodynamics.dynamics import CentralBodyGravity
|
@@ -43,22 +40,9 @@ from ostk.astrodynamics.flight import Maneuver
|
|
43
40
|
from ostk.astrodynamics.flight.system import PropulsionSystem
|
44
41
|
from ostk.astrodynamics.flight.system import SatelliteSystem
|
45
42
|
from ostk.astrodynamics.trajectory import State
|
46
|
-
from ostk.astrodynamics.trajectory.state import CoordinateSubset, CoordinateBroker
|
47
|
-
from ostk.astrodynamics.trajectory.state.coordinate_subset import (
|
48
|
-
CartesianPosition,
|
49
|
-
CartesianVelocity,
|
50
|
-
)
|
51
43
|
from ostk.astrodynamics.trajectory import Propagator
|
52
44
|
|
53
45
|
|
54
|
-
from ..flight.test_maneuver import (
|
55
|
-
instants as maneuver_instants,
|
56
|
-
acceleration_profile as maneuver_acceleration_profile,
|
57
|
-
frame as maneuver_frame,
|
58
|
-
mass_flow_rate_profile as maneuver_mass_flow_rate_profile,
|
59
|
-
)
|
60
|
-
|
61
|
-
|
62
46
|
@pytest.fixture
|
63
47
|
def propulsion_system() -> PropulsionSystem:
|
64
48
|
return PropulsionSystem(
|
@@ -249,19 +233,29 @@ def event_condition(state: State) -> InstantCondition:
|
|
249
233
|
)
|
250
234
|
|
251
235
|
|
236
|
+
@pytest.fixture
|
237
|
+
def maneuver_states(frame: Frame) -> list[State]:
|
238
|
+
return [
|
239
|
+
State(
|
240
|
+
Instant.J2000() + Duration.seconds(float(i)),
|
241
|
+
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -1e-3],
|
242
|
+
frame,
|
243
|
+
[
|
244
|
+
CartesianPosition.default(),
|
245
|
+
CartesianVelocity.default(),
|
246
|
+
CartesianAcceleration.thrust_acceleration(),
|
247
|
+
CoordinateSubset.mass_flow_rate(),
|
248
|
+
],
|
249
|
+
)
|
250
|
+
for i in range(0, 100, 10)
|
251
|
+
]
|
252
|
+
|
253
|
+
|
252
254
|
@pytest.fixture
|
253
255
|
def maneuver(
|
254
|
-
|
255
|
-
maneuver_acceleration_profile: list[np.ndarray],
|
256
|
-
maneuver_frame: Frame,
|
257
|
-
maneuver_mass_flow_rate_profile: list[float],
|
256
|
+
maneuver_states: list[State],
|
258
257
|
) -> Maneuver:
|
259
|
-
return Maneuver(
|
260
|
-
maneuver_instants,
|
261
|
-
maneuver_acceleration_profile,
|
262
|
-
maneuver_frame,
|
263
|
-
maneuver_mass_flow_rate_profile,
|
264
|
-
)
|
258
|
+
return Maneuver(states=maneuver_states)
|
265
259
|
|
266
260
|
|
267
261
|
@pytest.fixture
|