open-space-toolkit-astrodynamics 1.2.0__py310-none-any.whl → 4.2.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.
Files changed (65) hide show
  1. {open_space_toolkit_astrodynamics-1.2.0.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/METADATA +2 -2
  2. open_space_toolkit_astrodynamics-4.2.0.dist-info/RECORD +25 -0
  3. ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-310-x86_64-linux-gnu.so +0 -0
  4. ostk/astrodynamics/__init__.py +6 -0
  5. ostk/astrodynamics/{libopen-space-toolkit-astrodynamics.so.1 → libopen-space-toolkit-astrodynamics.so.4} +0 -0
  6. ostk/astrodynamics/pytrajectory/pystate.py +36 -0
  7. ostk/astrodynamics/test/test_access.py +2 -6
  8. ostk/astrodynamics/test/test_converters.py +1 -3
  9. ostk/astrodynamics/test/test_event_condition.py +24 -41
  10. ostk/astrodynamics/test/test_import.py +3 -3
  11. ostk/astrodynamics/test/test_viewer.py +1 -2
  12. ostk/astrodynamics/viewer.py +1 -1
  13. open_space_toolkit_astrodynamics-1.2.0.dist-info/RECORD +0 -72
  14. ostk/astrodynamics/test/access/__init__.py +0 -1
  15. ostk/astrodynamics/test/access/test_generator.py +0 -248
  16. ostk/astrodynamics/test/conjunction/messages/ccsds/__init__.py +0 -1
  17. ostk/astrodynamics/test/conjunction/messages/ccsds/conftest.py +0 -325
  18. ostk/astrodynamics/test/conjunction/messages/ccsds/data/cdm.json +0 -303
  19. ostk/astrodynamics/test/conjunction/messages/ccsds/test_cdm.py +0 -418
  20. ostk/astrodynamics/test/event_condition/test_coe_condition.py +0 -95
  21. ostk/astrodynamics/test/event_condition/test_conjunctive.py +0 -64
  22. ostk/astrodynamics/test/event_condition/test_disjunctive.py +0 -63
  23. ostk/astrodynamics/test/event_condition/test_duration_condition.py +0 -36
  24. ostk/astrodynamics/test/event_condition/test_logical_connective.py +0 -37
  25. ostk/astrodynamics/test/flight/__init__.py +0 -1
  26. ostk/astrodynamics/test/flight/profile/__init__.py +0 -1
  27. ostk/astrodynamics/test/flight/profile/test_state.py +0 -144
  28. ostk/astrodynamics/test/flight/system/__init__.py +0 -1
  29. ostk/astrodynamics/test/flight/system/dynamics/__init__.py +0 -1
  30. ostk/astrodynamics/test/flight/system/dynamics/test_atmospheric_drag.py +0 -86
  31. ostk/astrodynamics/test/flight/system/dynamics/test_central_body_gravity.py +0 -57
  32. ostk/astrodynamics/test/flight/system/dynamics/test_position_derivative.py +0 -49
  33. ostk/astrodynamics/test/flight/system/dynamics/test_third_body_gravity.py +0 -65
  34. ostk/astrodynamics/test/flight/system/test_satellite_system.py +0 -77
  35. ostk/astrodynamics/test/flight/test_profile.py +0 -147
  36. ostk/astrodynamics/test/flight/test_system.py +0 -55
  37. ostk/astrodynamics/test/solvers/__init__.py +0 -1
  38. ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +0 -153
  39. ostk/astrodynamics/test/test_numerical_solver.py +0 -248
  40. ostk/astrodynamics/test/trajectory/__init__.py +0 -1
  41. ostk/astrodynamics/test/trajectory/orbit/__init__.py +0 -1
  42. ostk/astrodynamics/test/trajectory/orbit/messages/__init__.py +0 -1
  43. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/__init__.py +0 -1
  44. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/conftest.py +0 -18
  45. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/data/opm_1.yaml +0 -44
  46. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/test_opm.py +0 -108
  47. ostk/astrodynamics/test/trajectory/orbit/models/__init__.py +0 -1
  48. ostk/astrodynamics/test/trajectory/orbit/models/kepler/__init__.py +0 -1
  49. ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +0 -108
  50. ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +0 -1
  51. ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +0 -332
  52. ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +0 -130
  53. ostk/astrodynamics/test/trajectory/orbit/models/test_propagated.py +0 -197
  54. ostk/astrodynamics/test/trajectory/orbit/models/test_sgp4.py +0 -1
  55. ostk/astrodynamics/test/trajectory/orbit/models/test_tabulated.py +0 -383
  56. ostk/astrodynamics/test/trajectory/orbit/test_model.py +0 -1
  57. ostk/astrodynamics/test/trajectory/orbit/test_pass.py +0 -55
  58. ostk/astrodynamics/test/trajectory/test_model.py +0 -1
  59. ostk/astrodynamics/test/trajectory/test_orbit.py +0 -92
  60. ostk/astrodynamics/test/trajectory/test_propagator.py +0 -233
  61. ostk/astrodynamics/test/trajectory/test_state.py +0 -70
  62. {open_space_toolkit_astrodynamics-1.2.0.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/WHEEL +0 -0
  63. {open_space_toolkit_astrodynamics-1.2.0.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/top_level.txt +0 -0
  64. {open_space_toolkit_astrodynamics-1.2.0.dist-info → open_space_toolkit_astrodynamics-4.2.0.dist-info}/zip-safe +0 -0
  65. /ostk/{__init__.py → astrodynamics/pytrajectory/__init__.py} +0 -0
@@ -1,37 +0,0 @@
1
- # Apache License 2.0
2
-
3
- import pytest
4
-
5
- from ostk.astrodynamics import EventCondition
6
- from ostk.astrodynamics.event_condition import LogicalConnective
7
-
8
-
9
- @pytest.fixture
10
- def event_condition() -> EventCondition:
11
- class MyCondition(EventCondition):
12
- def evaluate(self, state_vector, time):
13
- return time
14
-
15
- return MyCondition("My Condition", EventCondition.Criteria.StrictlyNegative)
16
-
17
-
18
- @pytest.fixture
19
- def event_conditions(event_condition: EventCondition) -> list[EventCondition]:
20
- return [event_condition]
21
-
22
-
23
- @pytest.fixture
24
- def logical_connective(event_conditions: list[EventCondition]) -> LogicalConnective:
25
- return LogicalConnective("Logical Conjunctive", event_conditions)
26
-
27
-
28
- class TestLogicalConnective:
29
- def test_constructor(self, event_conditions: list[EventCondition]):
30
- assert LogicalConnective("Logical Conjunctive", event_conditions) is not None
31
-
32
- def test_get_event_conditions(
33
- self,
34
- logical_connective: LogicalConnective,
35
- event_conditions: list[EventCondition],
36
- ):
37
- assert logical_connective.get_event_conditions() == event_conditions
@@ -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,86 +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 import State
24
- from ostk.astrodynamics.flight.system import SatelliteSystem
25
- from ostk.astrodynamics.flight.system import Dynamics
26
- from ostk.astrodynamics.flight.system.dynamics import AtmosphericDrag
27
-
28
-
29
- @pytest.fixture
30
- def earth() -> Earth:
31
- return Earth.from_models(
32
- EarthGravitationalModel(EarthGravitationalModel.Type.Undefined),
33
- EarthMagneticModel(EarthMagneticModel.Type.Undefined),
34
- EarthAtmosphericModel(EarthAtmosphericModel.Type.Exponential),
35
- )
36
-
37
-
38
- @pytest.fixture
39
- def satellite_system() -> SatelliteSystem:
40
- mass = Mass(100.0, Mass.Unit.Kilogram)
41
- satellite_geometry = Composite(
42
- Cuboid(
43
- Point(0.0, 0.0, 0.0),
44
- [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]],
45
- [1.0, 0.0, 0.0],
46
- )
47
- )
48
- inertia_tensor = np.ndarray(shape=(3, 3))
49
- surface_area = 1.0
50
- drag_coefficient = 2.1
51
-
52
- return SatelliteSystem(
53
- mass, satellite_geometry, inertia_tensor, surface_area, drag_coefficient
54
- )
55
-
56
-
57
- @pytest.fixture
58
- def dynamics(earth: Earth, satellite_system: SatelliteSystem) -> AtmosphericDrag:
59
- return AtmosphericDrag(earth, satellite_system)
60
-
61
-
62
- @pytest.fixture
63
- def state() -> State:
64
- frame: Frame = Frame.GCRF()
65
- position: Position = Position.meters([6900000.0, 0.0, 0.0], frame)
66
- velocity: Velocity = Velocity.meters_per_second(
67
- [0.0, 5335.865450622126, 5335.865450622126], frame
68
- )
69
- instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
70
- return State(instant, position, velocity)
71
-
72
-
73
- class TestAtmosphericDrag:
74
- def test_constructors(self, dynamics: AtmosphericDrag):
75
- assert dynamics is not None
76
- assert isinstance(dynamics, AtmosphericDrag)
77
- assert isinstance(dynamics, Dynamics)
78
- assert dynamics.is_defined()
79
-
80
- def test_getters(self, dynamics: AtmosphericDrag, earth: Earth):
81
- assert dynamics.get_celestial() == earth
82
-
83
- def test_apply_contribution(self, dynamics: AtmosphericDrag, state: State):
84
- dxdt: np.ndarray = np.zeros(6)
85
- dynamics.apply_contribution(state.get_coordinates(), dxdt, state.get_instant())
86
- assert True
@@ -1,57 +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.WGS84(20, 0)
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([7500000.0, 0.0, 0.0], frame)
34
- velocity: Velocity = Velocity.meters_per_second(
35
- [0.0, 5335.865450622126, 5335.865450622126], frame
36
- )
37
- instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
38
- return State(instant, position, velocity)
39
-
40
-
41
- class TestCentralBodyGravity:
42
- def test_constructors(
43
- self,
44
- dynamics: CentralBodyGravity,
45
- ):
46
- assert dynamics is not None
47
- assert isinstance(dynamics, CentralBodyGravity)
48
- assert isinstance(dynamics, Dynamics)
49
- assert dynamics.is_defined()
50
-
51
- def test_getters(self, dynamics: CentralBodyGravity, earth: Earth):
52
- assert dynamics.get_celestial() == earth
53
-
54
- def test_apply_contribution(self, dynamics: CentralBodyGravity, state: State):
55
- dxdt: np.ndarray = np.zeros(6)
56
- dynamics.apply_contribution(state.get_coordinates(), dxdt, state.get_instant())
57
- assert True
@@ -1,49 +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_apply_contribution(self, dynamics: PositionDerivative, state: State):
47
- dxdt: np.ndarray = np.zeros(6)
48
- dynamics.apply_contribution(state.get_coordinates(), dxdt, state.get_instant())
49
- assert True
@@ -1,65 +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 Moon
14
-
15
- from ostk.astrodynamics.trajectory import State
16
- from ostk.astrodynamics.flight.system import Dynamics
17
- from ostk.astrodynamics.flight.system.dynamics import ThirdBodyGravity
18
-
19
-
20
- @pytest.fixture
21
- def moon() -> Moon:
22
- return Moon.spherical()
23
-
24
-
25
- @pytest.fixture
26
- def dynamics(moon: Moon) -> ThirdBodyGravity:
27
- return ThirdBodyGravity(moon)
28
-
29
-
30
- @pytest.fixture
31
- def state() -> State:
32
- frame: Frame = Frame.GCRF()
33
- position: Position = Position.meters([7500000.0, 0.0, 0.0], frame)
34
- velocity: Velocity = Velocity.meters_per_second(
35
- [0.0, 5335.865450622126, 5335.865450622126], frame
36
- )
37
- instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
38
- return State(instant, position, velocity)
39
-
40
-
41
- class TestThirdBodyGravity:
42
- def test_constructors(
43
- self,
44
- dynamics: ThirdBodyGravity,
45
- ):
46
- assert dynamics is not None
47
- assert isinstance(dynamics, ThirdBodyGravity)
48
- assert isinstance(dynamics, Dynamics)
49
- assert dynamics.is_defined()
50
-
51
- def test_getters(
52
- self,
53
- dynamics: ThirdBodyGravity,
54
- moon: Moon,
55
- ):
56
- assert dynamics.get_celestial() == moon
57
-
58
- def test_apply_contribution(
59
- self,
60
- dynamics: ThirdBodyGravity,
61
- state: State,
62
- ):
63
- dxdt: np.ndarray = np.zeros(6)
64
- dynamics.apply_contribution(state.get_coordinates(), dxdt, state.get_instant())
65
- assert True
@@ -1,77 +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
- Cuboid = mathematics.geometry.d3.objects.Cuboid
14
- Composite = mathematics.geometry.d3.objects.Composite
15
- Point = mathematics.geometry.d3.objects.Point
16
-
17
- Mass = physics.units.Mass
18
-
19
- SatelliteSystem = astrodynamics.flight.system.SatelliteSystem
20
-
21
-
22
- @pytest.fixture
23
- def satellite_system_default_inputs():
24
- mass = Mass(90.0, Mass.Unit.Kilogram)
25
- satellite_geometry = Composite(
26
- Cuboid(
27
- Point(0.0, 0.0, 0.0),
28
- [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]],
29
- [1.0, 0.0, 0.0],
30
- )
31
- )
32
- inertia_tensor = np.ndarray(shape=(3, 3))
33
- surface_area = 0.8
34
- drag_coefficient = 2.2
35
-
36
- return (mass, satellite_geometry, inertia_tensor, surface_area, drag_coefficient)
37
-
38
-
39
- @pytest.fixture
40
- def satellite_system(satellite_system_default_inputs) -> SatelliteSystem:
41
- return SatelliteSystem(*satellite_system_default_inputs)
42
-
43
-
44
- class TestSatelliteSystem:
45
- def test_constructors(
46
- self,
47
- satellite_system: SatelliteSystem,
48
- ):
49
- assert satellite_system is not None
50
- assert isinstance(satellite_system, SatelliteSystem)
51
- assert satellite_system.is_defined()
52
-
53
- def test_comparators(
54
- self,
55
- satellite_system: SatelliteSystem,
56
- ):
57
- assert (satellite_system == satellite_system) is True
58
- assert (satellite_system != satellite_system) is False
59
-
60
- def test_getters(
61
- self,
62
- satellite_system_default_inputs,
63
- satellite_system: SatelliteSystem,
64
- ):
65
- (
66
- mass,
67
- satellite_geometry,
68
- inertia_tensor,
69
- surface_area,
70
- drag_coefficient,
71
- ) = satellite_system_default_inputs
72
-
73
- assert satellite_system.get_mass() == mass
74
- assert satellite_system.get_geometry() == satellite_geometry
75
- assert np.array_equal(satellite_system.get_inertia_tensor(), inertia_tensor)
76
- assert satellite_system.get_cross_sectional_surface_area() == surface_area
77
- assert satellite_system.get_drag_coefficient() == drag_coefficient
@@ -1,147 +0,0 @@
1
- # Apache License 2.0
2
-
3
- from datetime import datetime
4
-
5
- import pytest
6
-
7
- from ostk.mathematics.geometry.d3.transformations.rotations import Quaternion
8
-
9
- from ostk.physics import Environment
10
- from ostk.physics.time import DateTime
11
- from ostk.physics.time import Time
12
- from ostk.physics.time import Scale
13
- from ostk.physics.time import Instant
14
- from ostk.physics.units import Length
15
- from ostk.physics.coordinate import Transform
16
- from ostk.physics.coordinate import Position
17
- from ostk.physics.coordinate import Velocity
18
- from ostk.physics.coordinate import Frame
19
- from ostk.physics.coordinate import Axes
20
- from ostk.physics.coordinate.frame.providers import Dynamic as DynamicProvider
21
-
22
- from ostk.astrodynamics import Trajectory
23
- from ostk.astrodynamics.trajectory import Orbit
24
- from ostk.astrodynamics.flight import Profile
25
- from ostk.astrodynamics.flight.profile import State
26
- from ostk.astrodynamics.flight.profile.models import Transform as TransformModel
27
- from ostk.astrodynamics.flight.profile.models import Tabulated as TabulatedModel
28
-
29
-
30
- @pytest.fixture
31
- def instant() -> Instant:
32
- return Instant.date_time(DateTime(2020, 1, 3), Scale.UTC)
33
-
34
-
35
- @pytest.fixture
36
- def profile() -> Profile:
37
- def dynamic_provider_generator(instant: Instant):
38
- return Transform.identity(instant)
39
-
40
- return Profile(
41
- model=TransformModel(
42
- dynamic_provider=DynamicProvider(dynamic_provider_generator),
43
- frame=Frame.GCRF(),
44
- ),
45
- )
46
-
47
-
48
- class TestProfile:
49
- def test_constructors(self, profile: Profile):
50
- assert profile is not None
51
- assert isinstance(profile, Profile)
52
-
53
- def test_get_state_at(self, profile: Profile, instant: Instant):
54
- state: State = profile.get_state_at(instant)
55
-
56
- assert state is not None
57
- assert isinstance(state, State)
58
- state.is_defined()
59
-
60
- def test_get_states_at(self, profile: Profile, instant: Instant):
61
- states = profile.get_states_at([instant, instant])
62
-
63
- assert states is not None
64
-
65
- def test_get_axes_at(self, profile: Profile, instant: Instant):
66
- axes = profile.get_axes_at(instant)
67
-
68
- assert axes is not None
69
- assert isinstance(axes, Axes)
70
-
71
- def test_get_body_frame(self, profile: Profile, instant: Instant):
72
- frame = profile.get_body_frame("Name")
73
-
74
- assert frame is not None
75
- assert isinstance(frame, Frame)
76
-
77
- def test_undefined(self):
78
- profile: Profile = Profile.undefined()
79
-
80
- assert profile is not None
81
- assert isinstance(profile, Profile)
82
- assert profile.is_defined() is False
83
-
84
- def test_inertial_pointing(self):
85
- quaternion: Quaternion = Quaternion(
86
- [0.0, 0.0, 0.0, 1.0], Quaternion.Format.XYZS
87
- )
88
-
89
- trajectory: Trajectory = Trajectory.position(
90
- Position.meters((0.0, 0.0, 0.0), Frame.GCRF())
91
- )
92
-
93
- profile: Profile = Profile.inertial_pointing(trajectory, quaternion)
94
-
95
- assert profile is not None
96
- assert isinstance(profile, Profile)
97
- assert profile.is_defined()
98
-
99
- def test_nadir_pointing(self):
100
- environment = Environment.default()
101
-
102
- orbit = Orbit.sun_synchronous(
103
- epoch=Instant.date_time(datetime(2020, 1, 1, 0, 0, 0), Scale.UTC),
104
- altitude=Length.kilometers(500.0),
105
- local_time_at_descending_node=Time(14, 0, 0),
106
- celestial_object=environment.access_celestial_object_with_name("Earth"),
107
- )
108
-
109
- profile: Profile = Profile.nadir_pointing(orbit, Orbit.FrameType.VVLH)
110
-
111
- assert profile is not None
112
- assert isinstance(profile, Profile)
113
- assert profile.is_defined()
114
-
115
- def test_tabulated(self):
116
- profile = Profile(
117
- model=TabulatedModel(
118
- states=[
119
- State(
120
- instant=Instant.date_time(datetime(2020, 1, 1, 0, 0, 0), Scale.UTC),
121
- position=Position.meters((0.0, 0.0, 0.0), Frame.GCRF()),
122
- velocity=Velocity.meters_per_second((0.0, 0.0, 0.0), Frame.GCRF()),
123
- attitude=Quaternion.unit(),
124
- angular_velocity=(0.0, 0.0, 0.0),
125
- reference_frame=Frame.GCRF(),
126
- ),
127
- State(
128
- instant=Instant.date_time(datetime(2020, 1, 1, 0, 1, 0), Scale.UTC),
129
- position=Position.meters((0.0, 0.0, 0.0), Frame.GCRF()),
130
- velocity=Velocity.meters_per_second((0.0, 0.0, 0.0), Frame.GCRF()),
131
- attitude=Quaternion.unit(),
132
- angular_velocity=(0.0, 0.0, 0.0),
133
- reference_frame=Frame.GCRF(),
134
- ),
135
- ],
136
- ),
137
- )
138
-
139
- assert isinstance(profile, Profile)
140
- assert profile.is_defined()
141
-
142
- assert (
143
- profile.get_state_at(
144
- Instant.date_time(datetime(2020, 1, 1, 0, 0, 30), Scale.UTC)
145
- )
146
- is not None
147
- )