open-space-toolkit-astrodynamics 9.1.6__py39-none-manylinux2014_aarch64.whl → 13.0.2__py39-none-manylinux2014_aarch64.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 (30) hide show
  1. {open_space_toolkit_astrodynamics-9.1.6.dist-info → open_space_toolkit_astrodynamics-13.0.2.dist-info}/METADATA +5 -5
  2. {open_space_toolkit_astrodynamics-9.1.6.dist-info → open_space_toolkit_astrodynamics-13.0.2.dist-info}/RECORD +29 -27
  3. {open_space_toolkit_astrodynamics-9.1.6.dist-info → open_space_toolkit_astrodynamics-13.0.2.dist-info}/WHEEL +1 -1
  4. ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-39-aarch64-linux-gnu.so +0 -0
  5. ostk/astrodynamics/converters.py +35 -90
  6. ostk/astrodynamics/dataframe.py +479 -0
  7. ostk/astrodynamics/display.py +2 -0
  8. ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.13 +0 -0
  9. ostk/astrodynamics/pytrajectory/pystate.py +216 -1
  10. ostk/astrodynamics/test/conftest.py +2 -2
  11. ostk/astrodynamics/test/flight/test_profile.py +155 -55
  12. ostk/astrodynamics/test/test_converters.py +43 -140
  13. ostk/astrodynamics/test/test_dataframe.py +875 -0
  14. ostk/astrodynamics/test/test_display.py +2 -3
  15. ostk/astrodynamics/test/test_event_condition.py +27 -7
  16. ostk/astrodynamics/test/test_trajectory.py +116 -38
  17. ostk/astrodynamics/test/test_utilities.py +31 -46
  18. ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +13 -0
  19. ostk/astrodynamics/test/trajectory/orbit/test_pass.py +9 -0
  20. ostk/astrodynamics/test/trajectory/state/test_coordinate_subset.py +3 -0
  21. ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +2 -2
  22. ostk/astrodynamics/test/trajectory/test_local_orbital_frame_factory.py +34 -2
  23. ostk/astrodynamics/test/trajectory/test_orbit.py +26 -2
  24. ostk/astrodynamics/test/trajectory/test_segment.py +99 -1
  25. ostk/astrodynamics/test/trajectory/test_sequence.py +53 -0
  26. ostk/astrodynamics/test/trajectory/test_state.py +306 -0
  27. ostk/astrodynamics/utilities.py +125 -36
  28. ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.9 +0 -0
  29. {open_space_toolkit_astrodynamics-9.1.6.dist-info → open_space_toolkit_astrodynamics-13.0.2.dist-info}/top_level.txt +0 -0
  30. {open_space_toolkit_astrodynamics-9.1.6.dist-info → open_space_toolkit_astrodynamics-13.0.2.dist-info}/zip-safe +0 -0
@@ -19,18 +19,17 @@ from ostk.astrodynamics import Trajectory
19
19
  from ostk.astrodynamics import display
20
20
  from ostk.astrodynamics.access import Generator as AccessGenerator
21
21
  from ostk.astrodynamics.trajectory import Orbit
22
- from ostk.astrodynamics.trajectory import State
23
22
  from ostk.astrodynamics.trajectory.orbit.model import SGP4
24
23
  from ostk.astrodynamics.trajectory.orbit.model.sgp4 import TLE
25
24
 
26
25
 
27
26
  class TestDisplay:
28
- def test_accesses_plot(self, state: State):
27
+ def test_accesses_plot(self):
29
28
  start_instant: Instant = Instant.date_time(
30
29
  DateTime(2023, 1, 3, 0, 0, 0),
31
30
  Scale.UTC,
32
31
  )
33
- duration: Duration = Duration.days(7.0)
32
+ duration: Duration = Duration.hours(12.0)
34
33
  step: Duration = Duration.seconds(10.0)
35
34
  tolerance: Duration = Duration.seconds(1.0)
36
35
 
@@ -2,6 +2,10 @@
2
2
 
3
3
  import pytest
4
4
 
5
+ from ostk.physics.time import Instant
6
+ from ostk.physics.coordinate import Position, Velocity, Frame
7
+
8
+ from ostk.astrodynamics.trajectory import State
5
9
  from ostk.astrodynamics import EventCondition
6
10
 
7
11
 
