open-space-toolkit-physics 11.3.0__py313-none-manylinux2014_x86_64.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. open_space_toolkit_physics-11.3.0.dist-info/METADATA +29 -0
  2. open_space_toolkit_physics-11.3.0.dist-info/RECORD +104 -0
  3. open_space_toolkit_physics-11.3.0.dist-info/WHEEL +5 -0
  4. open_space_toolkit_physics-11.3.0.dist-info/top_level.txt +1 -0
  5. open_space_toolkit_physics-11.3.0.dist-info/zip-safe +1 -0
  6. ostk/__init__.py +1 -0
  7. ostk/physics/OpenSpaceToolkitPhysicsPy.cpython-313-x86_64-linux-gnu.so +0 -0
  8. ostk/physics/__init__.py +6 -0
  9. ostk/physics/__init__.pyi +488 -0
  10. ostk/physics/coordinate/__init__.pyi +1002 -0
  11. ostk/physics/coordinate/frame/__init__.pyi +30 -0
  12. ostk/physics/coordinate/frame/provider/__init__.pyi +77 -0
  13. ostk/physics/coordinate/frame/provider/iau.pyi +64 -0
  14. ostk/physics/coordinate/frame/provider/iers.pyi +584 -0
  15. ostk/physics/coordinate/spherical.pyi +421 -0
  16. ostk/physics/data/__init__.pyi +459 -0
  17. ostk/physics/data/provider.pyi +21 -0
  18. ostk/physics/environment/__init__.pyi +108 -0
  19. ostk/physics/environment/atmospheric/__init__.pyi +181 -0
  20. ostk/physics/environment/atmospheric/earth.pyi +552 -0
  21. ostk/physics/environment/gravitational/__init__.pyi +559 -0
  22. ostk/physics/environment/gravitational/earth.pyi +56 -0
  23. ostk/physics/environment/magnetic/__init__.pyi +171 -0
  24. ostk/physics/environment/magnetic/earth.pyi +56 -0
  25. ostk/physics/environment/object/__init__.pyi +430 -0
  26. ostk/physics/environment/object/celestial/__init__.pyi +248 -0
  27. ostk/physics/environment/object/celestial/moon.pyi +2 -0
  28. ostk/physics/environment/object/celestial/sun.pyi +2 -0
  29. ostk/physics/libopen-space-toolkit-physics.so.11 +0 -0
  30. ostk/physics/py.typed +0 -0
  31. ostk/physics/test/__init__.py +1 -0
  32. ostk/physics/test/coordinate/__init__.py +1 -0
  33. ostk/physics/test/coordinate/frame/__init__.py +1 -0
  34. ostk/physics/test/coordinate/frame/provider/__init__.py +1 -0
  35. ostk/physics/test/coordinate/frame/provider/iers/__init__.py +1 -0
  36. ostk/physics/test/coordinate/frame/provider/iers/conftest.py +38 -0
  37. ostk/physics/test/coordinate/frame/provider/iers/data/finals2000A.data +10953 -0
  38. ostk/physics/test/coordinate/frame/provider/iers/data/ser7.dat +524 -0
  39. ostk/physics/test/coordinate/frame/provider/iers/test_bulletin_a.py +108 -0
  40. ostk/physics/test/coordinate/frame/provider/iers/test_finals_2000a.py +93 -0
  41. ostk/physics/test/coordinate/frame/provider/iers/test_manager.py +205 -0
  42. ostk/physics/test/coordinate/spherical/__init__.py +1 -0
  43. ostk/physics/test/coordinate/spherical/test_aer.py +143 -0
  44. ostk/physics/test/coordinate/spherical/test_lla.py +514 -0
  45. ostk/physics/test/coordinate/test_axes.py +116 -0
  46. ostk/physics/test/coordinate/test_frame.py +107 -0
  47. ostk/physics/test/coordinate/test_position.py +201 -0
  48. ostk/physics/test/coordinate/test_transform.py +294 -0
  49. ostk/physics/test/coordinate/test_velocity.py +180 -0
  50. ostk/physics/test/data/conftest.py +34 -0
  51. ostk/physics/test/data/data/manifest.json +22 -0
  52. ostk/physics/test/data/provider/test_provider.py +34 -0
  53. ostk/physics/test/data/test_direction.py +40 -0
  54. ostk/physics/test/data/test_manifest.py +43 -0
  55. ostk/physics/test/data/test_manifest_manager.py +62 -0
  56. ostk/physics/test/data/test_scalar.py +54 -0
  57. ostk/physics/test/data/test_vector.py +70 -0
  58. ostk/physics/test/environment/__init__.py +1 -0
  59. ostk/physics/test/environment/atmospheric/__init__.py +1 -0
  60. ostk/physics/test/environment/atmospheric/earth/__init__.py +1 -0
  61. ostk/physics/test/environment/atmospheric/earth/conftest.py +67 -0
  62. ostk/physics/test/environment/atmospheric/earth/data/SW-Last5Years.test.csv +22 -0
  63. ostk/physics/test/environment/atmospheric/earth/data/SpaceWeather-All-v1.2.test.txt +811 -0
  64. ostk/physics/test/environment/atmospheric/earth/test_cssi_space_weather.py +126 -0
  65. ostk/physics/test/environment/atmospheric/earth/test_exponential.py +34 -0
  66. ostk/physics/test/environment/atmospheric/earth/test_manager.py +173 -0
  67. ostk/physics/test/environment/atmospheric/earth/test_nrlmsise00.py +34 -0
  68. ostk/physics/test/environment/atmospheric/test_earth.py +141 -0
  69. ostk/physics/test/environment/gravitational/__init__.py +1 -0
  70. ostk/physics/test/environment/gravitational/earth/__init__.py +1 -0
  71. ostk/physics/test/environment/gravitational/earth/test_manager.py +76 -0
  72. ostk/physics/test/environment/gravitational/test_earth.py +103 -0
  73. ostk/physics/test/environment/gravitational/test_moon.py +55 -0
  74. ostk/physics/test/environment/gravitational/test_spherical.py +36 -0
  75. ostk/physics/test/environment/gravitational/test_sun.py +53 -0
  76. ostk/physics/test/environment/magnetic/__init__.py +1 -0
  77. ostk/physics/test/environment/magnetic/earth/test_manager.py +64 -0
  78. ostk/physics/test/environment/magnetic/test_earth.py +38 -0
  79. ostk/physics/test/environment/object/__init__.py +1 -0
  80. ostk/physics/test/environment/object/celestial/__init__ .py +1 -0
  81. ostk/physics/test/environment/object/celestial/test_earth.py +174 -0
  82. ostk/physics/test/environment/object/celestial/test_moon.py +17 -0
  83. ostk/physics/test/environment/object/celestial/test_sun.py +17 -0
  84. ostk/physics/test/environment/object/test_celestial.py +12 -0
  85. ostk/physics/test/test_environment.py +97 -0
  86. ostk/physics/test/test_import.py +25 -0
  87. ostk/physics/test/time/__init__.py +1 -0
  88. ostk/physics/test/time/test_date.py +136 -0
  89. ostk/physics/test/time/test_date_time.py +230 -0
  90. ostk/physics/test/time/test_duration.py +215 -0
  91. ostk/physics/test/time/test_instant.py +103 -0
  92. ostk/physics/test/time/test_interval.py +432 -0
  93. ostk/physics/test/time/test_scale.py +11 -0
  94. ostk/physics/test/time/test_time.py +114 -0
  95. ostk/physics/test/unit/__init__.py +1 -0
  96. ostk/physics/test/unit/derived/__init__.py +1 -0
  97. ostk/physics/test/unit/derived/test_angle.py +368 -0
  98. ostk/physics/test/unit/test_derived.py +152 -0
  99. ostk/physics/test/unit/test_electric_current.py +5 -0
  100. ostk/physics/test/unit/test_length.py +297 -0
  101. ostk/physics/test/unit/test_mass.py +141 -0
  102. ostk/physics/test/unit/test_time.py +101 -0
  103. ostk/physics/time.pyi +1744 -0
  104. ostk/physics/unit.pyi +1590 -0
