open-space-toolkit-astrodynamics 6.1.0__py310-none-any.whl → 7.0.0__py310-none-any.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-6.1.0.dist-info → open_space_toolkit_astrodynamics-7.0.0.dist-info}/METADATA +2 -2
- open_space_toolkit_astrodynamics-7.0.0.dist-info/RECORD +97 -0
- ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-310-x86_64-linux-gnu.so +0 -0
- ostk/astrodynamics/display.py +3 -3
- ostk/astrodynamics/{libopen-space-toolkit-astrodynamics.so.6 → libopen-space-toolkit-astrodynamics.so.7} +0 -0
- ostk/astrodynamics/pytrajectory/pystate.py +4 -4
- ostk/astrodynamics/test/access/test_generator.py +6 -6
- ostk/astrodynamics/test/conftest.py +2 -2
- ostk/astrodynamics/test/conjunction/{messages → message}/ccsds/test_cdm.py +4 -4
- ostk/astrodynamics/test/dynamics/test_atmospheric_drag.py +18 -18
- ostk/astrodynamics/test/dynamics/test_central_body_gravity.py +1 -1
- ostk/astrodynamics/test/dynamics/test_dynamics.py +3 -3
- ostk/astrodynamics/test/dynamics/test_position_derivative.py +1 -1
- ostk/astrodynamics/test/dynamics/test_tabulated.py +5 -5
- ostk/astrodynamics/test/dynamics/test_third_body_gravity.py +1 -1
- ostk/astrodynamics/test/dynamics/test_thruster.py +17 -17
- ostk/astrodynamics/test/event_condition/test_angular_condition.py +1 -1
- ostk/astrodynamics/test/event_condition/test_coe_condition.py +1 -1
- ostk/astrodynamics/test/flight/system/test_propulsion_system.py +1 -1
- ostk/astrodynamics/test/flight/system/test_satellite_system.py +4 -4
- ostk/astrodynamics/test/flight/system/test_satellite_system_builder.py +4 -4
- ostk/astrodynamics/test/flight/test_profile.py +7 -7
- ostk/astrodynamics/test/flight/test_system.py +4 -4
- ostk/astrodynamics/test/guidance_law/test_qlaw.py +5 -5
- ostk/astrodynamics/test/solvers/test_finite_difference_solver.py +5 -5
- ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +4 -4
- ostk/astrodynamics/test/test_access.py +9 -9
- ostk/astrodynamics/test/test_display.py +6 -6
- ostk/astrodynamics/test/test_import.py +5 -5
- ostk/astrodynamics/test/test_trajectory.py +9 -9
- ostk/astrodynamics/test/test_utilities.py +7 -7
- ostk/astrodynamics/test/test_viewer.py +4 -3
- ostk/astrodynamics/test/trajectory/orbit/{messages → message}/spacex/test_opm.py +4 -4
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean.py +3 -3
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean_long.py +4 -4
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean_short.py +4 -4
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +3 -3
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +4 -4
- ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +6 -6
- ostk/astrodynamics/test/trajectory/orbit/models/test_propagated.py +2 -2
- ostk/astrodynamics/test/trajectory/orbit/models/test_tabulated.py +1 -1
- ostk/astrodynamics/test/trajectory/state/{coordinates_subset → coordinate_subset}/test_angular_velocity.py +1 -1
- ostk/astrodynamics/test/trajectory/state/{coordinates_subset → coordinate_subset}/test_attitude_quaternion.py +1 -1
- ostk/astrodynamics/test/trajectory/state/{coordinates_subset → coordinate_subset}/test_cartesian_position.py +14 -14
- ostk/astrodynamics/test/trajectory/state/{coordinates_subset → coordinate_subset}/test_cartesian_velocity.py +14 -14
- ostk/astrodynamics/test/trajectory/state/test_coordinate_broker.py +84 -0
- ostk/astrodynamics/test/trajectory/state/test_coordinate_subset.py +43 -0
- ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +10 -10
- ostk/astrodynamics/test/trajectory/test_orbit.py +4 -4
- ostk/astrodynamics/test/trajectory/test_propagator.py +23 -23
- ostk/astrodynamics/test/trajectory/test_segment.py +8 -8
- ostk/astrodynamics/test/trajectory/test_sequence.py +18 -18
- ostk/astrodynamics/test/trajectory/test_state.py +34 -20
- ostk/astrodynamics/test/trajectory/test_state_builder.py +22 -22
- ostk/astrodynamics/utilities.py +1 -1
- ostk/astrodynamics/viewer.py +33 -3
- open_space_toolkit_astrodynamics-6.1.0.dist-info/RECORD +0 -99
- ostk/astrodynamics/test/flight/profile/test_state.py +0 -144
- ostk/astrodynamics/test/trajectory/orbit/messages/spacex/__init__.py +0 -1
- ostk/astrodynamics/test/trajectory/state/test_coordinates_broker.py +0 -84
- ostk/astrodynamics/test/trajectory/state/test_coordinates_subset.py +0 -43
- {open_space_toolkit_astrodynamics-6.1.0.dist-info → open_space_toolkit_astrodynamics-7.0.0.dist-info}/WHEEL +0 -0
- {open_space_toolkit_astrodynamics-6.1.0.dist-info → open_space_toolkit_astrodynamics-7.0.0.dist-info}/top_level.txt +0 -0
- {open_space_toolkit_astrodynamics-6.1.0.dist-info → open_space_toolkit_astrodynamics-7.0.0.dist-info}/zip-safe +0 -0
- /ostk/astrodynamics/test/conjunction/{messages → message}/ccsds/__init__.py +0 -0
- /ostk/astrodynamics/test/conjunction/{messages → message}/ccsds/conftest.py +0 -0
- /ostk/astrodynamics/test/conjunction/{messages → message}/ccsds/data/cdm.json +0 -0
- /ostk/astrodynamics/test/{flight/profile → trajectory/orbit/message}/__init__.py +0 -0
- /ostk/astrodynamics/test/trajectory/orbit/{messages → message/spacex}/__init__.py +0 -0
- /ostk/astrodynamics/test/trajectory/orbit/{messages → message}/spacex/conftest.py +0 -0
- /ostk/astrodynamics/test/trajectory/orbit/{messages → message}/spacex/data/opm_1.yaml +0 -0
@@ -0,0 +1,84 @@
|
|
1
|
+
# Apache License 2.0
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
from ostk.astrodynamics.trajectory.state import CoordinateBroker, CoordinateSubset
|
6
|
+
|
7
|
+
|
8
|
+
@pytest.fixture
|
9
|
+
def coordinate_subsets() -> list:
|
10
|
+
return [CoordinateSubset("Subset1", 2), CoordinateSubset("Subset2", 3)]
|
11
|
+
|
12
|
+
|
13
|
+
@pytest.fixture
|
14
|
+
def coordinate_broker(coordinate_subsets) -> CoordinateBroker:
|
15
|
+
return CoordinateBroker(coordinate_subsets)
|
16
|
+
|
17
|
+
|
18
|
+
@pytest.fixture
|
19
|
+
def coordinates() -> list[float]:
|
20
|
+
return [1.0, 2.0, 3.0, 4.0, 5.0]
|
21
|
+
|
22
|
+
|
23
|
+
class TestCoordinateBroker:
|
24
|
+
def test_constructor(self, coordinate_broker: CoordinateBroker):
|
25
|
+
assert coordinate_broker is not None
|
26
|
+
|
27
|
+
def test_eq(self, coordinate_broker: CoordinateBroker):
|
28
|
+
assert coordinate_broker == coordinate_broker
|
29
|
+
|
30
|
+
def test_ne(self, coordinate_broker: CoordinateBroker):
|
31
|
+
assert (coordinate_broker != coordinate_broker) == False
|
32
|
+
|
33
|
+
def test_access_subsets(
|
34
|
+
self, coordinate_broker: CoordinateBroker, coordinate_subsets: list
|
35
|
+
):
|
36
|
+
assert coordinate_broker.access_subsets() == coordinate_subsets
|
37
|
+
|
38
|
+
def test_get_number_of_coordinates(self, coordinate_broker: CoordinateBroker):
|
39
|
+
assert coordinate_broker.get_number_of_coordinates() == 5
|
40
|
+
|
41
|
+
def test_get_number_of_subsets(self, coordinate_broker: CoordinateBroker):
|
42
|
+
assert coordinate_broker.get_number_of_subsets() == 2
|
43
|
+
|
44
|
+
def test_get_subsets(
|
45
|
+
self, coordinate_broker: CoordinateBroker, coordinate_subsets: list
|
46
|
+
):
|
47
|
+
assert coordinate_broker.get_subsets() == coordinate_subsets
|
48
|
+
|
49
|
+
def test_add_subset(self, coordinate_broker: CoordinateBroker):
|
50
|
+
new_subset = CoordinateSubset("NewSubset", 4)
|
51
|
+
number_of_coordinates = coordinate_broker.get_number_of_coordinates()
|
52
|
+
assert coordinate_broker.add_subset(new_subset) == number_of_coordinates
|
53
|
+
assert coordinate_broker.has_subset(new_subset)
|
54
|
+
|
55
|
+
def test_has_subset(
|
56
|
+
self, coordinate_broker: CoordinateBroker, coordinate_subsets: list
|
57
|
+
):
|
58
|
+
assert coordinate_broker.has_subset(coordinate_subsets[0])
|
59
|
+
|
60
|
+
def test_extract_coordinate(
|
61
|
+
self,
|
62
|
+
coordinate_broker: CoordinateBroker,
|
63
|
+
coordinates: list[float],
|
64
|
+
coordinate_subsets: list[CoordinateSubset],
|
65
|
+
):
|
66
|
+
assert (
|
67
|
+
coordinate_broker.extract_coordinate(coordinates, coordinate_subsets[0])
|
68
|
+
== [1.0, 2.0]
|
69
|
+
).all()
|
70
|
+
assert (
|
71
|
+
coordinate_broker.extract_coordinate(coordinates, coordinate_subsets[1])
|
72
|
+
== [3.0, 4.0, 5.0]
|
73
|
+
).all()
|
74
|
+
|
75
|
+
def test_extract_coordinates(
|
76
|
+
self,
|
77
|
+
coordinate_broker: CoordinateBroker,
|
78
|
+
coordinates: list[float],
|
79
|
+
coordinate_subsets: list[CoordinateSubset],
|
80
|
+
):
|
81
|
+
assert (
|
82
|
+
coordinate_broker.extract_coordinates(coordinates, coordinate_subsets)
|
83
|
+
== [1.0, 2.0, 3.0, 4.0, 5.0]
|
84
|
+
).all()
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Apache License 2.0
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
from ostk.astrodynamics.trajectory.state import CoordinateSubset
|
6
|
+
|
7
|
+
|
8
|
+
@pytest.fixture
|
9
|
+
def name() -> str:
|
10
|
+
return "MySubset"
|
11
|
+
|
12
|
+
|
13
|
+
@pytest.fixture
|
14
|
+
def size() -> int:
|
15
|
+
return 3
|
16
|
+
|
17
|
+
|
18
|
+
@pytest.fixture
|
19
|
+
def coordinate_subset(name: str, size: int) -> CoordinateSubset:
|
20
|
+
return CoordinateSubset(name, size)
|
21
|
+
|
22
|
+
|
23
|
+
class TestCoordinateSubset:
|
24
|
+
def test_constructor(self, coordinate_subset: CoordinateSubset):
|
25
|
+
assert coordinate_subset is not None
|
26
|
+
|
27
|
+
def test_eq(self, coordinate_subset: CoordinateSubset):
|
28
|
+
assert coordinate_subset == coordinate_subset
|
29
|
+
|
30
|
+
def test_ne(self, coordinate_subset: CoordinateSubset):
|
31
|
+
assert (coordinate_subset != coordinate_subset) == False
|
32
|
+
|
33
|
+
def test_get_id(self, coordinate_subset: CoordinateSubset):
|
34
|
+
assert coordinate_subset.get_id() is not None
|
35
|
+
|
36
|
+
def test_get_name(self, coordinate_subset: CoordinateSubset, name: str):
|
37
|
+
assert coordinate_subset.get_name() == name
|
38
|
+
|
39
|
+
def test_get_size(self, coordinate_subset: CoordinateSubset, size: int):
|
40
|
+
assert coordinate_subset.get_size() == size
|
41
|
+
|
42
|
+
def test_mass(self):
|
43
|
+
assert CoordinateSubset.mass() is not None
|
@@ -11,8 +11,8 @@ from ostk.physics.coordinate import Frame
|
|
11
11
|
from ostk.astrodynamics.trajectory import State
|
12
12
|
from ostk.astrodynamics.trajectory.state import (
|
13
13
|
NumericalSolver,
|
14
|
-
|
15
|
-
|
14
|
+
CoordinateBroker,
|
15
|
+
CoordinateSubset,
|
16
16
|
)
|
17
17
|
from ostk.astrodynamics.event_condition import RealCondition
|
18
18
|
|
@@ -28,15 +28,15 @@ def get_state_vec(time: float) -> np.ndarray:
|
|
28
28
|
|
29
29
|
|
30
30
|
@pytest.fixture
|
31
|
-
def
|
32
|
-
return [
|
31
|
+
def coordinate_subsets() -> list[CoordinateSubset]:
|
32
|
+
return [CoordinateSubset("Subset", 2)]
|
33
33
|
|
34
34
|
|
35
35
|
@pytest.fixture
|
36
|
-
def
|
37
|
-
|
38
|
-
) ->
|
39
|
-
return
|
36
|
+
def coordinate_broker(
|
37
|
+
coordinate_subsets: list[CoordinateSubset],
|
38
|
+
) -> CoordinateBroker:
|
39
|
+
return CoordinateBroker(coordinate_subsets)
|
40
40
|
|
41
41
|
|
42
42
|
@pytest.fixture
|
@@ -53,9 +53,9 @@ def frame() -> Frame:
|
|
53
53
|
def initial_state(
|
54
54
|
start_instant: Instant,
|
55
55
|
frame: Frame,
|
56
|
-
|
56
|
+
coordinate_broker: CoordinateBroker,
|
57
57
|
) -> State:
|
58
|
-
return State(start_instant, get_state_vec(0.0), frame,
|
58
|
+
return State(start_instant, get_state_vec(0.0), frame, coordinate_broker)
|
59
59
|
|
60
60
|
|
61
61
|
@pytest.fixture
|
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
import pytest
|
4
4
|
|
5
|
-
from ostk.physics.environment.
|
6
|
-
from ostk.physics.
|
5
|
+
from ostk.physics.environment.object.celestial import Earth
|
6
|
+
from ostk.physics.unit import Length, Angle
|
7
7
|
from ostk.physics.time import Scale, Instant, DateTime, Time, Duration, Interval
|
8
8
|
|
9
9
|
from ostk.astrodynamics.trajectory import Orbit, State
|
10
10
|
from ostk.astrodynamics.trajectory.orbit import Pass
|
11
11
|
from ostk.astrodynamics.trajectory.orbit import Pass
|
12
|
-
from ostk.astrodynamics.trajectory.orbit.
|
13
|
-
from ostk.astrodynamics.trajectory.orbit.
|
12
|
+
from ostk.astrodynamics.trajectory.orbit.model import SGP4
|
13
|
+
from ostk.astrodynamics.trajectory.orbit.model.sgp4 import TLE
|
14
14
|
|
15
15
|
|
16
16
|
@pytest.fixture
|
@@ -4,12 +4,12 @@ import pytest
|
|
4
4
|
|
5
5
|
import numpy as np
|
6
6
|
|
7
|
-
from ostk.mathematics.geometry.d3.
|
8
|
-
from ostk.mathematics.geometry.d3.
|
9
|
-
from ostk.mathematics.geometry.d3.
|
7
|
+
from ostk.mathematics.geometry.d3.object import Cuboid
|
8
|
+
from ostk.mathematics.geometry.d3.object import Composite
|
9
|
+
from ostk.mathematics.geometry.d3.object import Point
|
10
10
|
|
11
11
|
from ostk.physics import Environment
|
12
|
-
from ostk.physics.
|
12
|
+
from ostk.physics.unit import Mass
|
13
13
|
from ostk.physics.time import Instant
|
14
14
|
from ostk.physics.time import DateTime
|
15
15
|
from ostk.physics.time import Scale
|
@@ -17,7 +17,7 @@ from ostk.physics.time import Duration
|
|
17
17
|
from ostk.physics.coordinate import Position
|
18
18
|
from ostk.physics.coordinate import Velocity
|
19
19
|
from ostk.physics.coordinate import Frame
|
20
|
-
from ostk.physics.environment.
|
20
|
+
from ostk.physics.environment.object.celestial import Earth, Sun
|
21
21
|
from ostk.physics.environment.gravitational import Earth as EarthGravitationalModel
|
22
22
|
from ostk.physics.environment.magnetic import Earth as EarthMagneticModel
|
23
23
|
from ostk.physics.environment.atmospheric import Earth as EarthAtmosphericModel
|
@@ -25,10 +25,10 @@ from ostk.physics.environment.atmospheric import Earth as EarthAtmosphericModel
|
|
25
25
|
from ostk.astrodynamics.trajectory import LocalOrbitalFrameFactory
|
26
26
|
from ostk.astrodynamics.trajectory import LocalOrbitalFrameDirection
|
27
27
|
|
28
|
-
from ostk.astrodynamics.trajectory.state import
|
29
|
-
from ostk.astrodynamics.trajectory.state.
|
30
|
-
from ostk.astrodynamics.trajectory.state.
|
31
|
-
from ostk.astrodynamics.trajectory.state import
|
28
|
+
from ostk.astrodynamics.trajectory.state import CoordinateSubset
|
29
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianPosition
|
30
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianVelocity
|
31
|
+
from ostk.astrodynamics.trajectory.state import CoordinateBroker
|
32
32
|
from ostk.astrodynamics.trajectory.state import NumericalSolver
|
33
33
|
|
34
34
|
from ostk.astrodynamics.flight.system import PropulsionSystem
|
@@ -40,8 +40,8 @@ from ostk.astrodynamics.dynamics import PositionDerivative
|
|
40
40
|
from ostk.astrodynamics.dynamics import AtmosphericDrag
|
41
41
|
from ostk.astrodynamics.guidance_law import ConstantThrust
|
42
42
|
from ostk.astrodynamics.trajectory import State
|
43
|
-
from ostk.astrodynamics.trajectory.state import
|
44
|
-
from ostk.astrodynamics.trajectory.state.
|
43
|
+
from ostk.astrodynamics.trajectory.state import CoordinateSubset, CoordinateBroker
|
44
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import (
|
45
45
|
CartesianPosition,
|
46
46
|
CartesianVelocity,
|
47
47
|
)
|
@@ -99,32 +99,32 @@ def environment(earth) -> Environment:
|
|
99
99
|
|
100
100
|
|
101
101
|
@pytest.fixture
|
102
|
-
def
|
103
|
-
return
|
102
|
+
def coordinate_broker_7d():
|
103
|
+
return CoordinateBroker(
|
104
104
|
[
|
105
105
|
CartesianPosition.default(),
|
106
106
|
CartesianVelocity.default(),
|
107
|
-
|
107
|
+
CoordinateSubset.mass(),
|
108
108
|
]
|
109
109
|
)
|
110
110
|
|
111
111
|
|
112
112
|
@pytest.fixture
|
113
|
-
def
|
114
|
-
return
|
113
|
+
def coordinate_broker_9d():
|
114
|
+
return CoordinateBroker(
|
115
115
|
[
|
116
116
|
CartesianPosition.default(),
|
117
117
|
CartesianVelocity.default(),
|
118
|
-
|
119
|
-
|
120
|
-
|
118
|
+
CoordinateSubset.mass(),
|
119
|
+
CoordinateSubset.surface_area(),
|
120
|
+
CoordinateSubset.drag_coefficient(),
|
121
121
|
]
|
122
122
|
)
|
123
123
|
|
124
124
|
|
125
125
|
@pytest.fixture
|
126
126
|
def state(
|
127
|
-
satellite_system: SatelliteSystem,
|
127
|
+
satellite_system: SatelliteSystem, coordinate_broker_7d: CoordinateBroker
|
128
128
|
) -> State:
|
129
129
|
instant: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
130
130
|
|
@@ -140,12 +140,12 @@ def state(
|
|
140
140
|
satellite_system.get_mass().in_kilograms() + propellant_mass,
|
141
141
|
]
|
142
142
|
|
143
|
-
return State(instant, coordinates, Frame.GCRF(),
|
143
|
+
return State(instant, coordinates, Frame.GCRF(), coordinate_broker_7d)
|
144
144
|
|
145
145
|
|
146
146
|
@pytest.fixture
|
147
147
|
def state_low_altitude(
|
148
|
-
satellite_system: SatelliteSystem,
|
148
|
+
satellite_system: SatelliteSystem, coordinate_broker_9d: CoordinateBroker
|
149
149
|
) -> State:
|
150
150
|
instant: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
151
151
|
|
@@ -165,7 +165,7 @@ def state_low_altitude(
|
|
165
165
|
cd,
|
166
166
|
]
|
167
167
|
|
168
|
-
return State(instant, coordinates, Frame.GCRF(),
|
168
|
+
return State(instant, coordinates, Frame.GCRF(), coordinate_broker_9d)
|
169
169
|
|
170
170
|
|
171
171
|
@pytest.fixture
|
@@ -9,7 +9,7 @@ from ostk.physics.time import DateTime
|
|
9
9
|
from ostk.physics.time import Scale
|
10
10
|
from ostk.physics.time import Duration
|
11
11
|
from ostk.physics.coordinate import Frame
|
12
|
-
from ostk.physics.environment.
|
12
|
+
from ostk.physics.environment.object.celestial import Earth
|
13
13
|
|
14
14
|
from ostk.astrodynamics.trajectory.state import NumericalSolver
|
15
15
|
from ostk.astrodynamics.flight.system import SatelliteSystem
|
@@ -20,10 +20,10 @@ from ostk.astrodynamics.guidance_law import ConstantThrust
|
|
20
20
|
from ostk.astrodynamics.trajectory import State
|
21
21
|
from ostk.astrodynamics.trajectory import Segment
|
22
22
|
from ostk.astrodynamics.event_condition import InstantCondition
|
23
|
-
from ostk.astrodynamics.trajectory.state import
|
24
|
-
from ostk.astrodynamics.trajectory.state import
|
25
|
-
from ostk.astrodynamics.trajectory.state.
|
26
|
-
from ostk.astrodynamics.trajectory.state.
|
23
|
+
from ostk.astrodynamics.trajectory.state import CoordinateSubset
|
24
|
+
from ostk.astrodynamics.trajectory.state import CoordinateBroker
|
25
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianPosition
|
26
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianVelocity
|
27
27
|
|
28
28
|
|
29
29
|
@pytest.fixture
|
@@ -44,14 +44,14 @@ def state() -> State:
|
|
44
44
|
300.0,
|
45
45
|
]
|
46
46
|
frame: Frame = Frame.GCRF()
|
47
|
-
|
47
|
+
coordinate_broker: CoordinateBroker = CoordinateBroker(
|
48
48
|
[
|
49
49
|
CartesianPosition.default(),
|
50
50
|
CartesianVelocity.default(),
|
51
|
-
|
51
|
+
CoordinateSubset.mass(),
|
52
52
|
]
|
53
53
|
)
|
54
|
-
return State(instant, coordinates, frame,
|
54
|
+
return State(instant, coordinates, frame, coordinate_broker)
|
55
55
|
|
56
56
|
|
57
57
|
@pytest.fixture
|
@@ -4,23 +4,23 @@ import pytest
|
|
4
4
|
|
5
5
|
import numpy as np
|
6
6
|
|
7
|
-
from ostk.mathematics.geometry.d3.
|
8
|
-
from ostk.mathematics.geometry.d3.
|
9
|
-
from ostk.mathematics.geometry.d3.
|
7
|
+
from ostk.mathematics.geometry.d3.object import Composite
|
8
|
+
from ostk.mathematics.geometry.d3.object import Cuboid
|
9
|
+
from ostk.mathematics.geometry.d3.object import Point
|
10
10
|
|
11
11
|
from ostk.physics import Environment
|
12
12
|
from ostk.physics.coordinate import Frame
|
13
13
|
from ostk.physics.environment.atmospheric import Earth as EarthAtmosphericModel
|
14
14
|
from ostk.physics.environment.gravitational import Earth as EarthGravitationalModel
|
15
15
|
from ostk.physics.environment.magnetic import Earth as EarthMagneticModel
|
16
|
-
from ostk.physics.environment.
|
16
|
+
from ostk.physics.environment.object.celestial import Earth
|
17
17
|
from ostk.physics.time import DateTime
|
18
18
|
from ostk.physics.time import Duration
|
19
19
|
from ostk.physics.time import Instant
|
20
20
|
from ostk.physics.time import Scale
|
21
|
-
from ostk.physics.
|
22
|
-
from ostk.physics.
|
23
|
-
from ostk.physics.
|
21
|
+
from ostk.physics.unit import Derived
|
22
|
+
from ostk.physics.unit import Length
|
23
|
+
from ostk.physics.unit import Mass
|
24
24
|
|
25
25
|
from ostk.astrodynamics.event_condition import COECondition
|
26
26
|
from ostk.astrodynamics.event_condition import InstantCondition
|
@@ -36,11 +36,11 @@ from ostk.astrodynamics.trajectory import LocalOrbitalFrameFactory
|
|
36
36
|
from ostk.astrodynamics.trajectory import Segment
|
37
37
|
from ostk.astrodynamics.trajectory import Sequence
|
38
38
|
from ostk.astrodynamics.trajectory import State
|
39
|
-
from ostk.astrodynamics.trajectory.state import
|
40
|
-
from ostk.astrodynamics.trajectory.state import
|
39
|
+
from ostk.astrodynamics.trajectory.state import CoordinateBroker
|
40
|
+
from ostk.astrodynamics.trajectory.state import CoordinateSubset
|
41
41
|
from ostk.astrodynamics.trajectory.state import NumericalSolver
|
42
|
-
from ostk.astrodynamics.trajectory.state.
|
43
|
-
from ostk.astrodynamics.trajectory.state.
|
42
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianPosition
|
43
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianVelocity
|
44
44
|
|
45
45
|
|
46
46
|
@pytest.fixture
|
@@ -112,14 +112,14 @@ def environment() -> Environment:
|
|
112
112
|
|
113
113
|
|
114
114
|
@pytest.fixture
|
115
|
-
def
|
116
|
-
return
|
115
|
+
def coordinate_broker() -> CoordinateBroker:
|
116
|
+
return CoordinateBroker(
|
117
117
|
[
|
118
118
|
CartesianPosition.default(),
|
119
119
|
CartesianVelocity.default(),
|
120
|
-
|
121
|
-
|
122
|
-
|
120
|
+
CoordinateSubset.mass(),
|
121
|
+
CoordinateSubset.surface_area(),
|
122
|
+
CoordinateSubset.drag_coefficient(),
|
123
123
|
]
|
124
124
|
)
|
125
125
|
|
@@ -143,7 +143,7 @@ def state(
|
|
143
143
|
wet_mass: Mass,
|
144
144
|
cross_sectional_surface_area: float,
|
145
145
|
drag_coefficient: float,
|
146
|
-
|
146
|
+
coordinate_broker: CoordinateBroker,
|
147
147
|
) -> State:
|
148
148
|
frame: Frame = Frame.GCRF()
|
149
149
|
instant: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
@@ -168,7 +168,7 @@ def state(
|
|
168
168
|
drag_coefficient,
|
169
169
|
],
|
170
170
|
frame,
|
171
|
-
|
171
|
+
coordinate_broker,
|
172
172
|
)
|
173
173
|
|
174
174
|
|
@@ -14,8 +14,8 @@ from ostk.physics.coordinate import Velocity
|
|
14
14
|
from ostk.physics.coordinate import Frame
|
15
15
|
|
16
16
|
from ostk.astrodynamics.trajectory import State
|
17
|
-
from ostk.astrodynamics.trajectory.state import
|
18
|
-
from ostk.astrodynamics.trajectory.state.
|
17
|
+
from ostk.astrodynamics.trajectory.state import CoordinateBroker
|
18
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import (
|
19
19
|
CartesianPosition,
|
20
20
|
CartesianVelocity,
|
21
21
|
)
|
@@ -53,14 +53,28 @@ def angular_velocity() -> np.ndarray:
|
|
53
53
|
|
54
54
|
@pytest.fixture
|
55
55
|
def state(
|
56
|
-
instant: Instant,
|
56
|
+
instant: Instant,
|
57
|
+
position: Position,
|
58
|
+
velocity: Velocity,
|
57
59
|
) -> State:
|
58
60
|
return State(instant, position, velocity)
|
59
61
|
|
60
62
|
|
61
63
|
@pytest.fixture
|
62
|
-
def
|
63
|
-
|
64
|
+
def profile_state(
|
65
|
+
instant: Instant,
|
66
|
+
position: Position,
|
67
|
+
velocity: Velocity,
|
68
|
+
attitude: Quaternion,
|
69
|
+
angular_velocity: np.ndarray,
|
70
|
+
frame: Frame,
|
71
|
+
) -> State:
|
72
|
+
return State(instant, position, velocity, attitude, angular_velocity, frame)
|
73
|
+
|
74
|
+
|
75
|
+
@pytest.fixture
|
76
|
+
def coordinate_broker() -> CoordinateBroker:
|
77
|
+
return CoordinateBroker([CartesianPosition.default(), CartesianVelocity.default()])
|
64
78
|
|
65
79
|
|
66
80
|
class TestState:
|
@@ -95,7 +109,7 @@ class TestState:
|
|
95
109
|
position: Position,
|
96
110
|
velocity: Velocity,
|
97
111
|
frame: Frame,
|
98
|
-
|
112
|
+
coordinate_broker: CoordinateBroker,
|
99
113
|
):
|
100
114
|
state = State(instant, position, velocity)
|
101
115
|
assert state is not None
|
@@ -106,7 +120,7 @@ class TestState:
|
|
106
120
|
instant,
|
107
121
|
np.append(position.get_coordinates(), velocity.get_coordinates()),
|
108
122
|
frame,
|
109
|
-
|
123
|
+
coordinate_broker,
|
110
124
|
)
|
111
125
|
|
112
126
|
assert state is not None
|
@@ -173,24 +187,24 @@ class TestState:
|
|
173
187
|
|
174
188
|
def test_getters(
|
175
189
|
self,
|
176
|
-
|
190
|
+
profile_state: State,
|
177
191
|
instant: Instant,
|
178
192
|
position: Position,
|
179
193
|
velocity: Velocity,
|
194
|
+
attitude: Quaternion,
|
195
|
+
angular_velocity: np.ndarray,
|
180
196
|
frame: Frame,
|
181
|
-
coordinates_broker: CoordinatesBroker,
|
182
197
|
):
|
183
|
-
assert
|
184
|
-
assert
|
185
|
-
assert
|
186
|
-
assert
|
187
|
-
assert
|
188
|
-
assert
|
189
|
-
assert (
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
assert state.get_coordinates_subsets() == coordinates_broker.get_subsets()
|
198
|
+
assert profile_state.get_instant() == instant
|
199
|
+
assert profile_state.get_position() == position
|
200
|
+
assert profile_state.get_velocity() == velocity
|
201
|
+
assert profile_state.get_attitude() == attitude
|
202
|
+
assert np.all(profile_state.get_angular_velocity() == angular_velocity)
|
203
|
+
assert profile_state.has_subset(CartesianPosition.default())
|
204
|
+
assert profile_state.has_subset(CartesianVelocity.default())
|
205
|
+
assert profile_state.get_frame() == frame
|
206
|
+
assert profile_state.get_coordinates() is not None
|
207
|
+
assert profile_state.get_coordinate_subsets() is not None
|
194
208
|
|
195
209
|
def test_in_frame(
|
196
210
|
self,
|
@@ -14,10 +14,10 @@ from ostk.astrodynamics.trajectory import (
|
|
14
14
|
StateBuilder,
|
15
15
|
)
|
16
16
|
from ostk.astrodynamics.trajectory.state import (
|
17
|
-
|
18
|
-
|
17
|
+
CoordinateBroker,
|
18
|
+
CoordinateSubset,
|
19
19
|
)
|
20
|
-
from ostk.astrodynamics.trajectory.state.
|
20
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import (
|
21
21
|
CartesianPosition,
|
22
22
|
CartesianVelocity,
|
23
23
|
)
|
@@ -34,7 +34,7 @@ def frame() -> Frame:
|
|
34
34
|
|
35
35
|
|
36
36
|
@pytest.fixture
|
37
|
-
def
|
37
|
+
def coordinate_subsets() -> list[CoordinateSubset]:
|
38
38
|
return [CartesianPosition.default(), CartesianVelocity.default()]
|
39
39
|
|
40
40
|
|
@@ -44,10 +44,10 @@ def coordinates() -> list[float]:
|
|
44
44
|
|
45
45
|
|
46
46
|
@pytest.fixture
|
47
|
-
def
|
48
|
-
|
49
|
-
) ->
|
50
|
-
return
|
47
|
+
def coordinate_broker(
|
48
|
+
coordinate_subsets: list[CoordinateSubset],
|
49
|
+
) -> CoordinateBroker:
|
50
|
+
return CoordinateBroker(coordinate_subsets)
|
51
51
|
|
52
52
|
|
53
53
|
@pytest.fixture
|
@@ -55,23 +55,23 @@ def state(
|
|
55
55
|
instant: Instant,
|
56
56
|
coordinates: list[float],
|
57
57
|
frame: Frame,
|
58
|
-
|
58
|
+
coordinate_broker: CoordinateBroker,
|
59
59
|
) -> State:
|
60
|
-
return State(instant, coordinates, frame,
|
60
|
+
return State(instant, coordinates, frame, coordinate_broker)
|
61
61
|
|
62
62
|
|
63
63
|
@pytest.fixture
|
64
|
-
def state_builder(frame: Frame,
|
65
|
-
return StateBuilder(frame,
|
64
|
+
def state_builder(frame: Frame, coordinate_broker: CoordinateBroker) -> State:
|
65
|
+
return StateBuilder(frame, coordinate_broker)
|
66
66
|
|
67
67
|
|
68
68
|
class TestStateBuilder:
|
69
69
|
def test_broker_constructor(
|
70
70
|
self,
|
71
71
|
frame: Frame,
|
72
|
-
|
72
|
+
coordinate_broker: CoordinateBroker,
|
73
73
|
):
|
74
|
-
builder = StateBuilder(frame,
|
74
|
+
builder = StateBuilder(frame, coordinate_broker)
|
75
75
|
assert builder is not None
|
76
76
|
assert isinstance(builder, StateBuilder)
|
77
77
|
assert builder.is_defined()
|
@@ -79,9 +79,9 @@ class TestStateBuilder:
|
|
79
79
|
def test_subsets_constructor(
|
80
80
|
self,
|
81
81
|
frame: Frame,
|
82
|
-
|
82
|
+
coordinate_subsets: list[CoordinateSubset],
|
83
83
|
):
|
84
|
-
builder = StateBuilder(frame,
|
84
|
+
builder = StateBuilder(frame, coordinate_subsets)
|
85
85
|
assert builder is not None
|
86
86
|
assert isinstance(builder, StateBuilder)
|
87
87
|
assert builder.is_defined()
|
@@ -103,7 +103,7 @@ class TestStateBuilder:
|
|
103
103
|
self,
|
104
104
|
state_builder: StateBuilder,
|
105
105
|
):
|
106
|
-
added_builder: StateBuilder = state_builder +
|
106
|
+
added_builder: StateBuilder = state_builder + CoordinateSubset.mass()
|
107
107
|
assert isinstance(added_builder, StateBuilder)
|
108
108
|
assert state_builder != added_builder
|
109
109
|
|
@@ -125,7 +125,7 @@ class TestStateBuilder:
|
|
125
125
|
assert state.get_instant() == instant
|
126
126
|
assert (state.get_coordinates() == coordinates).all()
|
127
127
|
assert state.get_frame() == state_builder.get_frame()
|
128
|
-
assert state.
|
128
|
+
assert state.get_coordinate_subsets() == state_builder.get_coordinate_subsets()
|
129
129
|
|
130
130
|
def test_reduce(
|
131
131
|
self,
|
@@ -146,14 +146,14 @@ class TestStateBuilder:
|
|
146
146
|
[
|
147
147
|
CartesianPosition.default(),
|
148
148
|
CartesianVelocity.default(),
|
149
|
-
|
149
|
+
CoordinateSubset.mass(),
|
150
150
|
],
|
151
151
|
)
|
152
152
|
default_state: State = State(
|
153
153
|
state.get_instant(),
|
154
154
|
[100],
|
155
155
|
state.get_frame(),
|
156
|
-
|
156
|
+
CoordinateBroker([CoordinateSubset.mass()]),
|
157
157
|
)
|
158
158
|
expanded_state: State = builder.expand(state, default_state)
|
159
159
|
|
@@ -165,7 +165,7 @@ class TestStateBuilder:
|
|
165
165
|
self,
|
166
166
|
state_builder: StateBuilder,
|
167
167
|
frame: Frame,
|
168
|
-
|
168
|
+
coordinate_broker: CoordinateBroker,
|
169
169
|
):
|
170
170
|
assert state_builder.get_frame() == frame
|
171
|
-
assert state_builder.
|
171
|
+
assert state_builder.get_coordinate_subsets() == coordinate_broker.get_subsets()
|
ostk/astrodynamics/utilities.py
CHANGED
@@ -11,7 +11,7 @@ from ostk.physics.coordinate.spherical import LLA
|
|
11
11
|
from ostk.physics.coordinate.spherical import AER
|
12
12
|
from ostk.physics.coordinate import Position
|
13
13
|
from ostk.physics.coordinate import Frame
|
14
|
-
from ostk.physics.environment.
|
14
|
+
from ostk.physics.environment.object.celestial import Earth
|
15
15
|
from ostk.physics.environment.gravitational import Earth as EarthGravitationalModel
|
16
16
|
|
17
17
|
|