open-space-toolkit-astrodynamics 2.4.1__py311-none-any.whl → 5.0.0__py311-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.
Files changed (77) hide show
  1. {open_space_toolkit_astrodynamics-2.4.1.dist-info → open_space_toolkit_astrodynamics-5.0.0.dist-info}/METADATA +2 -2
  2. open_space_toolkit_astrodynamics-5.0.0.dist-info/RECORD +25 -0
  3. ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-311-x86_64-linux-gnu.so +0 -0
  4. ostk/astrodynamics/__init__.py +6 -0
  5. ostk/astrodynamics/converters.py +1 -1
  6. ostk/astrodynamics/{libopen-space-toolkit-astrodynamics.so.2 → libopen-space-toolkit-astrodynamics.so.5} +0 -0
  7. ostk/astrodynamics/pytrajectory/pystate.py +36 -0
  8. ostk/astrodynamics/test/test_access.py +1 -1
  9. ostk/astrodynamics/test/test_converters.py +1 -1
  10. ostk/astrodynamics/test/test_event_condition.py +27 -2
  11. ostk/astrodynamics/test/test_import.py +2 -2
  12. ostk/astrodynamics/test/test_trajectory.py +1 -1
  13. ostk/astrodynamics/viewer.py +1 -1
  14. open_space_toolkit_astrodynamics-2.4.1.dist-info/RECORD +0 -83
  15. ostk/astrodynamics/test/access/__init__.py +0 -1
  16. ostk/astrodynamics/test/access/test_generator.py +0 -248
  17. ostk/astrodynamics/test/conjunction/messages/ccsds/__init__.py +0 -1
  18. ostk/astrodynamics/test/conjunction/messages/ccsds/conftest.py +0 -325
  19. ostk/astrodynamics/test/conjunction/messages/ccsds/data/cdm.json +0 -303
  20. ostk/astrodynamics/test/conjunction/messages/ccsds/test_cdm.py +0 -416
  21. ostk/astrodynamics/test/event_condition/test_angular_condition.py +0 -113
  22. ostk/astrodynamics/test/event_condition/test_boolean_condition.py +0 -55
  23. ostk/astrodynamics/test/event_condition/test_coe_condition.py +0 -91
  24. ostk/astrodynamics/test/event_condition/test_instant_condition.py +0 -48
  25. ostk/astrodynamics/test/event_condition/test_logical_condition.py +0 -120
  26. ostk/astrodynamics/test/event_condition/test_real_condition.py +0 -53
  27. ostk/astrodynamics/test/flight/__init__.py +0 -1
  28. ostk/astrodynamics/test/flight/profile/__init__.py +0 -1
  29. ostk/astrodynamics/test/flight/profile/test_state.py +0 -144
  30. ostk/astrodynamics/test/flight/system/__init__.py +0 -1
  31. ostk/astrodynamics/test/flight/system/dynamics/__init__.py +0 -1
  32. ostk/astrodynamics/test/flight/system/dynamics/test_atmospheric_drag.py +0 -128
  33. ostk/astrodynamics/test/flight/system/dynamics/test_central_body_gravity.py +0 -58
  34. ostk/astrodynamics/test/flight/system/dynamics/test_dynamics.py +0 -37
  35. ostk/astrodynamics/test/flight/system/dynamics/test_position_derivative.py +0 -51
  36. ostk/astrodynamics/test/flight/system/dynamics/test_third_body_gravity.py +0 -67
  37. ostk/astrodynamics/test/flight/system/dynamics/thruster/test_constant_thrust.py +0 -143
  38. ostk/astrodynamics/test/flight/system/test_propulsion_system.py +0 -46
  39. ostk/astrodynamics/test/flight/system/test_satellite_system.py +0 -77
  40. ostk/astrodynamics/test/flight/test_profile.py +0 -153
  41. ostk/astrodynamics/test/flight/test_system.py +0 -55
  42. ostk/astrodynamics/test/solvers/__init__.py +0 -1
  43. ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +0 -153
  44. ostk/astrodynamics/test/trajectory/__init__.py +0 -1
  45. ostk/astrodynamics/test/trajectory/orbit/__init__.py +0 -1
  46. ostk/astrodynamics/test/trajectory/orbit/messages/__init__.py +0 -1
  47. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/__init__.py +0 -1
  48. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/conftest.py +0 -18
  49. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/data/opm_1.yaml +0 -44
  50. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/test_opm.py +0 -108
  51. ostk/astrodynamics/test/trajectory/orbit/models/__init__.py +0 -1
  52. ostk/astrodynamics/test/trajectory/orbit/models/kepler/__init__.py +0 -1
  53. ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +0 -112
  54. ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +0 -1
  55. ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +0 -331
  56. ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +0 -130
  57. ostk/astrodynamics/test/trajectory/orbit/models/test_propagated.py +0 -195
  58. ostk/astrodynamics/test/trajectory/orbit/models/test_sgp4.py +0 -1
  59. ostk/astrodynamics/test/trajectory/orbit/models/test_tabulated.py +0 -380
  60. ostk/astrodynamics/test/trajectory/orbit/test_model.py +0 -1
  61. ostk/astrodynamics/test/trajectory/orbit/test_pass.py +0 -55
  62. ostk/astrodynamics/test/trajectory/state/coordinates_subset/test_cartesian_position.py +0 -103
  63. ostk/astrodynamics/test/trajectory/state/coordinates_subset/test_cartesian_velocity.py +0 -113
  64. ostk/astrodynamics/test/trajectory/state/test_coordinates_broker.py +0 -71
  65. ostk/astrodynamics/test/trajectory/state/test_coordinates_subset.py +0 -43
  66. ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +0 -242
  67. ostk/astrodynamics/test/trajectory/test_local_orbital_frame_direction.py +0 -82
  68. ostk/astrodynamics/test/trajectory/test_local_orbital_frame_factory.py +0 -64
  69. ostk/astrodynamics/test/trajectory/test_model.py +0 -1
  70. ostk/astrodynamics/test/trajectory/test_orbit.py +0 -92
  71. ostk/astrodynamics/test/trajectory/test_propagator.py +0 -387
  72. ostk/astrodynamics/test/trajectory/test_state.py +0 -134
  73. ostk/astrodynamics/test/trajectory/test_trajectory_segment.py +0 -136
  74. {open_space_toolkit_astrodynamics-2.4.1.dist-info → open_space_toolkit_astrodynamics-5.0.0.dist-info}/WHEEL +0 -0
  75. {open_space_toolkit_astrodynamics-2.4.1.dist-info → open_space_toolkit_astrodynamics-5.0.0.dist-info}/top_level.txt +0 -0
  76. {open_space_toolkit_astrodynamics-2.4.1.dist-info → open_space_toolkit_astrodynamics-5.0.0.dist-info}/zip-safe +0 -0
  77. /ostk/{__init__.py → astrodynamics/pytrajectory/__init__.py} +0 -0