@@ -12,7 +16,7 @@ def name() -> str:
12
16
 
13
17
  @pytest.fixture
14
18
  def evaluator() -> callable:
15
- return lambda state: 0.0
19
+ return lambda state: 5.0
16
20
 
17
21
 
18
22
  @pytest.fixture
@@ -22,7 +26,7 @@ def target_value() -> float:
22
26
 
23
27
  @pytest.fixture
24
28
  def target(target_value: float) -> EventCondition.Target:
25
- return EventCondition.Target(target_value, EventCondition.Target.Type.Absolute)
29
+ return EventCondition.Target(target_value, EventCondition.Target.Type.Relative)
26
30
 
27
31
 
28
32
  @pytest.fixture
@@ -32,12 +36,13 @@ def event_condition(
32
36
  class MyEventCondition(EventCondition):
33
37
  def is_satisfied(
34
38
  self,
35
- current_state_vector,
36
- current_time,
37
- previous_state_vector,
38
- previous_time,
39
+ current_state,
40
+ previous_state,
39
41
  ):
40
- return current_state_vector[0] > 0.0 and previous_state_vector[0] < 0.0
42
+ return (
43
+ current_state.get_position().get_coordinates()[2] > 0.0
44
+ and previous_state.get_position().get_coordinates()[2] < 0.0
45
+ )
41
46
 
42
47
  return MyEventCondition(name, evaluator, target)
43
48
 
@@ -56,3 +61,18 @@ class TestEventCondition:
56
61
  self, event_condition: EventCondition, target: EventCondition.Target
57
62
  ):
58
63
  assert event_condition.get_target() == target
64
+
65
+ def test_update_target(
66
+ self,
67
+ event_condition: EventCondition,
68
+ ):
69
+ current_target_value_offset: float = event_condition.get_target().value_offset
70
+ event_condition.update_target(
71
+ State(
72
+ Instant.J2000(),
73
+ Position.meters([0.0, 0.0, 0.0], Frame.GCRF()),
74
+ Velocity.meters_per_second([0.0, 0.0, 0.0], Frame.GCRF()),
75
+ )
76
+ )
77
+
78
+ assert event_condition.get_target().value_offset != current_target_value_offset
@@ -1,40 +1,118 @@
1
1
  # Apache License 2.0
2
2
 