@@ -0,0 +1,55 @@
1
+ # Apache License 2.0
2
+
3
+ import pytest
4
+
5
+ import numpy as np
6
+
7
+ from ostk.core.filesystem import Directory
8
+
9
+ from ostk.physics.time import Instant
10
+ from ostk.physics.environment.gravitational import Model as GravitationalModel
11
+ from ostk.physics.environment.gravitational import Moon as MoonGravitationalModel
12
+
13
+
14
+ @pytest.fixture
15
+ def moon_gravitational_model() -> MoonGravitationalModel:
16
+ return MoonGravitationalModel(MoonGravitationalModel.Type.Spherical)
17
+
18
+
19
+ class TestMoon:
20
+ def test_constructor_success_with_type(self):
21
+ assert isinstance(
22
+ MoonGravitationalModel(MoonGravitationalModel.Type.Spherical),
23
+ MoonGravitationalModel,
24
+ )
25
+ assert isinstance(
26
+ MoonGravitationalModel(MoonGravitationalModel.Type.Spherical),
27
+ GravitationalModel,
28
+ )
29
+
30
+ def test_constructor_success_with_directory(self):
31
+ moon_gravitational_model = MoonGravitationalModel(
32
+ MoonGravitationalModel.Type.Spherical, Directory.undefined()
33
+ )
34
+
35
+ assert isinstance(moon_gravitational_model, MoonGravitationalModel)
36
+ assert isinstance(moon_gravitational_model, GravitationalModel)
37
+
38
+ def test_get_type_success(self, moon_gravitational_model: MoonGravitationalModel):
39
+ assert (
40
+ moon_gravitational_model.get_type() == MoonGravitationalModel.Type.Spherical
41
+ )
42
+
43
+ def test_get_field_value_at_success(
44
+ self, moon_gravitational_model: MoonGravitationalModel
45
+ ):
46
+ grav_acceleration = moon_gravitational_model.get_field_value_at(
47
+ np.array([160000e3, 0.0, 0.0]), Instant.J2000()
48
+ )
49
+ grav_acceleration_ref = np.array([-0.000191515625, 0, 0])
50
+ assert all(
51
+ [
52
+ round(grav_acceleration[i], -7) == round(grav_acceleration_ref[i], -7)
53
+ for i in range(0, len(grav_acceleration_ref))
54
+ ]
55
+ )
@@ -0,0 +1,36 @@
1
+ # Apache License 2.0
2
+
3
+ import numpy as np
4
+
5
+ from ostk.physics.time import Instant
6
+ from ostk.physics.environment.gravitational import (
7
+ Spherical as SphericalGravitationalModel,
8
+ Earth as EarthGravitationalModel,
9
+ Model as GravitationalModel,
10
+ )
11
+
12
+
13
+ class TestSpherical:
14
+ def test_constructor_success(self):
15
+ spherical_gravitational_model = SphericalGravitationalModel(
16
+ EarthGravitationalModel.spherical
17
+ )
18
+
19
+ assert isinstance(spherical_gravitational_model, SphericalGravitationalModel)
20
+ assert isinstance(spherical_gravitational_model, GravitationalModel)
21
+
22
+ def test_get_field_value_at_success(self):
23
+ spherical_gravitational_model = SphericalGravitationalModel(
24
+ EarthGravitationalModel.spherical
25
+ )
26
+
27
+ grav_acceleration = spherical_gravitational_model.get_field_value_at(
28
+ np.array([6400e3, 0.0, 0.0]), Instant.J2000()
29
+ )
30
+ grav_acceleration_ref = np.array([-9.73145609, 0, 0])
31
+ assert all(
32
+ [
33
+ round(grav_acceleration[i], -7) == round(grav_acceleration_ref[i], -7)
34
+ for i in range(0, 2)
35
+ ]
36
+ )
@@ -0,0 +1,53 @@
1
+ # Apache License 2.0
2
+
3
+ import pytest
4
+
5
+ import numpy as np
6
+
7
+ from ostk.core.filesystem import Directory
8
+
9
+ from ostk.physics.time import Instant
10
+ from ostk.physics.environment.gravitational import Model as GravitationalModel
11
+ from ostk.physics.environment.gravitational import Sun as SunGravitationalModel
12
+
13
+
14
+ @pytest.fixture
15
+ def sun_gravitational_model() -> SunGravitationalModel:
16
+ return SunGravitationalModel(SunGravitationalModel.Type.Spherical)
17
+
18
+
19
+ class TestSun:
20
+ def test_constructor_success_with_type(self):
21
+ assert isinstance(
22
+ SunGravitationalModel(SunGravitationalModel.Type.Spherical),
23
+ SunGravitationalModel,
24
+ )
25
+ assert isinstance(
26
+ SunGravitationalModel(SunGravitationalModel.Type.Spherical),
27
+ GravitationalModel,
28
+ )
29
+
30
+ def test_constructor_success_with_directory(self):
31
+ sun_gravitational_model = SunGravitationalModel(
32
+ SunGravitationalModel.Type.Spherical, Directory.undefined()
33
+ )
34
+
35
+ assert isinstance(sun_gravitational_model, SunGravitationalModel)
36
+ assert isinstance(sun_gravitational_model, GravitationalModel)
37
+
38
+ def test_get_type_success(self, sun_gravitational_model: SunGravitationalModel):
39
+ assert sun_gravitational_model.get_type() == SunGravitationalModel.Type.Spherical
40
+
41
+ def test_get_field_value_at_success(
42
+ self, sun_gravitational_model: SunGravitationalModel
43
+ ):
44
+ grav_acceleration = sun_gravitational_model.get_field_value_at(
45
+ np.array([150000e9, 0.0, 0.0]), Instant.J2000()
46
+ )
47
+ grav_acceleration_ref = np.array([-0.00589833066746667, 0, 0])
48
+ assert all(
49
+ [
50
+ round(grav_acceleration[i], -7) == round(grav_acceleration_ref[i], -7)
51
+ for i in range(0, len(grav_acceleration_ref))
52
+ ]
53
+ )
@@ -0,0 +1 @@
1
+ # Apache License 2.0
@@ -0,0 +1,64 @@
1
+ # Apache License 2.0
2
+
3
+ import pytest
4
+
5
+ from ostk.core.filesystem import Path, Directory, PermissionSet
6
+
7
+ from ostk.physics.environment.magnetic import Earth as EarthMagneticModel
8
+ from ostk.physics.environment.magnetic.earth import (
9
+ Manager as EarthMagneticModelManager,
10
+ )
11
+
12
+
13
+ @pytest.fixture
14
+ def manager() -> EarthMagneticModelManager:
15
+ manager = EarthMagneticModelManager.get()
16
+
17
+ yield manager
18
+
19
+ # This reset is important so that other test modules are not affected
20
+ manager.reset()
21
+
22
+
23
+ class TestManager:
24
+ def test_get_mode_success(self, manager: EarthMagneticModelManager):
25
+ assert manager.get_mode() == EarthMagneticModelManager.Mode.Automatic
26
+
27
+ def test_has_data_files_for_type_success(self, manager: EarthMagneticModelManager):
28
+ assert manager.has_data_files_for_type(EarthMagneticModel.Type.EMM2010) == True
29
+
30
+ def test_get_local_repository_success(self, manager: EarthMagneticModelManager):
31
+ assert isinstance(manager.get_local_repository(), Directory)
32
+ assert len(str(manager.get_local_repository().to_string())) > 0
33
+
34
+ def test_fetch_data_files_for_type_success(self, manager: EarthMagneticModelManager):
35
+ test_directory = Directory.path(
36
+ manager.get_local_repository().get_path() + Path.parse("/test")
37
+ )
38
+ if test_directory.exists():
39
+ test_directory.remove()
40
+
41
+ test_directory.create(PermissionSet.rw(), PermissionSet.r(), PermissionSet.r())
42
+ manager.set_local_repository(test_directory)
43
+
44
+ manager.fetch_data_files_for_type(EarthMagneticModel.Type.EMM2010)
45
+
46
+ def test_set_mode_success(self, manager: EarthMagneticModelManager):
47
+ assert manager.get_mode() == EarthMagneticModelManager.Mode.Automatic
48
+
49
+ manager.set_mode(EarthMagneticModelManager.Mode.Manual)
50
+
51
+ assert manager.get_mode() == EarthMagneticModelManager.Mode.Manual
52
+
53
+ def test_set_local_repository_success(self, manager: EarthMagneticModelManager):
54
+ manager.set_local_repository(
55
+ Directory.path(
56
+ Path.parse("./.open-space-toolkit/physics/environment/magnetic/earth2")
57
+ )
58
+ )
59
+
60
+ assert isinstance(manager.get_local_repository(), Directory)
61
+ assert (
62
+ manager.get_local_repository().to_string()
63
+ == "./.open-space-toolkit/physics/environment/magnetic/earth2"
64
+ )
@@ -0,0 +1,38 @@
1
+ # Apache License 2.0
2
+
3
+ import pytest
4
+
5
+ import numpy as np
6
+
7
+ from ostk.core.filesystem import Directory
8
+
9
+ from ostk.physics.environment.magnetic import Earth as EarthMagneticModel
10
+ from ostk.physics.environment.object.celestial import Earth
11
+
12
+
13
+ @pytest.fixture
14
+ def earth_magnetic_model() -> EarthMagneticModel:
15
+ return EarthMagneticModel(EarthMagneticModel.Type.EMM2010)
16
+
17
+
18
+ class TestEarth:
19
+ def test_constructor_success_with_type(self):
20
+ earth_magnetic_model = EarthMagneticModel(
21
+ EarthMagneticModel.Type.EMM2010,
22
+ )
23
+
24
+ assert isinstance(earth_magnetic_model, EarthMagneticModel)
25
+
26
+ def test_constructor_success_with_directory(self):
27
+ earth_magnetic_model = EarthMagneticModel(
28
+ EarthMagneticModel.Type.EMM2010,
29
+ Directory.undefined(),
30
+ )
31
+
32
+ assert isinstance(earth_magnetic_model, EarthMagneticModel)
33
+
34
+ def test_get_type_success(self, earth_magnetic_model: EarthMagneticModel):
35
+ assert earth_magnetic_model.get_type() == EarthMagneticModel.Type.EMM2010
36
+
37
+ def test_is_defined_success(self, earth_magnetic_model: EarthMagneticModel):
38
+ assert earth_magnetic_model.is_defined() == True
@@ -0,0 +1 @@
1
+ # Apache License 2.0
@@ -0,0 +1 @@
1
+ # Apache License 2.0
@@ -0,0 +1,174 @@
1
+ # Apache License 2.0
2
+
3
+ import pytest
4
+
5
+ from ostk.core.filesystem import Directory
6
+
7
+ from ostk.physics.environment.object.celestial import Earth
8
+
9
+ from ostk.physics.environment.gravitational import Earth as EarthGravitationalModel
10
+ from ostk.physics.environment.atmospheric import Earth as EarthAtmosphericModel
11
+ from ostk.physics.environment.magnetic import Earth as EarthMagneticModel
12
+
13
+
14
+ @pytest.fixture
15
+ def earth():
16
+ return Earth.default()
17
+
18
+
19
+ class TestEarth:
20
+ def test_properties(self, earth):
21
+ assert earth.get_gravitational_parameter() is not None
22
+ assert earth.get_equatorial_radius() is not None
23
+ assert earth.get_flattening() is not None
24
+ assert earth.get_j2() is not None
25
+ assert earth.get_j4() is not None
26
+
27
+ def test_default_success(self, earth):
28
+ assert earth is not None
29
+ assert isinstance(earth, Earth)
30
+
31
+ def test_EGM2008_success(self):
32
+ earth = Earth.EGM2008()
33
+
34
+ assert earth is not None
35
+ assert isinstance(earth, Earth)
36
+
37
+ earth_custom: Earth = Earth.EGM2008(2190, 2160)
38
+
39
+ assert earth_custom is not None
40
+ assert isinstance(earth_custom, Earth)
41
+
42
+ def test_WGS84_EGM96_success(self):
43
+ earth = Earth.WGS84_EGM96()
44
+
45
+ assert earth is not None
46
+ assert isinstance(earth, Earth)
47
+
48
+ earth_custom: Earth = Earth.WGS84_EGM96(180, 180)
49
+
50
+ assert earth_custom is not None
51
+ assert isinstance(earth_custom, Earth)
52
+
53
+ def test_EGM96_success(self):
54
+ earth = Earth.EGM96()
55
+
56
+ assert earth is not None
57
+ assert isinstance(earth, Earth)
58
+
59
+ earth_custom: Earth = Earth.EGM96(360, 360)
60
+
61
+ assert earth_custom is not None
62
+ assert isinstance(earth_custom, Earth)
63
+
64
+ def test_EGM84_success(self):
65
+ earth = Earth.EGM84()
66
+
67
+ assert earth is not None
68
+ assert isinstance(earth, Earth)
69
+
70
+ earth_custom: Earth = Earth.EGM84(180, 180)
71
+
72
+ assert earth_custom is not None
73
+ assert isinstance(earth_custom, Earth)
74
+
75
+ def test_WGS84_success(self):
76
+ earth = Earth.WGS84()
77
+
78
+ assert earth is not None
79
+ assert isinstance(earth, Earth)
80
+
81
+ earth_custom: Earth = Earth.WGS84(20, 0)
82
+
83
+ assert earth is not None
84
+ assert isinstance(earth_custom, Earth)
85
+
86
+ def test_spherical_success(self):
87
+ earth = Earth.spherical()
88
+
89
+ assert earth is not None
90
+ assert isinstance(earth, Earth)
91
+
92
+ @pytest.mark.parametrize(
93
+ "grav_model_parameters,atmos_model_parameters,mag_model_parameters",
94
+ (
95
+ (
96
+ (
97
+ EarthGravitationalModel.Type.EGM2008,
98
+ Directory.undefined(),
99
+ 20,
100
+ 20,
101
+ ),
102
+ (EarthAtmosphericModel.Type.Exponential,),
103
+ (EarthMagneticModel.Type.Dipole,),
104
+ ),
105
+ (
106
+ (
107
+ EarthGravitationalModel.Type.EGM96,
108
+ Directory.undefined(),
109
+ 20,
110
+ 20,
111
+ ),
112
+ (EarthAtmosphericModel.Type.Exponential,),
113
+ (EarthMagneticModel.Type.Dipole,),
114
+ ),
115
+ (
116
+ (
117
+ EarthGravitationalModel.Type.EGM84,
118
+ Directory.undefined(),
119
+ 20,
120
+ 20,
121
+ ),
122
+ (EarthAtmosphericModel.Type.Exponential,),
123
+ (EarthMagneticModel.Type.Dipole,),
124
+ ),
125
+ (
126
+ (
127
+ EarthGravitationalModel.Type.WGS84_EGM96,
128
+ Directory.undefined(),
129
+ 20,
130
+ 20,
131
+ ),
132
+ (EarthAtmosphericModel.Type.Exponential,),
133
+ (EarthMagneticModel.Type.Dipole,),
134
+ ),
135
+ (
136
+ (
137
+ EarthGravitationalModel.Type.WGS84,
138
+ Directory.undefined(),
139
+ ),
140
+ (EarthAtmosphericModel.Type.Exponential,),
141
+ (EarthMagneticModel.Type.Dipole,),
142
+ ),
143
+ (
144
+ (EarthGravitationalModel.Type.Spherical, Directory.undefined()),
145
+ (EarthAtmosphericModel.Type.Exponential,),
146
+ (EarthMagneticModel.Type.Dipole,),
147
+ ),
148
+ ),
149
+ )
150
+ def test_from_models(
151
+ self,
152
+ grav_model_parameters: tuple,
153
+ atmos_model_parameters: tuple,
154
+ mag_model_parameters: tuple,
155
+ ):
156
+ earth = Earth.from_models(
157
+ EarthGravitationalModel(*grav_model_parameters),
158
+ EarthMagneticModel(*mag_model_parameters),
159
+ EarthAtmosphericModel(*atmos_model_parameters),
160
+ )
161
+ assert earth.is_defined()
162
+
163
+ def test_singular_model_static_constructors(self):
164
+ assert Earth.gravitational_only(
165
+ EarthGravitationalModel(EarthGravitationalModel.Type.EGM2008)
166
+ ).is_defined()
167
+ assert Earth.atmospheric_only(
168
+ EarthAtmosphericModel(
169
+ EarthAtmosphericModel.Type.Exponential,
170
+ )
171
+ ).is_defined()
172
+ assert Earth.magnetic_only(
173
+ EarthMagneticModel(EarthMagneticModel.Type.WMM2010)
174
+ ).is_defined()
@@ -0,0 +1,17 @@
1
+ # Apache License 2.0
2
+
3
+ from ostk.physics.environment.object.celestial import Moon
4
+
5
+
6
+ class TestMoon:
7
+ def test_default_success(self):
8
+ moon = Moon.default()
9
+
10
+ assert moon is not None
11
+ assert isinstance(moon, Moon)
12
+
13
+ def test_spherical_success(self):
14
+ moon = Moon.spherical()
15
+
16
+ assert moon is not None
17
+ assert isinstance(moon, Moon)
@@ -0,0 +1,17 @@
1
+ # Apache License 2.0
2
+
3
+ from ostk.physics.environment.object.celestial import Sun
4
+
5
+
6
+ class TestSun:
7
+ def test_default_success(self):
8
+ sun = Sun.default()
9
+
10
+ assert sun is not None
11
+ assert isinstance(sun, Sun)
12
+
13
+ def test_spherical_success(self):
14
+ sun = Sun.spherical()
15
+
16
+ assert sun is not None
17
+ assert isinstance(sun, Sun)
@@ -0,0 +1,12 @@
1
+ # Apache License 2.0
2
+
3
+ from ostk.physics.environment.object.celestial import Earth
4
+
5
+
6
+ class TestCelestial:
7
+ def test_model_is_defined_success(self):
8
+ earth = Earth.spherical()
9
+
10
+ assert earth.gravitational_model_is_defined() is True
11
+ assert earth.magnetic_model_is_defined() is False
12
+ assert earth.atmospheric_model_is_defined() is False
@@ -0,0 +1,97 @@
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
7
+ from ostk.physics import Environment
8
+
9
+
10
+ @pytest.fixture
11
+ def environment() -> Environment:
12
+ return Environment.default()
13
+
14
+
15
+ class TestEnvironment:
16
+
17
+ def test_constructors(self):
18
+ instant = Instant.date_time(DateTime(2019, 1, 1, 0, 0, 0), Scale.UTC)
19
+ objects = []
20
+
21
+ env: Environment = Environment(instant, objects)
22
+
23
+ assert env is not None
24
+ assert isinstance(env, Environment)
25
+
26
+ env = Environment(instant, objects, set_global_instance=True)
27
+
28
+ assert env is not None
29
+ assert isinstance(env, Environment)
30
+
31
+ def test_undefined(self):
32
+ assert Environment.undefined() is not None
33
+ assert Environment.undefined().is_defined() is False
34
+
35
+ def test_default(self):
36
+ assert Environment.default() is not None
37
+ assert Environment.default(set_global_instance=True) is not None
38
+
39
+ def test_is_defined(self, environment: Environment):
40
+ assert environment.is_defined() is not None
41
+
42
+ def test_has_object_with_name(self, environment: Environment):
43
+ assert environment.has_object_with_name("Earth") is not None
44
+
45
+ @pytest.mark.skip
46
+ def test_intersects(self, environment: Environment):
47
+ assert environment.intersects() is not None
48
+
49
+ def test_access_objects(self, environment: Environment):
50
+ assert environment.access_objects() is not None
51
+
52
+ def test_access_object_with_name(self, environment: Environment):
53
+ assert environment.access_object_with_name("Earth") is not None
54
+
55
+ def test_access_celestial_object_with_name(self, environment: Environment):
56
+ assert environment.access_celestial_object_with_name("Earth") is not None
57
+
58
+ def test_get_instant(self, environment: Environment):
59
+ assert environment.get_instant() is not None
60
+
61
+ def test_get_object_names(self, environment: Environment):
62
+ assert environment.get_object_names() is not None
63
+
64
+ def test_set_instant(self, environment: Environment):
65
+ environment.set_instant(
66
+ Instant.date_time(DateTime(2019, 1, 1, 0, 0, 0), Scale.UTC)
67
+ )
68
+
69
+ def test_is_position_in_eclipse(self, environment: Environment):
70
+ environment.set_instant(
71
+ Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
72
+ )
73
+
74
+ assert environment.is_position_in_eclipse(
75
+ Position.meters(
76
+ [7000e3, 0.0, 0.0],
77
+ Frame.ITRF(),
78
+ )
79
+ )
80
+
81
+ def test_access_global_instance(self):
82
+ with pytest.raises(RuntimeError):
83
+ Environment.access_global_instance()
84
+
85
+ Environment.default(set_global_instance=True)
86
+
87
+ assert Environment.access_global_instance() is not None
88
+
89
+ def test_has_global_instance(self):
90
+ assert Environment.has_global_instance() is False
91
+
92
+ Environment.default(set_global_instance=True)
93
+
94
+ assert Environment.has_global_instance() is True
95
+
96
+ def teardown_method(self, method):
97
+ Environment.reset_global_instance()
@@ -0,0 +1,25 @@
1
+ # Apache License 2.0
2
+
3
+ import pytest
4
+
5
+ import ostk.mathematics as mathematics
6
+ import ostk.physics as physics
7
+
8
+
9
+ def test_import():
10
+ Point = mathematics.geometry.d3.object.Point
11
+ Segment = mathematics.geometry.d3.object.Segment
12
+
13
+ Scale = physics.time.Scale
14
+ Instant = physics.time.Instant
15
+ Duration = physics.time.Duration
16
+ Interval = physics.time.Interval
17
+ Date = physics.time.Date
18
+ Time = physics.time.Time
19
+ DateTime = physics.time.DateTime
20
+ Frame = physics.coordinate.Frame
21
+ Environment = physics.Environment
22
+ Object = physics.environment.Object
23
+ Geometry = physics.environment.object.Geometry
24
+ Celestial = physics.environment.object.Celestial
25
+ Earth = physics.environment.object.celestial.Earth
@@ -0,0 +1 @@
1
+ # Apache License 2.0