@@ -1,48 +0,0 @@
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 InstantCondition
9
- from ostk.astrodynamics.trajectory import State
10
-
11
-
12
- @pytest.fixture
13
- def instant() -> Instant:
14
- return Instant.date_time(DateTime(2023, 1, 1, 0, 0, 0), Scale.UTC)
15
-
16
-
17
- @pytest.fixture
18
- def criterion() -> InstantCondition.Criterion:
19
- return InstantCondition.Criterion.StrictlyPositive
20
-
21
-
22
- @pytest.fixture
23
- def instant_condition(
24
- criterion: InstantCondition.Criterion, instant: Instant
25
- ) -> InstantCondition:
26
- return InstantCondition(criterion, instant)
27
-
28
-
29
- @pytest.fixture
30
- def state() -> State:
31
- frame: Frame = Frame.GCRF()
32
- position: Position = Position.meters(
33
- [717094.039086306, -6872433.2241124, 46175.9696673281], frame
34
- )
35
- velocity: Velocity = Velocity.meters_per_second(
36
- [-970.650826004612, -45.4598114773158, 7529.82424886455], frame
37
- )
38
-
39
- instant: Instant = Instant.date_time(DateTime(2023, 1, 1, 0, 1, 0), Scale.UTC)
40
- return State(instant, position, velocity)
41
-
42
-
43
- class TestInstantCondition:
44
- def test_get_instant(self, instant_condition: InstantCondition, instant: Instant):
45
- assert instant_condition.get_instant() == instant
46
-
47
- def test_evaluate(self, instant_condition: InstantCondition, state: State):
48
- assert instant_condition.evaluate(state) == 60.0
@@ -1,120 +0,0 @@
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
- )
@@ -1,53 +0,0 @@
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_get_target(self, event_condition: RealCondition, target: float):
44
- assert event_condition.get_target() == target
45
-
46
- def test_evaluate(self, state: State, event_condition: RealCondition):
47
- assert event_condition.evaluate(state) is not None
48
-
49
- def test_is_satisfied(self, state: State, event_condition: RealCondition):
50
- assert (
51
- event_condition.is_satisfied(previous_state=state, current_state=state)
52
- is not None
53
- )
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1,144 +0,0 @@
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
- Quaternion = mathematics.geometry.d3.transformations.rotations.Quaternion
14
- DateTime = physics.time.DateTime
15
- Instant = physics.time.Instant
16
- Scale = physics.time.Scale
17
- Position = physics.coordinate.Position
18
- Velocity = physics.coordinate.Velocity
19
- Frame = physics.coordinate.Frame
20
- State = astrodynamics.flight.profile.State
21
-
22
-
23
- @pytest.fixture
24
- def instant() -> Instant:
25
- return Instant.date_time(DateTime(2020, 1, 3, 0, 0, 0), Scale.UTC)
26
-
27
-
28
- @pytest.fixture
29
- def frame() -> Frame:
30
- return Frame.GCRF()
31
-
32
-
33
- @pytest.fixture
34
- def position(frame: Frame) -> Position:
35
- return Position.meters([0.0, 3.2, 3000.0], frame)
36
-
37
-
38
- @pytest.fixture
39
- def velocity(frame: Frame) -> Velocity:
40
- return Velocity.meters_per_second([1.0, 3.0, 0.0], frame)
41
-
42
-
43
- @pytest.fixture
44
- def quaternion() -> Quaternion:
45
- return Quaternion([0.0, 0.0, 0.0, 1.0], Quaternion.Format.XYZS)
46
-
47
-
48
- @pytest.fixture
49
- def angular_velocity() -> np.array:
50
- return np.array((0.01, 0.01, 0.0))
51
-
52
-
53
- @pytest.fixture
54
- def state(
55
- instant: Instant,
56
- position: Position,
57
- velocity: Velocity,
58
- quaternion: Quaternion,
59
- angular_velocity: np.array,
60
- frame: Frame,
61
- ) -> State:
62
- return State(
63
- instant,
64
- position,
65
- velocity,
66
- quaternion,
67
- angular_velocity,
68
- frame,
69
- )
70
-
71
-
72
- class TestState:
73
- def test_constructors_list(
74
- self, instant: Instant, quaternion: Quaternion, frame: Frame
75
- ):
76
- position = Position.meters([0.0, 3.2, 3000.0], frame)
77
- velocity = Velocity.meters_per_second([1.0, 3.0, 0.0], frame)
78
- angular_velocity = [0.01, 0.01, 0.0]
79
-
80
- assert isinstance(
81
- State(instant, position, velocity, quaternion, angular_velocity, frame),
82
- State,
83
- )
84
-
85
- def test_constructors_tuples(
86
- self, instant: Instant, quaternion: Quaternion, frame: Frame
87
- ):
88
- position = Position.meters((0.0, 3.2, 3000.0), frame)
89
- velocity = Velocity.meters_per_second((1.0, 3.0, 0.0), frame)
90
- angular_velocity = (0.01, 0.01, 0.0)
91
-
92
- assert isinstance(
93
- State(instant, position, velocity, quaternion, angular_velocity, frame),
94
- State,
95
- )
96
-
97
- def test_constructors_array(
98
- self, instant: Instant, quaternion: Quaternion, frame: Frame
99
- ):
100
- position = Position.meters(np.array((0.0, 3.2, 3000.0)), Frame.GCRF())
101
- velocity = Velocity.meters_per_second(np.array((1.0, 3.0, 0.0)), Frame.GCRF())
102
- angular_velocity = np.array((0.01, 0.01, 0.0))
103
-
104
- assert isinstance(
105
- State(instant, position, velocity, quaternion, angular_velocity, frame),
106
- State,
107
- )
108
-
109
- def test_comparators(self, state: State):
110
- assert (state == state) is True
111
- assert (state != state) is False
112
-
113
- def test_get_instant(self, instant: Instant, state: State):
114
- assert isinstance(state.get_instant(), Instant)
115
- assert state.get_instant() == instant
116
-
117
- def test_get_position(self, position: Position, state: State):
118
- assert isinstance(state.get_position(), Position)
119
- assert state.get_position() == position
120
-
121
- def test_get_velocity(self, velocity: Velocity, state: State):
122
- assert isinstance(state.get_velocity(), Velocity)
123
- assert state.get_velocity() == velocity
124
-
125
- def test_get_attitude(self, quaternion: Quaternion, state: State):
126
- assert isinstance(state.get_attitude(), Quaternion)
127
- assert state.get_attitude() == quaternion
128
-
129
- def test_get_angular_velocity(self, angular_velocity: np.array, state: State):
130
- assert isinstance(state.get_angular_velocity(), np.ndarray)
131
- assert np.array_equal(state.get_angular_velocity(), angular_velocity)
132
-
133
- def test_get_frame(self, frame: Frame, state: State):
134
- assert isinstance(state.get_frame(), Frame)
135
- assert state.get_frame() == frame
136
-
137
- def test_in_frame(self, frame: Frame, state: State):
138
- assert isinstance(state.in_frame(frame), State)
139
-
140
- def test_undefined(self):
141
- state: State = State.undefined()
142
-
143
- assert isinstance(state, State)
144
- assert state.is_defined() is False
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1,128 +0,0 @@
1
- # Apache License 2.0
2
-
3
- import pytest
4
-
5
- import numpy as np
6
-
7
- from ostk.mathematics.geometry.d3.objects import Cuboid
8
- from ostk.mathematics.geometry.d3.objects import Composite
9
- from ostk.mathematics.geometry.d3.objects import Point
10
-
11
- from ostk.physics.units import Mass
12
- from ostk.physics.time import Instant
13
- from ostk.physics.time import DateTime
14
- from ostk.physics.time import Scale
15
- from ostk.physics.coordinate import Position
16
- from ostk.physics.coordinate import Velocity
17
- from ostk.physics.coordinate import Frame
18
- from ostk.physics.environment.atmospheric import Earth as EarthAtmosphericModel
19
- from ostk.physics.environment.gravitational import Earth as EarthGravitationalModel
20
- from ostk.physics.environment.magnetic import Earth as EarthMagneticModel
21
- from ostk.physics.environment.objects.celestial_bodies import Earth
22
-
23
- from ostk.astrodynamics.trajectory.state import CoordinatesSubset
24
- from ostk.astrodynamics.trajectory.state.coordinates_subset import CartesianPosition
25
- from ostk.astrodynamics.trajectory.state.coordinates_subset import CartesianVelocity
26
- from ostk.astrodynamics.trajectory.state import CoordinatesBroker
27
-
28
- from ostk.astrodynamics.trajectory import State
29
- from ostk.astrodynamics.trajectory.state import CoordinatesSubset, CoordinatesBroker
30
- from ostk.astrodynamics.trajectory.state.coordinates_subset import (
31
- CartesianPosition,
32
- CartesianVelocity,
33
- )
34
- from ostk.astrodynamics.flight.system import Dynamics
35
- from ostk.astrodynamics.flight.system.dynamics import AtmosphericDrag
36
-
37
-
38
- @pytest.fixture
39
- def earth() -> Earth:
40
- return Earth.from_models(
41
- EarthGravitationalModel(EarthGravitationalModel.Type.Undefined),
42
- EarthMagneticModel(EarthMagneticModel.Type.Undefined),
43
- EarthAtmosphericModel(EarthAtmosphericModel.Type.Exponential),
44
- )
45
-
46
-
47
- @pytest.fixture
48
- def dry_mass() -> float:
49
- return 100.0
50
-
51
-
52
- @pytest.fixture
53
- def surface_area() -> float:
54
- return 500.0
55
-
56
-
57
- @pytest.fixture
58
- def drag_coefficient() -> float:
59
- return 2.1
60
-
61
-
62
- @pytest.fixture
63
- def dynamics(earth: Earth) -> AtmosphericDrag:
64
- return AtmosphericDrag(earth)
65
-
66
-
67
- @pytest.fixture
68
- def coordinates_broker() -> CoordinatesBroker:
69
- return CoordinatesBroker(
70
- [
71
- CartesianPosition.default(),
72
- CartesianVelocity.default(),
73
- CoordinatesSubset.mass(),
74
- CoordinatesSubset.surface_area(),
75
- CoordinatesSubset.drag_coefficient(),
76
- ]
77
- )
78
-
79
-
80
- @pytest.fixture
81
- def instant() -> Instant:
82
- return Instant.date_time(DateTime(2021, 3, 20, 12, 0, 0), Scale.UTC)
83
-
84
-
85
- @pytest.fixture
86
- def position_coordinates() -> list:
87
- return [7000000.0, 0.0, 0.0]
88
-
89
-
90
- @pytest.fixture
91
- def velocity_coordinates() -> list:
92
- return [0.0, 7546.05329, 0.0]
93
-
94
-
95
- @pytest.fixture
96
- def state(
97
- instant: Instant,
98
- position_coordinates: list,
99
- velocity_coordinates: list,
100
- dry_mass: float,
101
- surface_area: float,
102
- drag_coefficient: float,
103
- coordinates_broker: CoordinatesBroker,
104
- ) -> State:
105
- coordinates = (
106
- position_coordinates
107
- + velocity_coordinates
108
- + [dry_mass, surface_area, drag_coefficient]
109
- )
110
- return State(instant, coordinates, Frame.GCRF(), coordinates_broker)
111
-
112
-
113
- class TestAtmosphericDrag:
114
- def test_constructors(self, dynamics: AtmosphericDrag):
115
- assert dynamics is not None
116
- assert isinstance(dynamics, AtmosphericDrag)
117
- assert isinstance(dynamics, Dynamics)
118
- assert dynamics.is_defined()
119
-
120
- def test_getters(self, dynamics: AtmosphericDrag, earth: Earth):
121
- assert dynamics.get_celestial() == earth
122
-
123
- def test_compute_contribution(self, dynamics: AtmosphericDrag, state: State):
124
- contribution = dynamics.compute_contribution(
125
- state.get_instant(), state.get_coordinates(), state.get_frame()
126
- )
127
-
128
- assert len(contribution) == 3
@@ -1,58 +0,0 @@
1
- # Apache License 2.0
2
-
3
- import pytest
4
-
5
- import numpy as np
6
-
7
- from ostk.physics.time import Instant
8
- from ostk.physics.time import DateTime
9
- from ostk.physics.time import Scale
10
- from ostk.physics.coordinate import Position
11
- from ostk.physics.coordinate import Velocity
12
- from ostk.physics.coordinate import Frame
13
- from ostk.physics.environment.objects.celestial_bodies import Earth
14
-
15
- from ostk.astrodynamics.trajectory import State
16
- from ostk.astrodynamics.flight.system import Dynamics
17
- from ostk.astrodynamics.flight.system.dynamics import CentralBodyGravity
18
-
19
-
20
- @pytest.fixture
21
- def earth() -> Earth:
22
- return Earth.spherical()
23
-
24
-
25
- @pytest.fixture
26
- def dynamics(earth: Earth) -> CentralBodyGravity:
27
- return CentralBodyGravity(earth)
28
-
29
-
30
- @pytest.fixture
31
- def state() -> State:
32
- frame: Frame = Frame.GCRF()
33
- position: Position = Position.meters([7000000.0, 0.0, 0.0], frame)
34
- velocity: Velocity = Velocity.meters_per_second([0.0, 0.0, 0.0], frame)
35
- instant = Instant.date_time(DateTime(2021, 3, 20, 12, 0, 0), Scale.UTC)
36
- return State(instant, position, velocity)
37
-
38
-
39
- class TestCentralBodyGravity:
40
- def test_constructors(
41
- self,
42
- dynamics: CentralBodyGravity,
43
- ):
44
- assert dynamics is not None
45
- assert isinstance(dynamics, CentralBodyGravity)
46
- assert isinstance(dynamics, Dynamics)
47
- assert dynamics.is_defined()
48
-
49
- def test_getters(self, dynamics: CentralBodyGravity, earth: Earth):
50
- assert dynamics.get_celestial() == earth
51
-
52
- def test_compute_contribution(self, dynamics: CentralBodyGravity, state: State):
53
- contribution = dynamics.compute_contribution(
54
- state.get_instant(), state.get_coordinates(), state.get_frame()
55
- )
56
-
57
- assert len(contribution) == 3
58
- assert contribution == pytest.approx([-8.134702887755102, 0.0, 0.0])
@@ -1,37 +0,0 @@
1
- # Apache License 2.0
2
-
3
- import pytest
4
-
5
- from ostk.astrodynamics.flight.system import Dynamics
6
- from ostk.astrodynamics.trajectory.state.coordinates_subset import CartesianPosition
7
-
8
-
9
- @pytest.fixture
10
- def name() -> str:
11
- return "MyDynamics"
12
-
13
-
14
- @pytest.fixture
15
- def dynamics(name: str) -> Dynamics:
16
- class MyDynamics(Dynamics):
17
- def is_defined():
18
- return True
19
-
20
- def get_read_coordinates_subsets(self):
21
- return [CartesianPosition.default()]
22
-
23
- def get_write_coordinates_subsets(self):
24
- return [CartesianPosition.default()]
25
-
26
- def compute_contribution(self, instant, state_vector, frame):
27
- return state_vector
28
-
29
- return MyDynamics(name)
30
-
31
-
32
- class TestDynamics:
33
- def test_subclass(self, dynamics: Dynamics):
34
- assert dynamics is not None
35
-
36
- def test_get_name(self, dynamics: Dynamics, name: str):
37
- assert dynamics.get_name() == name
@@ -1,51 +0,0 @@
1
- # Apache License 2.0
2
-
3
- import pytest
4
-
5
- import numpy as np
6
-
7
- from ostk.physics.time import Instant
8
- from ostk.physics.time import DateTime
9
- from ostk.physics.time import Scale
10
- from ostk.physics.coordinate import Position
11
- from ostk.physics.coordinate import Velocity
12
- from ostk.physics.coordinate import Frame
13
- from ostk.physics.environment.objects.celestial_bodies import Earth
14
-
15
- from ostk.astrodynamics.trajectory import State
16
- from ostk.astrodynamics.flight.system import Dynamics
17
- from ostk.astrodynamics.flight.system.dynamics import PositionDerivative
18
-
19
-
20
- @pytest.fixture
21
- def dynamics() -> PositionDerivative:
22
- return PositionDerivative()
23
-
24
-
25
- @pytest.fixture
26
- def state() -> State:
27
- frame: Frame = Frame.GCRF()
28
- position: Position = Position.meters([7500000.0, 0.0, 0.0], frame)
29
- velocity: Velocity = Velocity.meters_per_second(
30
- [0.0, 5335.865450622126, 5335.865450622126], frame
31
- )
32
- instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
33
- return State(instant, position, velocity)
34
-
35
-
36
- class TestPositionDerivative:
37
- def test_constructors(
38
- self,
39
- dynamics: PositionDerivative,
40
- ):
41
- assert dynamics is not None
42
- assert isinstance(dynamics, PositionDerivative)
43
- assert isinstance(dynamics, Dynamics)
44
- assert dynamics.is_defined()
45
-
46
- def test_compute_contribution(self, dynamics: PositionDerivative, state: State):
47
- contribution = dynamics.compute_contribution(
48
- state.get_instant(), state.get_coordinates(), state.get_frame()
49
- )
50
- assert len(contribution) == 3
51
- assert contribution == pytest.approx(state.get_coordinates()[:3])