3
- import ostk.mathematics as mathematics
4
-
5
- import ostk.physics as physics
6
-
7
- import ostk.astrodynamics as astrodynamics
8
-
9
- RealInterval = mathematics.object.RealInterval
10
- Quaternion = mathematics.geometry.d3.transformation.rotation.Quaternion
11
- Length = physics.unit.Length
12
- Angle = physics.unit.Angle
13
- DateTime = physics.time.DateTime
14
- Scale = physics.time.Scale
15
- Duration = physics.time.Duration
16
- Instant = physics.time.Instant
17
- Transform = physics.coordinate.Transform
18
- Frame = physics.coordinate.Frame
19
- Axes = physics.coordinate.Axes
20
- DynamicProvider = physics.coordinate.frame.provider.Dynamic
21
- Environment = physics.Environment
22
- Earth = physics.environment.object.celestial.Earth
23
- Trajectory = astrodynamics.Trajectory
24
- Profile = astrodynamics.flight.Profile
25
- SatelliteSystem = astrodynamics.flight.system.SatelliteSystem
26
- Orbit = astrodynamics.trajectory.Orbit
27
- State = astrodynamics.trajectory.State
28
- Pass = astrodynamics.trajectory.orbit.Pass
29
- Kepler = astrodynamics.trajectory.orbit.model.Kepler
30
- COE = astrodynamics.trajectory.orbit.model.kepler.COE
31
- SGP4 = astrodynamics.trajectory.orbit.model.sgp4
32
- Access = astrodynamics.Access
33
-
34
-
35
- def test_trajectory_undefined():
36
- trajectory: Trajectory = Trajectory.undefined()
37
-
38
- assert trajectory is not None
39
- assert isinstance(trajectory, Trajectory)
40
- assert trajectory.is_defined() is False
3
+ import pytest
4
+
5
+ from ostk.physics.environment.object.celestial import Earth
6
+ from ostk.physics.coordinate.spherical import LLA
7
+ from ostk.physics.coordinate import Position
8
+ from ostk.physics.coordinate import Frame
9
+ from ostk.physics.time import Instant
10
+ from ostk.physics.time import Duration
11
+ from ostk.physics.unit import Derived
12
+
13
+ from ostk.astrodynamics import Trajectory
14
+ from ostk.astrodynamics.trajectory import State
15
+
16
+
17
+ @pytest.fixture
18
+ def start_lla() -> LLA:
19
+ return LLA.vector([0.0, 0.0, 0.0])
20
+
21
+
22
+ @pytest.fixture
23
+ def end_lla() -> LLA:
24
+ return LLA.vector([1.0, 0.0, 0.0])
25
+
26
+
27
+ @pytest.fixture
28
+ def start_instant() -> Instant:
29
+ return Instant.J2000()
30
+
31
+
32
+ @pytest.fixture
33
+ def ground_speed() -> Derived:
34
+ return Derived(7000.0, Derived.Unit.meter_per_second())
35
+
36
+
37
+ @pytest.fixture
38
+ def earth() -> Earth:
39
+ return Earth.WGS84()
40
+
41
+
42
+ @pytest.fixture
43
+ def instants() -> list[Instant]:
44
+ return [Instant.J2000(), Instant.J2000() + Duration.seconds(10.0)]
45
+
46
+
47
+ @pytest.fixture
48
+ def position() -> Position:
49
+ return Position.meters([0.0, 0.0, 0.0], Frame.ITRF())
50
+
51
+
52
+ @pytest.fixture
53
+ def trajectory(position: Position) -> Trajectory:
54
+ return Trajectory.position(position)
55
+
56
+
57
+ @pytest.fixture
58
+ def states(trajectory: Trajectory) -> list[State]:
59
+ return trajectory.get_states_at(
60
+ [Instant.J2000(), Instant.J2000() + Duration.seconds(10.0)]
61
+ )
62
+
63
+
64
+ class TestTrajectory:
65
+ def test_trajectory(self, states: list[State]):
66
+ assert Trajectory(states) is not None
67
+
68
+ def test_is_defined(self, trajectory: Trajectory):
69
+ assert trajectory.is_defined()
70
+
71
+ def test_access_model(self, trajectory: Trajectory):
72
+ assert trajectory.access_model() is not None
73
+
74
+ def test_get_state_at(self, trajectory: Trajectory):
75
+ assert trajectory.get_state_at(Instant.J2000()) is not None
76
+
77
+ def test_get_states_at(self, trajectory: Trajectory):
78
+ assert (
79
+ trajectory.get_states_at(
80
+ [Instant.J2000(), Instant.J2000() + Duration.seconds(10.0)]
81
+ )
82
+ is not None
83
+ )
84
+
85
+ def test_trajectory_undefined(self):
86
+ trajectory: Trajectory = Trajectory.undefined()
87
+
88
+ assert trajectory is not None
89
+ assert isinstance(trajectory, Trajectory)
90
+ assert trajectory.is_defined() is False
91
+
92
+ def test_trajectory_position(self, position: Position):
93
+ trajectory: Trajectory = Trajectory.position(position)
94
+
95
+ assert trajectory is not None
96
+
97
+ def test_ground_strip(
98
+ self,
99
+ start_lla: LLA,
100
+ end_lla: LLA,
101
+ ground_speed: Derived,
102
+ start_instant: Instant,
103
+ earth: Earth,
104
+ instants: list[Instant],
105
+ ):
106
+ assert (
107
+ Trajectory.ground_strip(
108
+ start_lla, end_lla, ground_speed, start_instant, earth
109
+ )
110
+ is not None
111
+ )
112
+ assert (
113
+ Trajectory.ground_strip(start_lla, end_lla, ground_speed, start_instant)
114
+ is not None
115
+ )
116
+
117
+ assert Trajectory.ground_strip(start_lla, end_lla, instants, earth) is not None
118
+ assert Trajectory.ground_strip(start_lla, end_lla, instants) is not None
@@ -1,25 +1,15 @@
1
1
  # Apache License 2.0
2
2
 
3
- import pytest
3
+ from datetime import datetime
4
4
 
5
- import ostk.physics as physics
6
- import ostk.astrodynamics as astrodynamics
7
- from ostk.astrodynamics import utilities
5
+ from ostk.physics import Environment
6
+ from ostk.physics.time import Instant, Interval
7
+ from ostk.physics.coordinate import Position
8
+ from ostk.physics.coordinate.spherical import LLA, AER
8
9
 
