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,120 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from ostk.physics.coordinate import Frame, Position, Velocity
|
|
6
|
+
from ostk.physics.time import DateTime, Instant, Scale
|
|
7
|
+
|
|
8
|
+
from ostk.astrodynamics.event_condition import RealCondition, LogicalCondition
|
|
9
|
+
from ostk.astrodynamics.trajectory import State
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@pytest.fixture
|
|
13
|
+
def always_true() -> RealCondition:
|
|
14
|
+
return RealCondition(
|
|
15
|
+
"Always True Condition",
|
|
16
|
+
RealCondition.Criterion.StrictlyPositive,
|
|
17
|
+
lambda state: 1.0,
|
|
18
|
+
0.0,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@pytest.fixture
|
|
23
|
+
def always_false() -> RealCondition:
|
|
24
|
+
return RealCondition(
|
|
25
|
+
"Always False Condition",
|
|
26
|
+
RealCondition.Criterion.StrictlyPositive,
|
|
27
|
+
lambda state: -1.0,
|
|
28
|
+
0.0,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@pytest.fixture
|
|
33
|
+
def event_conditions(
|
|
34
|
+
always_true: RealCondition, always_false: RealCondition
|
|
35
|
+
) -> list[RealCondition]:
|
|
36
|
+
return [always_true, always_false]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@pytest.fixture
|
|
40
|
+
def logical_condition_type() -> LogicalCondition.Type:
|
|
41
|
+
return LogicalCondition.Type.And
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@pytest.fixture
|
|
45
|
+
def state() -> State:
|
|
46
|
+
frame: Frame = Frame.GCRF()
|
|
47
|
+
position: Position = Position.meters(
|
|
48
|
+
[717094.039086306, -6872433.2241124, 46175.9696673281], frame
|
|
49
|
+
)
|
|
50
|
+
velocity: Velocity = Velocity.meters_per_second(
|
|
51
|
+
[-970.650826004612, -45.4598114773158, 7529.82424886455], frame
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
instant: Instant = Instant.date_time(DateTime(2023, 1, 1, 0, 1, 0), Scale.UTC)
|
|
55
|
+
return State(instant, position, velocity)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@pytest.fixture
|
|
59
|
+
def logical_condition(
|
|
60
|
+
logical_condition_type: LogicalCondition.Type, event_conditions: list[RealCondition]
|
|
61
|
+
) -> LogicalCondition:
|
|
62
|
+
return LogicalCondition("Logical", logical_condition_type, event_conditions)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class TestLogicalCondition:
|
|
66
|
+
@pytest.mark.parametrize(
|
|
67
|
+
"logical_condition_type",
|
|
68
|
+
(
|
|
69
|
+
LogicalCondition.Type.And,
|
|
70
|
+
LogicalCondition.Type.Or,
|
|
71
|
+
),
|
|
72
|
+
)
|
|
73
|
+
def test_constructor(
|
|
74
|
+
self,
|
|
75
|
+
logical_condition_type: LogicalCondition.Type,
|
|
76
|
+
event_conditions: list[RealCondition],
|
|
77
|
+
):
|
|
78
|
+
assert (
|
|
79
|
+
LogicalCondition(
|
|
80
|
+
"Logical Condition", logical_condition_type, event_conditions
|
|
81
|
+
)
|
|
82
|
+
is not None
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
def test_get_event_conditions(
|
|
86
|
+
self,
|
|
87
|
+
logical_condition: LogicalCondition,
|
|
88
|
+
event_conditions: list[RealCondition],
|
|
89
|
+
):
|
|
90
|
+
assert logical_condition.get_event_conditions() == event_conditions
|
|
91
|
+
|
|
92
|
+
def test_get_type(
|
|
93
|
+
self,
|
|
94
|
+
logical_condition: LogicalCondition,
|
|
95
|
+
logical_condition_type: LogicalCondition.Type,
|
|
96
|
+
):
|
|
97
|
+
assert logical_condition.get_type() == logical_condition_type
|
|
98
|
+
|
|
99
|
+
@pytest.mark.parametrize(
|
|
100
|
+
"logical_condition_type,expected_result",
|
|
101
|
+
(
|
|
102
|
+
(LogicalCondition.Type.And, False),
|
|
103
|
+
(LogicalCondition.Type.Or, True),
|
|
104
|
+
),
|
|
105
|
+
)
|
|
106
|
+
def test_is_satisfied(
|
|
107
|
+
self,
|
|
108
|
+
logical_condition_type: LogicalCondition.Type,
|
|
109
|
+
expected_result: bool,
|
|
110
|
+
event_conditions: list[RealCondition],
|
|
111
|
+
state: State,
|
|
112
|
+
):
|
|
113
|
+
logical_condition: LogicalCondition = LogicalCondition(
|
|
114
|
+
"Logical Condition", logical_condition_type, event_conditions
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
assert (
|
|
118
|
+
logical_condition.is_satisfied(previous_state=state, current_state=state)
|
|
119
|
+
== expected_result
|
|
120
|
+
)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from ostk.physics.time import Instant, DateTime, Scale
|
|
6
|
+
from ostk.physics.coordinate import Frame, Position, Velocity
|
|
7
|
+
|
|
8
|
+
from ostk.astrodynamics.trajectory import State
|
|
9
|
+
|
|
10
|
+
from ostk.astrodynamics.event_condition import RealCondition
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@pytest.fixture
|
|
14
|
+
def state() -> State:
|
|
15
|
+
frame: Frame = Frame.GCRF()
|
|
16
|
+
position: Position = Position.meters([7500000.0, 0.0, 0.0], frame)
|
|
17
|
+
velocity: Velocity = Velocity.meters_per_second(
|
|
18
|
+
[0.0, 5335.865450622126, 5335.865450622126], frame
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
instant: Instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
|
22
|
+
return State(instant, position, velocity)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@pytest.fixture
|
|
26
|
+
def evaluator():
|
|
27
|
+
return lambda state: state.get_coordinates()[0]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@pytest.fixture
|
|
31
|
+
def target() -> float:
|
|
32
|
+
return 10.0
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@pytest.fixture
|
|
36
|
+
def event_condition(evaluator, target: float) -> RealCondition:
|
|
37
|
+
return RealCondition(
|
|
38
|
+
"My Condition", RealCondition.Criterion.PositiveCrossing, evaluator, target
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class TestRealCondition:
|
|
43
|
+
def test_evaluate(self, state: State, event_condition: RealCondition):
|
|
44
|
+
assert event_condition.evaluate(state) is not None
|
|
45
|
+
|
|
46
|
+
def test_is_satisfied(self, state: State, event_condition: RealCondition):
|
|
47
|
+
assert (
|
|
48
|
+
event_condition.is_satisfied(previous_state=state, current_state=state)
|
|
49
|
+
is not None
|
|
50
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
from ostk.mathematics.geometry.d3.transformation.rotation import Quaternion
|
|
8
|
+
from ostk.mathematics.curve_fitting import Interpolator
|
|
9
|
+
|
|
10
|
+
from ostk.physics.time import Scale
|
|
11
|
+
from ostk.physics.time import Instant
|
|
12
|
+
from ostk.physics.coordinate import Position
|
|
13
|
+
from ostk.physics.coordinate import Velocity
|
|
14
|
+
from ostk.physics.coordinate import Frame
|
|
15
|
+
|
|
16
|
+
from ostk.astrodynamics.trajectory import State
|
|
17
|
+
from ostk.astrodynamics.flight.profile.model import Tabulated as TabulatedModel
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@pytest.fixture
|
|
21
|
+
def states() -> list[State]:
|
|
22
|
+
return [
|
|
23
|
+
State(
|
|
24
|
+
instant=Instant.date_time(datetime(2020, 1, 1, 0, 0, 0), Scale.UTC),
|
|
25
|
+
position=Position.meters((0.0, 0.0, 0.0), Frame.GCRF()),
|
|
26
|
+
velocity=Velocity.meters_per_second((0.0, 0.0, 0.0), Frame.GCRF()),
|
|
27
|
+
attitude=Quaternion.unit(),
|
|
28
|
+
angular_velocity=(0.0, 0.0, 0.0),
|
|
29
|
+
attitude_frame=Frame.GCRF(),
|
|
30
|
+
),
|
|
31
|
+
State(
|
|
32
|
+
instant=Instant.date_time(datetime(2020, 1, 1, 0, 1, 0), Scale.UTC),
|
|
33
|
+
position=Position.meters((0.0, 0.0, 0.0), Frame.GCRF()),
|
|
34
|
+
velocity=Velocity.meters_per_second((0.0, 0.0, 0.0), Frame.GCRF()),
|
|
35
|
+
attitude=Quaternion.unit(),
|
|
36
|
+
angular_velocity=(0.0, 0.0, 0.0),
|
|
37
|
+
attitude_frame=Frame.GCRF(),
|
|
38
|
+
),
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@pytest.fixture
|
|
43
|
+
def interpolator_type() -> Interpolator.Type:
|
|
44
|
+
return Interpolator.Type.Linear
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@pytest.fixture
|
|
48
|
+
def tabulated_model(
|
|
49
|
+
states: list[State],
|
|
50
|
+
interpolator_type: Interpolator.Type,
|
|
51
|
+
) -> TabulatedModel:
|
|
52
|
+
return TabulatedModel(
|
|
53
|
+
states=states,
|
|
54
|
+
interpolator_type=interpolator_type,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class TestTabulatedProfile:
|
|
59
|
+
def test_constructors(
|
|
60
|
+
self,
|
|
61
|
+
tabulated_model: TabulatedModel,
|
|
62
|
+
):
|
|
63
|
+
assert tabulated_model is not None
|
|
64
|
+
assert isinstance(tabulated_model, TabulatedModel)
|
|
65
|
+
|
|
66
|
+
def test_is_defined(
|
|
67
|
+
self,
|
|
68
|
+
tabulated_model: TabulatedModel,
|
|
69
|
+
):
|
|
70
|
+
assert tabulated_model.is_defined() is True
|
|
71
|
+
|
|
72
|
+
def test_get_interval(
|
|
73
|
+
self,
|
|
74
|
+
tabulated_model: TabulatedModel,
|
|
75
|
+
):
|
|
76
|
+
interval = tabulated_model.get_interval()
|
|
77
|
+
|
|
78
|
+
assert interval is not None
|
|
79
|
+
|
|
80
|
+
def test_get_interpolator_type(
|
|
81
|
+
self,
|
|
82
|
+
tabulated_model: TabulatedModel,
|
|
83
|
+
):
|
|
84
|
+
interpolator_type = tabulated_model.get_interpolator_type()
|
|
85
|
+
|
|
86
|
+
assert interpolator_type is not None
|
|
87
|
+
|
|
88
|
+
def test_calculate_state_at(
|
|
89
|
+
self,
|
|
90
|
+
tabulated_model: TabulatedModel,
|
|
91
|
+
states: list[State],
|
|
92
|
+
):
|
|
93
|
+
state: State = tabulated_model.calculate_state_at(states[0].get_instant())
|
|
94
|
+
|
|
95
|
+
assert state is not None
|
|
96
|
+
|
|
97
|
+
def test_get_axes_at(
|
|
98
|
+
self,
|
|
99
|
+
tabulated_model: TabulatedModel,
|
|
100
|
+
states: list[State],
|
|
101
|
+
):
|
|
102
|
+
axes = tabulated_model.get_axes_at(states[0].get_instant())
|
|
103
|
+
|
|
104
|
+
assert axes is not None
|
|
105
|
+
|
|
106
|
+
def test_construct_body_frame(
|
|
107
|
+
self,
|
|
108
|
+
tabulated_model: TabulatedModel,
|
|
109
|
+
):
|
|
110
|
+
if Frame.exists("test"):
|
|
111
|
+
Frame.destruct("test")
|
|
112
|
+
|
|
113
|
+
body_frame = tabulated_model.construct_body_frame("test")
|
|
114
|
+
|
|
115
|
+
assert body_frame is not None
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from ostk.physics.unit import Mass
|
|
6
|
+
from ostk.astrodynamics.flight.system import PropulsionSystem
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@pytest.fixture
|
|
10
|
+
def propulsion_system() -> PropulsionSystem:
|
|
11
|
+
return PropulsionSystem(
|
|
12
|
+
1.0,
|
|
13
|
+
150.0,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@pytest.fixture
|
|
18
|
+
def mass() -> Mass:
|
|
19
|
+
return Mass(90.0, Mass.Unit.Kilogram)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class TestPropulsionSystem:
|
|
23
|
+
def test_constructors(
|
|
24
|
+
self,
|
|
25
|
+
propulsion_system: PropulsionSystem,
|
|
26
|
+
):
|
|
27
|
+
assert propulsion_system is not None
|
|
28
|
+
assert isinstance(propulsion_system, PropulsionSystem)
|
|
29
|
+
assert propulsion_system.is_defined()
|
|
30
|
+
|
|
31
|
+
def test_comparators(
|
|
32
|
+
self,
|
|
33
|
+
propulsion_system: PropulsionSystem,
|
|
34
|
+
):
|
|
35
|
+
assert (propulsion_system == propulsion_system) is True
|
|
36
|
+
assert (propulsion_system != propulsion_system) is False
|
|
37
|
+
|
|
38
|
+
def test_is_defined(
|
|
39
|
+
self,
|
|
40
|
+
propulsion_system: PropulsionSystem,
|
|
41
|
+
):
|
|
42
|
+
assert propulsion_system.is_defined()
|
|
43
|
+
|
|
44
|
+
def test_getters(
|
|
45
|
+
self,
|
|
46
|
+
propulsion_system: PropulsionSystem,
|
|
47
|
+
mass: Mass,
|
|
48
|
+
):
|
|
49
|
+
assert propulsion_system.get_thrust() == 1.0
|
|
50
|
+
assert propulsion_system.get_specific_impulse() == 150.0
|
|
51
|
+
assert propulsion_system.get_mass_flow_rate() is not None
|
|
52
|
+
assert propulsion_system.get_acceleration(mass) is not None
|
|
53
|
+
|
|
54
|
+
def test_static_methods(
|
|
55
|
+
self,
|
|
56
|
+
mass: Mass,
|
|
57
|
+
):
|
|
58
|
+
assert PropulsionSystem.undefined().is_defined() is False
|
|
59
|
+
|
|
60
|
+
assert PropulsionSystem.default().is_defined() is True
|
|
61
|
+
assert PropulsionSystem.default().get_thrust() is not None
|
|
62
|
+
assert PropulsionSystem.default().get_specific_impulse() is not None
|
|
63
|
+
assert PropulsionSystem.default().get_mass_flow_rate() is not None
|
|
64
|
+
assert PropulsionSystem.default().get_acceleration(mass) is not None
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
|
|
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
|
+
from ostk.physics.unit import Mass
|
|
11
|
+
from ostk.astrodynamics.flight.system import SatelliteSystem
|
|
12
|
+
from ostk.astrodynamics.flight.system import PropulsionSystem
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@pytest.fixture
|
|
16
|
+
def satellite_system_default_inputs():
|
|
17
|
+
mass = Mass(90.0, Mass.Unit.Kilogram)
|
|
18
|
+
satellite_geometry = Composite(
|
|
19
|
+
Cuboid(
|
|
20
|
+
Point(0.0, 0.0, 0.0),
|
|
21
|
+
[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]],
|
|
22
|
+
[1.0, 0.0, 0.0],
|
|
23
|
+
)
|
|
24
|
+
)
|
|
25
|
+
inertia_tensor = np.ndarray(shape=(3, 3))
|
|
26
|
+
surface_area = 0.8
|
|
27
|
+
drag_coefficient = 2.2
|
|
28
|
+
propulsion_system = PropulsionSystem(
|
|
29
|
+
1.0,
|
|
30
|
+
150.0,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
mass,
|
|
35
|
+
satellite_geometry,
|
|
36
|
+
inertia_tensor,
|
|
37
|
+
surface_area,
|
|
38
|
+
drag_coefficient,
|
|
39
|
+
propulsion_system,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@pytest.fixture
|
|
44
|
+
def satellite_system(satellite_system_default_inputs) -> SatelliteSystem:
|
|
45
|
+
return SatelliteSystem(*satellite_system_default_inputs)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class TestSatelliteSystem:
|
|
49
|
+
def test_constructors(
|
|
50
|
+
self,
|
|
51
|
+
satellite_system: SatelliteSystem,
|
|
52
|
+
):
|
|
53
|
+
assert satellite_system is not None
|
|
54
|
+
assert isinstance(satellite_system, SatelliteSystem)
|
|
55
|
+
assert satellite_system.is_defined()
|
|
56
|
+
|
|
57
|
+
def test_comparators(
|
|
58
|
+
self,
|
|
59
|
+
satellite_system: SatelliteSystem,
|
|
60
|
+
):
|
|
61
|
+
assert (satellite_system == satellite_system) is True
|
|
62
|
+
assert (satellite_system != satellite_system) is False
|
|
63
|
+
|
|
64
|
+
def test_getters(
|
|
65
|
+
self,
|
|
66
|
+
satellite_system_default_inputs,
|
|
67
|
+
satellite_system: SatelliteSystem,
|
|
68
|
+
):
|
|
69
|
+
(
|
|
70
|
+
mass,
|
|
71
|
+
satellite_geometry,
|
|
72
|
+
inertia_tensor,
|
|
73
|
+
surface_area,
|
|
74
|
+
drag_coefficient,
|
|
75
|
+
propulsion_system,
|
|
76
|
+
) = satellite_system_default_inputs
|
|
77
|
+
|
|
78
|
+
assert satellite_system.get_mass() == mass
|
|
79
|
+
assert satellite_system.get_geometry() == satellite_geometry
|
|
80
|
+
assert np.array_equal(satellite_system.get_inertia_tensor(), inertia_tensor)
|
|
81
|
+
assert satellite_system.get_cross_sectional_surface_area() == surface_area
|
|
82
|
+
assert satellite_system.get_drag_coefficient() == drag_coefficient
|
|
83
|
+
assert satellite_system.get_propulsion_system() == propulsion_system
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Apache License 2.0
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
|
|
7
|
+
import ostk.mathematics as mathematics
|
|
8
|
+
|
|
9
|
+
import ostk.physics as physics
|
|
10
|
+
|
|
11
|
+
import ostk.astrodynamics as astrodynamics
|
|
12
|
+
|
|
13
|
+
Cuboid = mathematics.geometry.d3.object.Cuboid
|
|
14
|
+
Composite = mathematics.geometry.d3.object.Composite
|
|
15
|
+
Point = mathematics.geometry.d3.object.Point
|
|
16
|
+
|
|
17
|
+
Mass = physics.unit.Mass
|
|
18
|
+
|
|
19
|
+
SatelliteSystem = astrodynamics.flight.system.SatelliteSystem
|
|
20
|
+
SatelliteSystemBuilder = astrodynamics.flight.system.SatelliteSystemBuilder
|
|
21
|
+
PropulsionSystem = astrodynamics.flight.system.PropulsionSystem
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class TestSatelliteSystemBuilder:
|
|
25
|
+
def test_constructors(self):
|
|
26
|
+
builder: SatelliteSystemBuilder = SatelliteSystemBuilder()
|
|
27
|
+
assert builder is not None
|
|
28
|
+
assert isinstance(builder, SatelliteSystemBuilder)
|
|
29
|
+
|
|
30
|
+
default_builder: SatelliteSystemBuilder = SatelliteSystemBuilder.default()
|
|
31
|
+
assert default_builder is not None
|
|
32
|
+
assert isinstance(default_builder, SatelliteSystemBuilder)
|
|
33
|
+
|
|
34
|
+
def test_build(self):
|
|
35
|
+
dry_mass = Mass(90.0, Mass.Unit.Kilogram)
|
|
36
|
+
geometry = Composite(
|
|
37
|
+
Cuboid(
|
|
38
|
+
Point(0.0, 0.0, 0.0),
|
|
39
|
+
[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]],
|
|
40
|
+
[1.0, 0.0, 0.0],
|
|
41
|
+
)
|
|
42
|
+
)
|
|
43
|
+
inertia_tensor = np.ndarray(shape=(3, 3))
|
|
44
|
+
cross_sectional_surface_area = 0.8
|
|
45
|
+
drag_coefficient = 2.2
|
|
46
|
+
propulsion_system = PropulsionSystem(
|
|
47
|
+
1.0,
|
|
48
|
+
150.0,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
builder: SatelliteSystemBuilder = (
|
|
52
|
+
SatelliteSystemBuilder()
|
|
53
|
+
.with_dry_mass(dry_mass)
|
|
54
|
+
.with_geometry(geometry)
|
|
55
|
+
.with_inertia_tensor(inertia_tensor)
|
|
56
|
+
.with_cross_sectional_surface_area(cross_sectional_surface_area)
|
|
57
|
+
.with_drag_coefficient(drag_coefficient)
|
|
58
|
+
.with_propulsion_system(propulsion_system)
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
satellite_system: SatelliteSystem = builder.build()
|
|
62
|
+
|
|
63
|
+
assert satellite_system.get_mass() == dry_mass
|
|
64
|
+
assert satellite_system.get_geometry() == geometry
|
|
65
|
+
assert np.array_equal(satellite_system.get_inertia_tensor(), inertia_tensor)
|
|
66
|
+
assert (
|
|
67
|
+
satellite_system.get_cross_sectional_surface_area()
|
|
68
|
+
== cross_sectional_surface_area
|
|
69
|
+
)
|
|
70
|
+
assert satellite_system.get_drag_coefficient() == drag_coefficient
|
|
71
|
+
assert satellite_system.get_propulsion_system() == propulsion_system
|