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,30 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import (
|
|
6
|
+
AngularVelocity,
|
|
7
|
+
AttitudeQuaternion,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@pytest.fixture
|
|
12
|
+
def attitude_quaternion() -> AttitudeQuaternion:
|
|
13
|
+
return AttitudeQuaternion.default()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@pytest.fixture
|
|
17
|
+
def name() -> str:
|
|
18
|
+
return "Angular Velocity"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class TestAngularVelocity:
|
|
22
|
+
def test_constructor(
|
|
23
|
+
self,
|
|
24
|
+
attitude_quaternion: AttitudeQuaternion,
|
|
25
|
+
name: str,
|
|
26
|
+
):
|
|
27
|
+
assert AngularVelocity(attitude_quaternion, name) is not None
|
|
28
|
+
|
|
29
|
+
def test_default(self):
|
|
30
|
+
assert AttitudeQuaternion.default() is not None
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import AttitudeQuaternion
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@pytest.fixture
|
|
9
|
+
def name() -> str:
|
|
10
|
+
return "Attitude"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TestAttitudeQuaternion:
|
|
14
|
+
def test_constructor(self, name: str):
|
|
15
|
+
assert AttitudeQuaternion(name) is not None
|
|
16
|
+
|
|
17
|
+
def test_default(self):
|
|
18
|
+
assert AttitudeQuaternion.default() is not None
|
|
@@ -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
|
|
@@ -0,0 +1,107 @@
|
|
|
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 CartesianPosition
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@pytest.fixture
|
|
13
|
+
def name() -> str:
|
|
14
|
+
return "Position"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@pytest.fixture
|
|
18
|
+
def cartesian_position() -> CartesianPosition:
|
|
19
|
+
return CartesianPosition.default()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@pytest.fixture
|
|
23
|
+
def coordinate_subsets(
|
|
24
|
+
cartesian_position: CartesianPosition,
|
|
25
|
+
) -> list[CoordinateSubset]:
|
|
26
|
+
return [cartesian_position]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@pytest.fixture
|
|
30
|
+
def instant() -> Instant:
|
|
31
|
+
return Instant.J2000()
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@pytest.fixture
|
|
35
|
+
def frame() -> Frame:
|
|
36
|
+
return Frame.GCRF()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@pytest.fixture
|
|
40
|
+
def coordinate_broker(
|
|
41
|
+
coordinate_subsets: list[CoordinateSubset],
|
|
42
|
+
) -> CoordinateBroker:
|
|
43
|
+
return CoordinateBroker(coordinate_subsets)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@pytest.fixture
|
|
47
|
+
def coordinates() -> list[float]:
|
|
48
|
+
return [7000000.0, 0.0, 0.0]
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@pytest.fixture
|
|
52
|
+
def another_coordinates() -> list[float]:
|
|
53
|
+
return [0.0, 7000000.0, 0.0]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class TestCartesianPosition:
|
|
57
|
+
def test_constructor(self, name: str):
|
|
58
|
+
assert CartesianPosition(name) is not None
|
|
59
|
+
|
|
60
|
+
def test_add(
|
|
61
|
+
self,
|
|
62
|
+
cartesian_position: CartesianPosition,
|
|
63
|
+
instant: Instant,
|
|
64
|
+
frame: Frame,
|
|
65
|
+
coordinates: list[float],
|
|
66
|
+
another_coordinates: list[float],
|
|
67
|
+
coordinate_broker: CoordinateBroker,
|
|
68
|
+
):
|
|
69
|
+
assert all(
|
|
70
|
+
cartesian_position.add(
|
|
71
|
+
instant, coordinates, another_coordinates, frame, coordinate_broker
|
|
72
|
+
)
|
|
73
|
+
== [7000000.0, 7000000.0, 0.0]
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
def test_subtract(
|
|
77
|
+
self,
|
|
78
|
+
cartesian_position: CartesianPosition,
|
|
79
|
+
instant: Instant,
|
|
80
|
+
frame: Frame,
|
|
81
|
+
coordinates: list[float],
|
|
82
|
+
another_coordinates: list[float],
|
|
83
|
+
coordinate_broker: CoordinateBroker,
|
|
84
|
+
):
|
|
85
|
+
assert all(
|
|
86
|
+
cartesian_position.subtract(
|
|
87
|
+
instant, coordinates, another_coordinates, frame, coordinate_broker
|
|
88
|
+
)
|
|
89
|
+
== [7000000.0, -7000000.0, 0.0]
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
def test_in_frame(
|
|
93
|
+
self,
|
|
94
|
+
cartesian_position: CartesianPosition,
|
|
95
|
+
instant: Instant,
|
|
96
|
+
frame: Frame,
|
|
97
|
+
coordinates: list[float],
|
|
98
|
+
another_coordinates: list[float],
|
|
99
|
+
coordinate_broker: CoordinateBroker,
|
|
100
|
+
):
|
|
101
|
+
for value, expected in zip(
|
|
102
|
+
cartesian_position.in_frame(
|
|
103
|
+
instant, coordinates, frame, Frame.ITRF(), coordinate_broker
|
|
104
|
+
),
|
|
105
|
+
[1238864.12746338, 6889500.39136482, -176.262107699686],
|
|
106
|
+
):
|
|
107
|
+
assert value == pytest.approx(expected, rel=1e-14)
|
|
@@ -0,0 +1,115 @@
|
|
|
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 (
|
|
10
|
+
CartesianVelocity,
|
|
11
|
+
CartesianPosition,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@pytest.fixture
|
|
16
|
+
def name() -> str:
|
|
17
|
+
return "Position"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@pytest.fixture
|
|
21
|
+
def cartesian_position() -> CartesianPosition:
|
|
22
|
+
return CartesianPosition.default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@pytest.fixture
|
|
26
|
+
def cartesian_velocity() -> CartesianVelocity:
|
|
27
|
+
return CartesianVelocity.default()
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@pytest.fixture
|
|
31
|
+
def coordinate_subsets(
|
|
32
|
+
cartesian_position: CartesianPosition, cartesian_velocity: CartesianVelocity
|
|
33
|
+
) -> list[CoordinateSubset]:
|
|
34
|
+
return [cartesian_position, cartesian_velocity]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@pytest.fixture
|
|
38
|
+
def instant() -> Instant:
|
|
39
|
+
return Instant.J2000()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@pytest.fixture
|
|
43
|
+
def frame() -> Frame:
|
|
44
|
+
return Frame.GCRF()
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@pytest.fixture
|
|
48
|
+
def coordinate_broker(
|
|
49
|
+
coordinate_subsets: list[CoordinateSubset],
|
|
50
|
+
) -> CoordinateBroker:
|
|
51
|
+
return CoordinateBroker(coordinate_subsets)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@pytest.fixture
|
|
55
|
+
def coordinates() -> list[float]:
|
|
56
|
+
return [7000000.0, 0.0, 0.0, 0.0, 5335.865450622126, 5335.865450622126]
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@pytest.fixture
|
|
60
|
+
def another_coordinates() -> list[float]:
|
|
61
|
+
return [0.0, 7000000.0, 0.0, 5335.865450622126, 0.0, 0.0]
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class TestCartesianVelocity:
|
|
65
|
+
def test_constructor(self, name: str):
|
|
66
|
+
assert CartesianVelocity(CartesianPosition.default(), name) is not None
|
|
67
|
+
|
|
68
|
+
def test_add(
|
|
69
|
+
self,
|
|
70
|
+
cartesian_velocity: CartesianVelocity,
|
|
71
|
+
instant: Instant,
|
|
72
|
+
frame: Frame,
|
|
73
|
+
coordinates: list[float],
|
|
74
|
+
another_coordinates: list[float],
|
|
75
|
+
coordinate_broker: CoordinateBroker,
|
|
76
|
+
):
|
|
77
|
+
assert all(
|
|
78
|
+
cartesian_velocity.add(
|
|
79
|
+
instant, coordinates, another_coordinates, frame, coordinate_broker
|
|
80
|
+
)
|
|
81
|
+
== [5335.865450622126, 5335.865450622126, 5335.865450622126]
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
def test_subtract(
|
|
85
|
+
self,
|
|
86
|
+
cartesian_velocity: CartesianVelocity,
|
|
87
|
+
instant: Instant,
|
|
88
|
+
frame: Frame,
|
|
89
|
+
coordinates: list[float],
|
|
90
|
+
another_coordinates: list[float],
|
|
91
|
+
coordinate_broker: CoordinateBroker,
|
|
92
|
+
):
|
|
93
|
+
assert all(
|
|
94
|
+
cartesian_velocity.subtract(
|
|
95
|
+
instant, coordinates, another_coordinates, frame, coordinate_broker
|
|
96
|
+
)
|
|
97
|
+
== [-5335.865450622126, 5335.865450622126, 5335.865450622126]
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
def test_in_frame(
|
|
101
|
+
self,
|
|
102
|
+
cartesian_velocity: CartesianVelocity,
|
|
103
|
+
instant: Instant,
|
|
104
|
+
frame: Frame,
|
|
105
|
+
coordinates: list[float],
|
|
106
|
+
another_coordinates: list[float],
|
|
107
|
+
coordinate_broker: CoordinateBroker,
|
|
108
|
+
):
|
|
109
|
+
for value, expected in zip(
|
|
110
|
+
cartesian_velocity.in_frame(
|
|
111
|
+
instant, coordinates, frame, Frame.ITRF(), coordinate_broker
|
|
112
|
+
),
|
|
113
|
+
[-4749.36551256577, 854.163395375881, 5335.71857543495],
|
|
114
|
+
):
|
|
115
|
+
assert value == pytest.approx(expected, rel=1e-14)
|
|
@@ -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,58 @@
|
|
|
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_hash(self, coordinate_subset: CoordinateSubset):
|
|
34
|
+
assert hash(coordinate_subset) is not None
|
|
35
|
+
|
|
36
|
+
def test_get_id(self, coordinate_subset: CoordinateSubset):
|
|
37
|
+
assert coordinate_subset.get_id() is not None
|
|
38
|
+
|
|
39
|
+
def test_get_name(self, coordinate_subset: CoordinateSubset, name: str):
|
|
40
|
+
assert coordinate_subset.get_name() == name
|
|
41
|
+
|
|
42
|
+
def test_get_size(self, coordinate_subset: CoordinateSubset, size: int):
|
|
43
|
+
assert coordinate_subset.get_size() == size
|
|
44
|
+
|
|
45
|
+
def test_mass(self):
|
|
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
|
|
56
|
+
|
|
57
|
+
def test_ballistic_coefficient(self):
|
|
58
|
+
assert CoordinateSubset.ballistic_coefficient() is not None
|