9
- Length = physics.unit.Length
10
- Angle = physics.unit.Angle
11
- DateTime = physics.time.DateTime
12
- Scale = physics.time.Scale
13
- Instant = physics.time.Instant
14
- Interval = physics.time.Interval
15
- Position = physics.coordinate.Position
16
- Velocity = physics.coordinate.Velocity
17
- Frame = physics.coordinate.Frame
18
- LLA = physics.coordinate.spherical.LLA
19
- AER = physics.coordinate.spherical.AER
20
- Environment = physics.Environment
21
- Trajectory = astrodynamics.Trajectory
22
- State = astrodynamics.trajectory.State
10
+ from ostk.astrodynamics import utilities
11
+ from ostk.astrodynamics import Trajectory
12
+ from ostk.astrodynamics.trajectory import State
23
13
 
24
14
 
25
15
  class TestUtility:
@@ -27,22 +17,16 @@ class TestUtility:
27
17
  self,
28
18
  state: State,
29
19
  ):
30
- lla: tuple[float, float, float] = utilities.lla_from_state(state)
20
+ lla: LLA = utilities.lla_from_state(state)
31
21
 
32
22
  assert lla is not None
33
- assert len(lla) == 3
34
- assert isinstance(lla, tuple)
35
- assert isinstance(lla[0], float)
36
- assert lla[0] >= -90.0 and lla[0] <= 90.0
37
- assert isinstance(lla[1], float)
38
- assert lla[0] >= -180.0 and lla[0] <= 180.0
39
- assert isinstance(lla[2], float)
23
+ assert isinstance(lla, LLA)
24
+ assert lla.is_defined()
40
25
 
41
26
  def test_lla_from_position(
42
27
  self,
43
28
  instant: Instant,
44
29
  position: Position,
45
- state: State,
46
30
  ):
47
31
  lla: LLA = utilities.lla_from_position(position, instant)
48
32
 
@@ -50,12 +34,6 @@ class TestUtility:
50
34
  assert isinstance(lla, LLA)
51
35
  assert lla.is_defined()
52
36
 
53
- lla_from_state: tuple[float, float, float] = utilities.lla_from_state(state)
54
-
55
- assert lla.get_latitude().in_degrees() == lla_from_state[0]
56
- assert lla.get_longitude().in_degrees() == lla_from_state[1]
57
- assert lla.get_altitude().in_meters() == lla_from_state[2]
58
-
59
37
  def test_position_from_lla(
60
38
  self,
61
39
  lla: LLA,
@@ -72,28 +50,24 @@ class TestUtility:
72
50
  position: Position,
73
51
  environment: Environment,
74
52
  ):
75
- aer: tuple[float, float, float] = utilities.compute_aer(
76
- instant, position, position, environment
77
- )
53
+ aer: AER = utilities.compute_aer(instant, position, position, environment)
78
54
 
79
55
  assert aer is not None
80
- assert len(aer) == 3
81
- assert aer[2] == 0.0
56
+ assert isinstance(aer, AER)
82
57
 
