open-space-toolkit-astrodynamics 2.2.0__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 (71) hide show
  1. {open_space_toolkit_astrodynamics-2.2.0.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.2.0.dist-info/RECORD +0 -77
  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_boolean_condition.py +0 -55
  22. ostk/astrodynamics/test/event_condition/test_coe_condition.py +0 -126
  23. ostk/astrodynamics/test/event_condition/test_instant_condition.py +0 -48
  24. ostk/astrodynamics/test/event_condition/test_logical_condition.py +0 -120
  25. ostk/astrodynamics/test/event_condition/test_real_condition.py +0 -53
  26. ostk/astrodynamics/test/flight/__init__.py +0 -1
  27. ostk/astrodynamics/test/flight/profile/__init__.py +0 -1
  28. ostk/astrodynamics/test/flight/profile/test_state.py +0 -144
  29. ostk/astrodynamics/test/flight/system/__init__.py +0 -1
  30. ostk/astrodynamics/test/flight/system/dynamics/__init__.py +0 -1
  31. ostk/astrodynamics/test/flight/system/dynamics/test_atmospheric_drag.py +0 -89
  32. ostk/astrodynamics/test/flight/system/dynamics/test_central_body_gravity.py +0 -58
  33. ostk/astrodynamics/test/flight/system/dynamics/test_dynamics.py +0 -37
  34. ostk/astrodynamics/test/flight/system/dynamics/test_position_derivative.py +0 -51
  35. ostk/astrodynamics/test/flight/system/dynamics/test_third_body_gravity.py +0 -67
  36. ostk/astrodynamics/test/flight/system/test_satellite_system.py +0 -77
  37. ostk/astrodynamics/test/flight/test_profile.py +0 -153
  38. ostk/astrodynamics/test/flight/test_system.py +0 -55
  39. ostk/astrodynamics/test/solvers/__init__.py +0 -1
  40. ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +0 -153
  41. ostk/astrodynamics/test/trajectory/__init__.py +0 -1
  42. ostk/astrodynamics/test/trajectory/orbit/__init__.py +0 -1
  43. ostk/astrodynamics/test/trajectory/orbit/messages/__init__.py +0 -1
  44. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/__init__.py +0 -1
  45. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/conftest.py +0 -18
  46. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/data/opm_1.yaml +0 -44
  47. ostk/astrodynamics/test/trajectory/orbit/messages/spacex/test_opm.py +0 -108
  48. ostk/astrodynamics/test/trajectory/orbit/models/__init__.py +0 -1
  49. ostk/astrodynamics/test/trajectory/orbit/models/kepler/__init__.py +0 -1
  50. ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +0 -112
  51. ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +0 -1
  52. ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +0 -331
  53. ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +0 -130
  54. ostk/astrodynamics/test/trajectory/orbit/models/test_propagated.py +0 -195
  55. ostk/astrodynamics/test/trajectory/orbit/models/test_sgp4.py +0 -1
  56. ostk/astrodynamics/test/trajectory/orbit/models/test_tabulated.py +0 -380
  57. ostk/astrodynamics/test/trajectory/orbit/test_model.py +0 -1
  58. ostk/astrodynamics/test/trajectory/orbit/test_pass.py +0 -55
  59. ostk/astrodynamics/test/trajectory/state/coordinates_subset/test_cartesian_position.py +0 -103
  60. ostk/astrodynamics/test/trajectory/state/coordinates_subset/test_cartesian_velocity.py +0 -113
  61. ostk/astrodynamics/test/trajectory/state/test_coordinates_broker.py +0 -71
  62. ostk/astrodynamics/test/trajectory/state/test_coordinates_subset.py +0 -43
  63. ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +0 -242
  64. ostk/astrodynamics/test/trajectory/test_model.py +0 -1
  65. ostk/astrodynamics/test/trajectory/test_orbit.py +0 -92
  66. ostk/astrodynamics/test/trajectory/test_propagator.py +0 -234
  67. ostk/astrodynamics/test/trajectory/test_state.py +0 -121
  68. {open_space_toolkit_astrodynamics-2.2.0.dist-info → open_space_toolkit_astrodynamics-5.0.0.dist-info}/WHEEL +0 -0
  69. {open_space_toolkit_astrodynamics-2.2.0.dist-info → open_space_toolkit_astrodynamics-5.0.0.dist-info}/top_level.txt +0 -0
  70. {open_space_toolkit_astrodynamics-2.2.0.dist-info → open_space_toolkit_astrodynamics-5.0.0.dist-info}/zip-safe +0 -0
  71. /ostk/{__init__.py → astrodynamics/pytrajectory/__init__.py} +0 -0
@@ -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,153 +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([0.0, 0.0, 0.0, 1.0], Quaternion.Format.XYZS)
86
-
87
- trajectory: Trajectory = Trajectory.position(
88
- Position.meters((0.0, 0.0, 0.0), Frame.GCRF())
89
- )
90
-
91
- profile: Profile = Profile.inertial_pointing(trajectory, quaternion)
92
-
93
- assert profile is not None
94
- assert isinstance(profile, Profile)
95
- assert profile.is_defined()
96
-
97
- def test_nadir_pointing(self):
98
- environment = Environment.default()
99
-
100
- orbit = Orbit.sun_synchronous(
101
- epoch=Instant.date_time(datetime(2020, 1, 1, 0, 0, 0), Scale.UTC),
102
- altitude=Length.kilometers(500.0),
103
- local_time_at_descending_node=Time(14, 0, 0),
104
- celestial_object=environment.access_celestial_object_with_name("Earth"),
105
- )
106
-
107
- profile: Profile = Profile.nadir_pointing(orbit, Orbit.FrameType.VVLH)
108
-
109
- assert profile is not None
110
- assert isinstance(profile, Profile)
111
- assert profile.is_defined()
112
-
113
- def test_tabulated(self):
114
- profile = Profile(
115
- model=TabulatedModel(
116
- states=[
117
- State(
118
- instant=Instant.date_time(
119
- datetime(2020, 1, 1, 0, 0, 0), Scale.UTC
120
- ),
121
- position=Position.meters((0.0, 0.0, 0.0), Frame.GCRF()),
122
- velocity=Velocity.meters_per_second(
123
- (0.0, 0.0, 0.0), Frame.GCRF()
124
- ),
125
- attitude=Quaternion.unit(),
126
- angular_velocity=(0.0, 0.0, 0.0),
127
- reference_frame=Frame.GCRF(),
128
- ),
129
- State(
130
- instant=Instant.date_time(
131
- datetime(2020, 1, 1, 0, 1, 0), Scale.UTC
132
- ),
133
- position=Position.meters((0.0, 0.0, 0.0), Frame.GCRF()),
134
- velocity=Velocity.meters_per_second(
135
- (0.0, 0.0, 0.0), Frame.GCRF()
136
- ),
137
- attitude=Quaternion.unit(),
138
- angular_velocity=(0.0, 0.0, 0.0),
139
- reference_frame=Frame.GCRF(),
140
- ),
141
- ],
142
- ),
143
- )
144
-
145
- assert isinstance(profile, Profile)
146
- assert profile.is_defined()
147
-
148
- assert (
149
- profile.get_state_at(
150
- Instant.date_time(datetime(2020, 1, 1, 0, 0, 30), Scale.UTC)
151
- )
152
- is not None
153
- )
@@ -1,55 +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
- System = astrodynamics.flight.System
20
-
21
-
22
- @pytest.fixture
23
- def system_default_inputs():
24
- mass = Mass(90.0, Mass.Unit.Kilogram)
25
- 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
-
33
- return (mass, geometry)
34
-
35
-
36
- @pytest.fixture
37
- def system(system_default_inputs) -> System:
38
- return System(*system_default_inputs)
39
-
40
-
41
- class TestSatelliteSystem:
42
- def test_constructors(self, system: System):
43
- assert system is not None
44
- assert isinstance(system, System)
45
- assert system.is_defined()
46
-
47
- def test_comparators(self, system: System):
48
- assert (system == system) is True
49
- assert (system != system) is False
50
-
51
- def test_getters(self, system_default_inputs, system: System):
52
- (mass, geometry) = system_default_inputs
53
-
54
- assert system.get_mass() == mass
55
- assert system.get_geometry() == geometry
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1,153 +0,0 @@
1
- # Apache License 2.0
2
-
3
- import pytest
4
-
5
- from ostk.physics.units import Length
6
- from ostk.physics.units import Angle
7
- from ostk.physics.time import Instant
8
- from ostk.physics.time import Duration
9
- from ostk.physics.time import Interval
10
- from ostk.physics.time import DateTime
11
- from ostk.physics.time import Scale
12
- from ostk.physics import Environment
13
-
14
- from ostk.astrodynamics.trajectory import Orbit
15
- from ostk.astrodynamics.trajectory.orbit.models import Kepler
16
- from ostk.astrodynamics.trajectory.orbit.models.kepler import COE
17
- from ostk.astrodynamics.access import Generator
18
- from ostk.astrodynamics.solvers import TemporalConditionSolver
19
-
20
-
21
- @pytest.fixture
22
- def temporal_condition_solver() -> TemporalConditionSolver:
23
- return TemporalConditionSolver(
24
- time_step=Duration.seconds(30.0),
25
- tolerance=Duration.milliseconds(1.0),
26
- maximum_iteration_count=1234,
27
- )
28
-
29
-
30
- @pytest.fixture
31
- def interval() -> Interval:
32
- return Interval.closed(
33
- Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC),
34
- Instant.date_time(DateTime(2018, 1, 1, 2, 0, 0), Scale.UTC),
35
- )
36
-
37
-
38
- class TestTemporalConditionSolver:
39
- def test_constructor_success(self):
40
- temporal_condition_solver = TemporalConditionSolver(
41
- time_step=Duration.seconds(30.0),
42
- tolerance=Duration.milliseconds(1.0),
43
- maximum_iteration_count=1234,
44
- )
45
-
46
- assert isinstance(temporal_condition_solver, TemporalConditionSolver)
47
-
48
- def test_getters_success(
49
- self,
50
- temporal_condition_solver: TemporalConditionSolver,
51
- ):
52
- assert temporal_condition_solver.get_time_step() == Duration.seconds(30.0)
53
- assert temporal_condition_solver.get_tolerance() == Duration.milliseconds(1.0)
54
- assert temporal_condition_solver.get_maximum_iteration_count() == 1234
55
-
56
- def test_solve_success_one_condition_always_true(
57
- self,
58
- temporal_condition_solver: TemporalConditionSolver,
59
- interval: Interval,
60
- ):
61
- solution: list[Interval] = temporal_condition_solver.solve(
62
- condition=lambda _: True,
63
- interval=interval,
64
- )
65
-
66
- assert isinstance(solution, list)
67
- assert solution == [interval]
68
-
69
- def test_solve_success_one_condition_always_false(
70
- self,
71
- temporal_condition_solver: TemporalConditionSolver,
72
- interval: Interval,
73
- ):
74
- solution: list[Interval] = temporal_condition_solver.solve(
75
- condition=lambda _: False,
76
- interval=interval,
77
- )
78
-
79
- assert isinstance(solution, list)
80
- assert solution == []
81
-
82
- def test_solve_success_multiple_conditions_always_true(
83
- self,
84
- temporal_condition_solver: TemporalConditionSolver,
85
- interval: Interval,
86
- ):
87
- solution: list[Interval] = temporal_condition_solver.solve(
88
- conditions=[
89
- lambda _: True,
90
- lambda _: True,
91
- ],
92
- interval=interval,
93
- )
94
-
95
- assert isinstance(solution, list)
96
- assert solution == [interval]
97
-
98
- def test_solve_success_multiple_conditions_one_always_false(
99
- self,
100
- temporal_condition_solver: TemporalConditionSolver,
101
- interval: Interval,
102
- ):
103
- solution: list[Interval] = temporal_condition_solver.solve(
104
- conditions=[
105
- lambda _: True,
106
- lambda _: False,
107
- ],
108
- interval=interval,
109
- )
110
-
111
- assert isinstance(solution, list)
112
- assert solution == []
113
-
114
- def test_solve_success_using_access_generator(
115
- self,
116
- temporal_condition_solver: TemporalConditionSolver,
117
- interval: Interval,
118
- ):
119
- environment = Environment.default()
120
-
121
- generator = Generator(
122
- environment=environment,
123
- )
124
-
125
- earth = environment.access_celestial_object_with_name("Earth")
126
-
127
- trajectory = Orbit(
128
- model=Kepler(
129
- coe=COE(
130
- semi_major_axis=Length.kilometers(7000.0),
131
- eccentricity=0.0,
132
- inclination=Angle.degrees(45.0),
133
- raan=Angle.degrees(0.0),
134
- aop=Angle.degrees(0.0),
135
- true_anomaly=Angle.degrees(0.0),
136
- ),
137
- epoch=Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC),
138
- celestial_object=earth,
139
- perturbation_type=Kepler.PerturbationType.No,
140
- ),
141
- celestial_object=earth,
142
- )
143
-
144
- solution: list[Interval] = temporal_condition_solver.solve(
145
- condition=generator.get_condition_function(
146
- from_trajectory=trajectory,
147
- to_trajectory=trajectory,
148
- ),
149
- interval=interval,
150
- )
151
-
152
- assert isinstance(solution, list)
153
- assert solution == [interval]
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1,18 +0,0 @@
1
- # Apache License 2.0
2
-
3
- import pytest
4
-
5
- import pathlib
6
-
7
- from ostk.core.filesystem import Path
8
- from ostk.core.filesystem import File
9
-
10
-
11
- @pytest.fixture
12
- def data_directory_path() -> str:
13
- return f"{pathlib.Path(__file__).parent.absolute()}/data"
14
-
15
-
16
- @pytest.fixture
17
- def opm_file(data_directory_path: str) -> File:
18
- return File.path(Path.parse(f"{data_directory_path}/opm_1.yaml"))
@@ -1,44 +0,0 @@
1
- # Dummy SpaceX OPM output
2
-
3
- # Notes:
4
- # - ECEF velocity is Earth relative
5
- # - Apogee/Perigee altitude assumes a spherical Earth, 6378.137 km radius
6
- # - Orbital elements are computed in an inertial frame realized by inertially
7
- # freezing the WGS84 ECEF frame at time of current state
8
- # - State is post-deployment, so includes separation delta-velocity
9
-
10
-
11
- header:
12
- generation_date: 2020-01-01T12:34:56.789Z
13
- launch_date: 2020-01-02T12:34:56.789Z
14
-
15
-
16
- deployments:
17
-
18
- - name: satellite_a
19
- sequence_number: 1
20
- mission_time_s: 3600.0
21
- date: 2020-01-02T13:34:56.789Z
22
- r_ecef_m: [693289.644, 6876578.628, -133035.288]
23
- v_ecef_m_per_s: [1305.783, 39.783, 7525.920]
24
- mean_perigee_altitude_km: 526.768
25
- mean_apogee_altitude_km: 568.430
26
- mean_inclination_deg: 97.123
27
- mean_argument_of_perigee_deg: -179.513
28
- mean_longitude_ascending_node_deg: 85.057
29
- mean_mean_anomaly_deg: 179.263
30
- ballistic_coef_kg_per_m2: 47.55
31
-
32
- - name: satellite_b
33
- sequence_number: 2
34
- mission_time_s: 7200.0
35
- date: 2020-01-02T14:34:56.789Z
36
- r_ecef_m: [699863.059, 6875647.517, -123777.595]
37
- v_ecef_m_per_s: [1504.658, 6.705, 7538.669]
38
- mean_perigee_altitude_km: 536.779
39
- mean_apogee_altitude_km: 529.851
40
- mean_inclination_deg: 97.124
41
- mean_argument_of_perigee_deg: 136.875
42
- mean_longitude_ascending_node_deg: 85.032
43
- mean_mean_anomaly_deg: -127.164
44
- ballistic_coef_kg_per_m2: 44.26
@@ -1,108 +0,0 @@
1
- # Apache License 2.0
2
-
3
- import pytest
4
-
5
- from datetime import datetime
6
-
7
- from ostk.core.containers import Dictionary
8
- from ostk.core.filesystem import Path
9
- from ostk.core.filesystem import File
10
-
11
- from ostk.physics.units import Length
12
- from ostk.physics.units import Angle
13
- from ostk.physics.time import Instant
14
- from ostk.physics.time import Scale
15
- from ostk.physics.time import Duration
16
- from ostk.physics.coordinate import Position
17
- from ostk.physics.coordinate import Velocity
18
- from ostk.physics.coordinate import Frame
19
-
20
- from ostk.astrodynamics.trajectory.orbit.messages.spacex import OPM
21
-
22
-
23
- @pytest.fixture
24
- def opm() -> OPM:
25
- return OPM(
26
- header=OPM.Header(
27
- generation_date=Instant.date_time(datetime(2020, 1, 2, 3, 4, 5), Scale.UTC),
28
- launch_date=Instant.date_time(datetime(2020, 1, 3, 3, 4, 5), Scale.UTC),
29
- ),
30
- deployments=[
31
- OPM.Deployment(
32
- name="A",
33
- sequence_number=1,
34
- mission_time=Duration.hours(3600.0),
35
- date=Instant.date_time(datetime(2020, 1, 4, 3, 4, 5), Scale.UTC),
36
- position=Position.meters((1.0, 2.0, 3.0), Frame.ITRF()),
37
- velocity=Velocity.meters_per_second((4.0, 5.0, 6.0), Frame.ITRF()),
38
- mean_perigee_altitude=Length.kilometers(500.0),
39
- mean_apogee_altitude=Length.kilometers(500.0),
40
- mean_inclination=Angle.degrees(1.0),
41
- mean_argument_of_perigee=Angle.degrees(2.0),
42
- mean_longitude_ascending_node=Angle.degrees(3.0),
43
- mean_mean_anomaly=Angle.degrees(4.0),
44
- ballistic_coefficient=123.456,
45
- ),
46
- ],
47
- )
48
-
49
-
50
- class TestOPM:
51
- def test_constructor(self, opm: OPM):
52
- assert opm is not None
53
-
54
- def test_get_header(self, opm: OPM):
55
- assert opm.get_header() is not None
56
-
57
- def test_get_deployments(self, opm: OPM):
58
- assert len(opm.get_deployments()) == 1
59
-
60
- def test_get_deployment_at(self, opm: OPM):
61
- assert opm.get_deployment_at(index=0).name == "A"
62
-
63
- def test_get_deployment_with_name(self, opm: OPM):
64
- assert opm.get_deployment_with_name(name="A").name == "A"
65
-
66
- def test_undefined(self):
67
- assert OPM.undefined().is_defined() is False
68
-
69
- def test_dictionary(self):
70
- dictionary = Dictionary(
71
- {
72
- "header": {
73
- "generation_date": "2020-01-01T12:34:56.789Z",
74
- "launch_date": "2020-01-02T12:34:56.789Z",
75
- },
76
- "deployments": [
77
- {
78
- "name": "satellite_a",
79
- "sequence_number": 1,
80
- "mission_time_s": 3600.0,
81
- "date": "2020-01-02T13:34:56.789Z",
82
- "r_ecef_m": [693289.644, 6876578.628, -133035.288],
83
- "v_ecef_m_per_s": [1305.783, 39.783, 7525.920],
84
- "mean_perigee_altitude_km": 526.768,
85
- "mean_apogee_altitude_km": 568.430,
86
- "mean_inclination_deg": 97.123,
87
- "mean_argument_of_perigee_deg": -179.513,
88
- "mean_longitude_ascending_node_deg": 85.057,
89
- "mean_mean_anomaly_deg": 179.263,
90
- "ballistic_coef_kg_per_m2": 47.55,
91
- }
92
- ],
93
- }
94
- )
95
-
96
- assert OPM.dictionary(dictionary) is not None
97
-
98
- def test_parse(self, opm_file: File):
99
- with open(str(opm_file.get_path().to_string()), "r") as stream:
100
- assert OPM.parse(string=stream.read()) is not None
101
-
102
- def test_load(self, opm_file: File):
103
- assert OPM.load(file=opm_file) is not None
104
-
105
-
106
- class TestOPMDeployment:
107
- def test_to_state(self, opm: OPM):
108
- assert opm.get_deployment_with_name(name="A").to_state() is not None
@@ -1 +0,0 @@
1
- # Apache License 2.0
@@ -1 +0,0 @@
1
- # Apache License 2.0