83
- def test_compute_time_lla_aer_state(
58
+ def test_compute_time_lla_aer_coordinates(
84
59
  self,
85
60
  state: State,
86
61
  position: Position,
87
62
  environment: Environment,
88
63
  ):
89
- time_lla_aer: float[Instant, float, float, float, float, float, float] = (
90
- utilities.compute_time_lla_aer_state(state, position, environment)
64
+ time_lla_aer: float[datetime, float, float, float, float, float, float] = (
65
+ utilities.compute_time_lla_aer_coordinates(state, position, environment)
91
66
  )
92
67
 
93
68
  assert time_lla_aer is not None
94
69
  assert len(time_lla_aer) == 7
95
- assert isinstance(time_lla_aer[0], Instant)
96
- assert time_lla_aer[0] == state.get_instant()
70
+ assert isinstance(time_lla_aer[0], datetime)
97
71
  for i in range(1, 7):
98
72
  assert isinstance(time_lla_aer[i], float)
99
73
 
@@ -102,12 +76,23 @@ class TestUtility:
102
76
  interval: Interval,
103
77
  trajectory: Trajectory,
104
78
  ):
105
- output: list[tuple[float, float, float]] = utilities.compute_trajectory_geometry(
106
- trajectory, interval
107
- )
79
+ output: list[LLA] = utilities.compute_trajectory_geometry(trajectory, interval)
80
+
81
+ assert output is not None
82
+ assert len(output) == 2
83
+ assert isinstance(output[0], LLA)
84
+
85
+ def test_compute_ground_track(
86
+ self,
87
+ interval: Interval,
88
+ trajectory: Trajectory,
89
+ ):
90
+ output: list[LLA] = utilities.compute_ground_track(trajectory, interval)
108
91
 
109
92
  assert output is not None
110
93
  assert len(output) == 2
94
+ assert isinstance(output[0], LLA)
95
+ assert output[0].get_altitude().in_meters() <= 15.0
111
96
 
112
97
  def test_convert_state(self, state: State):
113
98
  output: tuple[
@@ -4,7 +4,9 @@ import pytest
4
4
 
5
5
  from ostk.physics.unit import Length
6
6
  from ostk.physics.unit import Angle
7
+ from ostk.physics.time import Instant
7
8
  from ostk.physics.environment.gravitational import Earth
9
+ from ostk.physics.environment.object.celestial import Sun
8
10
 
9
11
  from ostk.astrodynamics.trajectory.orbit.model.kepler import COE
10
12
 
@@ -140,6 +142,17 @@ class TestCOE:
140
142
  )
141
143
  assert COE.compute_radial_distance(7000.0e3, 0.0, 0.0) is not None
142
144
 
145
+ assert COE.compute_ltan(Angle.degrees(270.0), Instant.J2000()) is not None
146
+ assert (
147
+ COE.compute_ltan(Angle.degrees(270.0), Instant.J2000(), Sun.default())
148
+ is not None
149
+ )
150
+ assert COE.compute_mean_ltan(Angle.degrees(270.0), Instant.J2000()) is not None
151
+ assert (
152
+ COE.compute_mean_ltan(Angle.degrees(270.0), Instant.J2000(), Sun.default())
153
+ is not None
154
+ )
155
+
143
156
  def test_from_SI_vector(
144
157
  self,
145
158
  coe: COE,
@@ -41,6 +41,15 @@ class TestPass:
41
41
  def test_get_duration(self, pass_: Pass):
42
42
  assert pass_.get_duration() is not None
43
43
 
44
+ def test_get_start_instant(self, pass_: Pass):
45
+ assert pass_.get_start_instant() is not None
46
+
47
+ def test_get_end_instant(self, pass_: Pass):
48
+ assert pass_.get_end_instant() is not None
49
+
50
+ def test_get_interval(self, pass_: Pass):
51
+ assert pass_.get_interval() is not None
52
+
44
53
  def test_get_instant_at_ascending_node(self, pass_: Pass):
45
54
  assert pass_.get_instant_at_ascending_node() is not None
46
55
 
@@ -30,6 +30,9 @@ class TestCoordinateSubset:
30
30
  def test_ne(self, coordinate_subset: CoordinateSubset):
31
31
  assert (coordinate_subset != coordinate_subset) == False
32
32
 
33
+ def test_hash(self, coordinate_subset: CoordinateSubset):
34
+ assert hash(coordinate_subset) is not None
35
+
33
36
  def test_get_id(self, coordinate_subset: CoordinateSubset):
34
37
  assert coordinate_subset.get_id() is not None
35
38
 
@@ -191,7 +191,7 @@ class TestNumericalSolver:
191
191
  initial_state: State,
192
192
  numerical_solver: NumericalSolver,
193
193
  ):
194
- duration_seconds: float = 100.0
194
+ duration_seconds: float = 10.0
195
195
  end_instant: Instant = initial_state.get_instant() + Duration.seconds(
196
196
  duration_seconds
197
197
  )
@@ -205,7 +205,7 @@ class TestNumericalSolver:
205
205
 
206
206
  end_instants: list[Instant] = [
207
207
  initial_state.get_instant() + Duration.seconds(duration)
208
- for duration in np.arange(600.0, 1000.0, 50.0)
208
+ for duration in np.arange(60.0, 100.0, 20.0)
209
209
  ]
210
210
  states: list[State] = numerical_solver.integrate_time(
211
211
  initial_state, end_instants, oscillator
@@ -5,11 +5,11 @@ import pytest
5
5
  from ostk.physics.time import Instant
6
6
  from ostk.physics.time import DateTime
7
7
  from ostk.physics.time import Scale
8
- from ostk.physics.coordinate import Position
9
- from ostk.physics.coordinate import Velocity
10
8
  from ostk.physics.coordinate import Frame
9
+ from ostk.physics.coordinate import Transform
11
10
 
12
11
  from ostk.astrodynamics.trajectory import LocalOrbitalFrameFactory
12
+ from ostk.astrodynamics.trajectory import LocalOrbitalFrameTransformProvider
13
13
 
14
14
 
15
15
  @pytest.fixture
@@ -17,6 +17,16 @@ def parent_frame() -> Frame:
17
17
  return Frame.GCRF()
18
18
 
19
19
 
20
+ @pytest.fixture
21
+ def local_orbital_transform_provider_type() -> LocalOrbitalFrameTransformProvider.Type:
22
+ return LocalOrbitalFrameTransformProvider.Type.VNC
23
+
24
+
25
+ @pytest.fixture
26
+ def transform_generator() -> callable:
27
+ return lambda instant, position, velocity: Transform.identity(Transform.Type.passive)
28
+
29
+
20
30
  @pytest.fixture
21
31
  def local_orbital_frame_factory(parent_frame: Frame) -> LocalOrbitalFrameFactory:
22
32
  return LocalOrbitalFrameFactory.VNC(parent_frame)
@@ -74,3 +84,25 @@ class TestLocalOrbitalFrameFactory:
74
84
  local_orbital_frame_factory: LocalOrbitalFrameFactory,
75
85
  ):
76
86
  assert local_orbital_frame_factory.is_defined()
87
+
88
+ def test_constructor(
89
+ self,
90
+ local_orbital_transform_provider_type: LocalOrbitalFrameTransformProvider.Type,
91
+ parent_frame: Frame,
92
+ ):
93
+ assert (
94
+ LocalOrbitalFrameFactory.construct(
95
+ local_orbital_transform_provider_type, parent_frame
96
+ )
97
+ is not None
98
+ )
99
+
100
+ def test_custom_constructor(
101
+ self,
102
+ transform_generator: callable,
103
+ parent_frame: Frame,
104
+ ):
105
+ assert (
106
+ LocalOrbitalFrameFactory.construct(transform_generator, parent_frame)
107
+ is not None
108
+ )
@@ -98,6 +98,20 @@ class TestOrbit:
98
98
  assert isinstance(pass_, Pass)
99
99
  assert pass_.is_defined()
100
100
 
101
+ assert (
102
+ orbit.get_pass_with_revolution_number(2, Duration.minutes(10.0)) is not None
103
+ )
104
+
105
+ def test_get_passes_within_interval(self, orbit: Orbit):
106
+ passes: list[Pass] = orbit.get_passes_within_interval(
107
+ Interval.closed(
108
+ Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC),
109
+ Instant.date_time(DateTime(2018, 1, 1, 0, 10, 0), Scale.UTC),
110
+ )
111
+ )
112
+
113
+ assert len(passes) > 0
114
+
101
115
  def test_undefined(self):
102
116
  assert Orbit.undefined().is_defined() is False
103
117
 
@@ -167,6 +181,16 @@ class TestOrbit:
167
181
  argument_of_latitude=Angle.degrees(50.0),
168
182
  ).is_defined()
169
183
 
170
- def test_compute_passes(self, orbit: Orbit, states: list[State]):
171
- passes: list[tuple[int, Pass]] = orbit.compute_passes(states, 1)
184
+ def test_compute_passes(self, states: list[State]):
185
+ passes: list[tuple[int, Pass]] = Orbit.compute_passes(states, 1)
172
186
  assert passes is not None
187
+
188
+ def test_compute_passes_with_model(self, orbit: Orbit):
189
+ passes: list[tuple[int, Pass]] = Orbit.compute_passes_with_model(
190
+ model=orbit.access_kepler_model(),
191
+ start_instant=Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC),
192
+ end_instant=Instant.date_time(DateTime(2018, 1, 1, 0, 10, 0), Scale.UTC),
193
+ initial_revolution_number=1,
194
+ )
195
+
196
+ assert len(passes) > 0
@@ -11,8 +11,8 @@ from ostk.physics.time import Duration
11
11
  from ostk.physics.coordinate import Frame
12
12
  from ostk.physics.environment.object.celestial import Earth
13
13
 
14
- from ostk.astrodynamics.flight import Maneuver
15
14
  from ostk.astrodynamics.flight.system import SatelliteSystem
15
+ from ostk.astrodynamics import Dynamics
16
16
  from ostk.astrodynamics.dynamics import CentralBodyGravity
17
17
  from ostk.astrodynamics.dynamics import PositionDerivative
18
18
  from ostk.astrodynamics.dynamics import Thruster
@@ -135,6 +135,104 @@ def thruster_dynamics() -> Thruster:
135
135
  )
136
136
 
137
137
 
138
+ @pytest.fixture
139
+ def segment_solution(dynamics: list[Dynamics], state: State) -> Segment.Solution:
140
+ return Segment.Solution(
141
+ name="A Segment",
142
+ dynamics=dynamics,
143
+ states=[
144
+ state,
145
+ ],
146
+ condition_is_satisfied=True,
147
+ segment_type=Segment.Type.Coast,
148
+ )
149
+
150
+
151
+ class TestSegmentSolution:
152
+ def test_constructors(
153
+ self,
154
+ segment_solution: Segment.Solution,
155
+ ):
156
+ assert segment_solution is not None
157
+ assert segment_solution.name is not None
158
+ assert segment_solution.dynamics is not None
159
+ assert segment_solution.states is not None
160
+ assert segment_solution.condition_is_satisfied is not None
161
+ assert segment_solution.segment_type is not None
162
+
163
+ def test_getters_and_accessors(
164
+ self,
165
+ segment_solution: Segment.Solution,
166
+ ):
167
+ assert segment_solution.access_start_instant() is not None
168
+ assert segment_solution.access_end_instant() is not None
169
+ assert segment_solution.get_interval() is not None
170
+ assert segment_solution.get_initial_mass() is not None
171
+ assert segment_solution.get_final_mass() is not None
172
+ assert segment_solution.get_propagation_duration() is not None
173
+
174
+ def test_compute_delta_v(
175
+ self,
176
+ segment_solution: Segment.Solution,
177
+ ):
178
+ assert segment_solution.compute_delta_v(1500.0) is not None
179
+
180
+ def test_compute_delta_mass(
181
+ self,
182
+ segment_solution: Segment.Solution,
183
+ ):
184
+ assert segment_solution.compute_delta_mass() is not None
185
+
186
+ @pytest.mark.skip(reason="Not implemented yet")
187
+ def test_extract_maneuvers(
188
+ self,
189
+ segment_solution: Segment.Solution,
190
+ ):
191
+ assert segment_solution.extract_maneuvers(Frame.GCRF()) is not None
192
+
193
+ def test_calculate_states_at(
194
+ self,
195
+ segment_solution: Segment.Solution,
196
+ ):
197
+ assert (
198
+ segment_solution.calculate_states_at(
199
+ [
200
+ segment_solution.states[0].get_instant(),
201
+ ],
202
+ NumericalSolver.default_conditional(),
203
+ )
204
+ is not None
205
+ )
206
+
207
+ def get_dynamics_contribution(
208
+ self,
209
+ segment_solution: Segment.Solution,
210
+ ):
211
+ assert (
212
+ segment_solution.get_dynamics_contribution(
213
+ segment_solution.dynamics[0], Frame.GCRF()
214
+ )
215
+ is not None
216
+ )
217
+
218
+ def get_dynamics_acceleration_contribution(
219
+ self,
220
+ segment_solution: Segment.Solution,
221
+ ):
222
+ assert (
223
+ segment_solution.get_dynamics_acceleration_contribution(
224
+ segment_solution.dynamics[0], Frame.GCRF()
225
+ )
226
+ is not None
227
+ )
228
+
229
+ def get_all_dynamics_contributions(
230
+ self,
231
+ segment_solution: Segment.Solution,
232
+ ):
233
+ assert segment_solution.get_all_dynamics_contributions(Frame.GCRF()) is not None
234
+
235
+
138
236
  class TestSegment:
139
237
  def test_get_name(self, coast_duration_segment: Segment, name: str):
140
238
  assert coast_duration_segment.get_name() == name