open-space-toolkit-astrodynamics 12.2.1__py312-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.
- open_space_toolkit_astrodynamics-12.2.1.dist-info/METADATA +30 -0
- open_space_toolkit_astrodynamics-12.2.1.dist-info/RECORD +100 -0
- open_space_toolkit_astrodynamics-12.2.1.dist-info/WHEEL +5 -0
- open_space_toolkit_astrodynamics-12.2.1.dist-info/top_level.txt +1 -0
- open_space_toolkit_astrodynamics-12.2.1.dist-info/zip-safe +1 -0
- ostk/__init__.py +1 -0
- ostk/astrodynamics/OpenSpaceToolkitAstrodynamicsPy.cpython-312-aarch64-linux-gnu.so +0 -0
- ostk/astrodynamics/__init__.py +11 -0
- ostk/astrodynamics/converters.py +128 -0
- ostk/astrodynamics/dataframe.py +477 -0
- ostk/astrodynamics/display.py +220 -0
- ostk/astrodynamics/libopen-space-toolkit-astrodynamics.so.12 +0 -0
- ostk/astrodynamics/pytrajectory/__init__.py +1 -0
- ostk/astrodynamics/pytrajectory/pystate.py +220 -0
- ostk/astrodynamics/test/__init__.py +1 -0
- ostk/astrodynamics/test/access/__init__.py +1 -0
- ostk/astrodynamics/test/access/test_generator.py +248 -0
- ostk/astrodynamics/test/conftest.py +119 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/__init__.py +1 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/conftest.py +325 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/data/cdm.json +303 -0
- ostk/astrodynamics/test/conjunction/message/ccsds/test_cdm.py +416 -0
- ostk/astrodynamics/test/dynamics/__init__.py +1 -0
- ostk/astrodynamics/test/dynamics/data/Tabulated_Earth_Gravity.csv +565 -0
- ostk/astrodynamics/test/dynamics/data/Tabulated_Earth_Gravity_Truth.csv +100 -0
- ostk/astrodynamics/test/dynamics/test_atmospheric_drag.py +128 -0
- ostk/astrodynamics/test/dynamics/test_central_body_gravity.py +58 -0
- ostk/astrodynamics/test/dynamics/test_dynamics.py +50 -0
- ostk/astrodynamics/test/dynamics/test_position_derivative.py +51 -0
- ostk/astrodynamics/test/dynamics/test_tabulated.py +138 -0
- ostk/astrodynamics/test/dynamics/test_third_body_gravity.py +67 -0
- ostk/astrodynamics/test/dynamics/test_thruster.py +142 -0
- ostk/astrodynamics/test/event_condition/test_angular_condition.py +113 -0
- ostk/astrodynamics/test/event_condition/test_boolean_condition.py +55 -0
- ostk/astrodynamics/test/event_condition/test_coe_condition.py +87 -0
- ostk/astrodynamics/test/event_condition/test_instant_condition.py +48 -0
- ostk/astrodynamics/test/event_condition/test_logical_condition.py +120 -0
- ostk/astrodynamics/test/event_condition/test_real_condition.py +50 -0
- ostk/astrodynamics/test/flight/__init__.py +1 -0
- ostk/astrodynamics/test/flight/system/__init__.py +1 -0
- ostk/astrodynamics/test/flight/system/test_propulsion_system.py +73 -0
- ostk/astrodynamics/test/flight/system/test_satellite_system.py +91 -0
- ostk/astrodynamics/test/flight/system/test_satellite_system_builder.py +71 -0
- ostk/astrodynamics/test/flight/test_maneuver.py +212 -0
- ostk/astrodynamics/test/flight/test_profile.py +242 -0
- ostk/astrodynamics/test/flight/test_system.py +55 -0
- ostk/astrodynamics/test/guidance_law/test_constant_thrust.py +91 -0
- ostk/astrodynamics/test/guidance_law/test_qlaw.py +138 -0
- ostk/astrodynamics/test/solvers/__init__.py +1 -0
- ostk/astrodynamics/test/solvers/test_finite_difference_solver.py +181 -0
- ostk/astrodynamics/test/solvers/test_temporal_condition_solver.py +153 -0
- ostk/astrodynamics/test/test_access.py +128 -0
- ostk/astrodynamics/test/test_converters.py +290 -0
- ostk/astrodynamics/test/test_dataframe.py +875 -0
- ostk/astrodynamics/test/test_display.py +114 -0
- ostk/astrodynamics/test/test_event_condition.py +58 -0
- ostk/astrodynamics/test/test_import.py +26 -0
- ostk/astrodynamics/test/test_root_solver.py +70 -0
- ostk/astrodynamics/test/test_trajectory.py +118 -0
- ostk/astrodynamics/test/test_utilities.py +106 -0
- ostk/astrodynamics/test/test_viewer.py +129 -0
- ostk/astrodynamics/test/trajectory/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/message/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/conftest.py +18 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/data/opm_1.yaml +44 -0
- ostk/astrodynamics/test/trajectory/orbit/message/spacex/test_opm.py +108 -0
- ostk/astrodynamics/test/trajectory/orbit/models/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean.py +65 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean_long.py +102 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_brouwer_lyddane_mean_short.py +102 -0
- ostk/astrodynamics/test/trajectory/orbit/models/kepler/test_coe.py +180 -0
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/__init__.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/sgp4/test_tle.py +331 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_kepler.py +130 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_propagated.py +234 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_sgp4.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/models/test_tabulated.py +380 -0
- ostk/astrodynamics/test/trajectory/orbit/test_model.py +1 -0
- ostk/astrodynamics/test/trajectory/orbit/test_pass.py +75 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_angular_velocity.py +30 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_attitude_quaternion.py +18 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_position.py +107 -0
- ostk/astrodynamics/test/trajectory/state/coordinate_subset/test_cartesian_velocity.py +115 -0
- ostk/astrodynamics/test/trajectory/state/test_coordinate_broker.py +84 -0
- ostk/astrodynamics/test/trajectory/state/test_coordinate_subset.py +46 -0
- ostk/astrodynamics/test/trajectory/state/test_numerical_solver.py +314 -0
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_direction.py +81 -0
- ostk/astrodynamics/test/trajectory/test_local_orbital_frame_factory.py +108 -0
- ostk/astrodynamics/test/trajectory/test_model.py +1 -0
- ostk/astrodynamics/test/trajectory/test_orbit.py +196 -0
- ostk/astrodynamics/test/trajectory/test_propagator.py +458 -0
- ostk/astrodynamics/test/trajectory/test_segment.py +305 -0
- ostk/astrodynamics/test/trajectory/test_sequence.py +477 -0
- ostk/astrodynamics/test/trajectory/test_state.py +467 -0
- ostk/astrodynamics/test/trajectory/test_state_builder.py +171 -0
- ostk/astrodynamics/utilities.py +245 -0
- ostk/astrodynamics/viewer.py +392 -0
@@ -0,0 +1,100 @@
|
|
1
|
+
2023-01-01T00:32:48.111089,1.7191483402327778,-4.555695618883114,-6.870204125790202
|
2
|
+
2023-01-01T00:19:29.459534,0.6238974331671631,2.4463543889353314,-8.018208336636835
|
3
|
+
2023-01-01T00:04:09.215794,-1.1266971898009275,8.030698634105178,-2.278378122073309
|
4
|
+
2023-01-01T00:50:31.618217,1.2211976307223766,-8.163082723958349,1.7754569691644122
|
5
|
+
2023-01-01T01:13:11.556113,-1.2738169874249923,1.030366747921056,8.248604915195754
|
6
|
+
2023-01-01T00:14:50.679103,0.07724202808611891,4.729170491836577,-6.954058816144306
|
7
|
+
2023-01-01T00:18:45.802420,0.5409334646601992,2.8244395409078473,-7.899448991107787
|
8
|
+
2023-01-01T00:56:58.873129,0.5426187466838862,-6.7567029107513585,5.0174759508932985
|
9
|
+
2023-01-01T01:16:15.961482,-1.5116470711025858,2.6700801510740413,7.8311644209397295
|
10
|
+
2023-01-01T01:13:50.455156,-1.3286734668163875,1.3820025202782518,8.188342483703309
|
11
|
+
2023-01-01T00:09:54.817808,-0.5107984138222772,6.667949349042532,-5.110380980021721
|
12
|
+
2023-01-01T01:29:38.472976,-1.7510821943533392,7.780980568267226,2.7219337108416783
|
13
|
+
2023-01-01T00:36:28.648177,1.81694458577409,-6.101254983555447,-5.52474683715429
|
14
|
+
2023-01-01T00:06:10.037691,-0.9255700188600137,7.679552998146506,-3.3297731246095985
|
15
|
+
2023-01-01T00:40:33.018697,1.7993441563244328,-7.392044708689084,-3.6479557442598662
|
16
|
+
2023-01-01T00:19:11.901712,0.5906951503274656,2.5991289518356875,-7.972657778620277
|
17
|
+
2023-01-01T01:17:53.160545,-1.6126944907261054,3.495000450621351,7.479881720219948
|
18
|
+
2023-01-01T01:08:18.578209,-0.7933635501867621,-1.634246582808268,8.214070725173318
|
19
|
+
2023-01-01T00:16:38.199758,0.29190381793323983,3.889584301619638,-7.448778148556464
|
20
|
+
2023-01-01T01:22:47.082217,-1.8025044560261774,5.713166568833113,5.914413404714071
|
21
|
+
2023-01-01T00:02:16.676982,-1.2960063057051228,8.22818665192824,-1.2610482446266043
|
22
|
+
2023-01-01T00:36:42.990626,1.819614036970772,-6.190291796117674,-5.424727731591136
|
23
|
+
2023-01-01T01:24:06.079061,-1.8218808866162588,6.216984212477381,5.378778557119372
|
24
|
+
2023-01-01T00:37:36.565536,1.8255157090572625,-6.509024155524373,-5.038974163886144
|
25
|
+
2023-01-01T00:18:33.739507,0.5177790032383944,2.9278114028805,-7.86340402515843
|
26
|
+
2023-01-01T01:26:44.190104,-1.81890472901968,7.080332826750333,4.186100446805546
|
27
|
+
2023-01-01T00:41:46.359296,1.7679968901673206,-7.677764229340302,-3.0244060887920083
|
28
|
+
2023-01-01T01:18:17.911011,-1.6355316647000262,3.6991212585301536,7.376516334826665
|
29
|
+
2023-01-01T00:41:16.891529,1.7820212548741827,-7.568973572384791,-3.2776630025193447
|
30
|
+
2023-01-01T00:09:22.975184,-0.5720342957180323,6.83783683778748,-4.8751980355200395
|
31
|
+
2023-01-01T01:21:38.286553,-1.774466446193131,5.2391387688162,6.343884518172145
|
32
|
+
2023-01-01T01:28:39.707876,-1.7814331500221776,7.575967606602878,3.230054461718644
|
33
|
+
2023-01-01T00:00:03.274942,-1.47034510372926,8.295708671847907,-0.030392722591221555
|
34
|
+
2023-01-01T00:09:23.790810,-0.5704740694512678,6.833589637504542,-4.881299953765859
|
35
|
+
2023-01-01T00:36:37.621787,1.8186685101360809,-6.157142185461976,-5.462332848807409
|
36
|
+
2023-01-01T01:11:01.870554,-1.0746924186421478,-0.15203487177915992,8.340008986773853
|
37
|
+
2023-01-01T01:10:41.760623,-1.0417477509867208,-0.33574957977437886,8.339001338110384
|
38
|
+
2023-01-01T00:39:22.664930,1.8181632718663985,-7.072016081771035,-4.222856119194648
|
39
|
+
2023-01-01T01:18:10.438685,-1.6287637718649006,3.6377745450854726,7.408307145002938
|
40
|
+
2023-01-01T01:11:45.758216,-1.1447381144557693,0.2490003551704275,8.328029617611113
|
41
|
+
2023-01-01T00:03:09.954666,-1.2182103971287508,8.1505528611445,-1.7461808599416948
|
42
|
+
2023-01-01T01:03:33.360775,-0.24574332890186396,-4.073949551646664,7.3646764431369425
|
43
|
+
2023-01-01T01:25:05.714534,-1.8273265204381757,6.566342430029487,4.946642956140148
|
44
|
+
2023-01-01T01:07:04.921685,-0.6574468730190839,-2.2889633707969215,8.07003344837744
|
45
|
+
2023-01-01T01:02:34.648231,-0.12798889967184093,-4.534885206678296,7.095528327011042
|
46
|
+
2023-01-01T00:29:26.058188,1.5406948634595339,-2.9057691015200944,-7.7444982061425796
|
47
|
+
2023-01-01T01:13:48.240783,-1.32561485532992,1.3620467997330408,8.192176405095616
|
48
|
+
2023-01-01T01:14:22.732652,-1.3723564928897094,1.6719017396232245,8.12695577172407
|
49
|
+
2023-01-01T01:28:07.955409,-1.794682387845881,7.451759731979377,3.498914172064998
|
50
|
+
2023-01-01T01:29:09.806441,-1.7668287629806183,7.685047738938106,2.9714173958457297
|
51
|
+
2023-01-01T00:14:40.405281,0.05661814152732203,4.806140595508472,-6.901527293860264
|
52
|
+
2023-01-01T00:02:59.529352,-1.2337770025487564,8.168000561755798,-1.6516886104461637
|
53
|
+
2023-01-01T00:17:52.929006,0.4387823285234988,3.273656898006285,-7.731203070982043
|
54
|
+
2023-01-01T00:37:20.140923,1.8243904048788335,-6.413674074117644,-5.159226953292578
|
55
|
+
2023-01-01T01:14:15.185065,-1.3622941776032367,1.6042868682527216,8.142230738006791
|
56
|
+
2023-01-01T00:50:14.928549,1.2462391448540813,-8.191096194619089,1.6235260936068399
|
57
|
+
2023-01-01T00:54:18.078452,0.8438690012216613,-7.510307689400575,3.7530975063392926
|
58
|
+
2023-01-01T00:24:45.783061,1.170765487597374,-0.40510125791105195,-8.315731169633908
|
59
|
+
2023-01-01T00:01:57.258712,-1.3232480046139794,8.249324424806995,-1.083015537034382
|
60
|
+
2023-01-01T00:31:54.180460,1.6794984333834824,-4.133694833169659,-7.139223271080013
|
61
|
+
2023-01-01T00:55:30.125892,0.7115883361846516,-7.200754421519785,4.337237003779269
|
62
|
+
2023-01-01T00:36:57.892352,1.821901014475061,-6.281163112092906,-5.319330437589282
|
63
|
+
2023-01-01T00:33:51.622870,1.7580630573062552,-5.032277834205399,-6.521877891766843
|
64
|
+
2023-01-01T00:34:04.467434,1.7648924160586155,-5.125778759239188,-6.447419853493752
|
65
|
+
2023-01-01T01:09:04.917664,-0.8762254698811187,-1.2167727443880545,8.277037715967362
|
66
|
+
2023-01-01T00:47:07.256764,1.4963027685774042,-8.30945437393638,-0.11174246550736944
|
67
|
+
2023-01-01T01:14:17.941792,-1.3659802690739893,1.62899585141857,8.136716625150598
|
68
|
+
2023-01-01T01:23:57.643477,-1.8204708790140682,6.165362658686394,5.438032100406363
|
69
|
+
2023-01-01T01:00:49.239798,0.0846635778157603,-5.314235536822394,6.537597576067294
|
70
|
+
2023-01-01T00:12:59.383450,-0.14622617561060303,5.528963023009678,-6.338553429161853
|
71
|
+
2023-01-01T00:59:34.036082,0.2360525573480611,-5.827457645598424,6.084224374179853
|
72
|
+
2023-01-01T00:16:50.319634,0.3158902220543037,3.791347320799506,-7.498075779805581
|
73
|
+
2023-01-01T00:54:29.850437,0.8225962729982531,-7.462953557570155,3.850322112463583
|
74
|
+
2023-01-01T00:18:58.868560,0.5659046813134986,2.7119175973396223,-7.936918851902513
|
75
|
+
2023-01-01T00:22:39.959866,0.966607474078619,0.7427913375497692,-8.317342839594108
|
76
|
+
2023-01-01T00:12:24.885698,-0.21524189511294337,5.760654526872627,-6.127746188639201
|
77
|
+
2023-01-01T01:19:55.293661,-1.713473899311241,4.474542090705336,6.917058877465153
|
78
|
+
2023-01-01T01:02:34.841429,-0.1283776697860189,-4.533398055476473,7.096463945200756
|
79
|
+
2023-01-01T01:24:26.881579,-1.8246813859760056,6.34198044725019,5.230639012961589
|
80
|
+
2023-01-01T00:48:06.706757,1.4236793475675074,-8.311258723592259,0.44111489270093
|
81
|
+
2023-01-01T01:15:27.369926,-1.4546069261914814,2.2458277989541213,7.973304783132094
|
82
|
+
2023-01-01T00:23:17.727067,1.029996623425181,0.39878582535594054,-8.333606866801693
|
83
|
+
2023-01-01T00:55:49.580884,0.6750680547030987,-7.109211585456708,4.490269297918056
|
84
|
+
2023-01-01T00:39:35.816861,1.8154879094985326,-7.135167767076911,-4.117282141102992
|
85
|
+
2023-01-01T01:04:38.508759,-0.3750890100989724,-3.5430011149263043,7.626834980404639
|
86
|
+
2023-01-01T01:03:54.914742,-0.2887198770867451,-3.9004323479387115,7.455719463454102
|
87
|
+
2023-01-01T01:21:36.577068,-1.7736388504169218,5.226967213290195,6.354095014393573
|
88
|
+
2023-01-01T01:01:37.871278,-0.013517439414202406,-4.962863103470826,6.806620441923002
|
89
|
+
2023-01-01T00:12:27.523238,-0.20997429977853144,5.743228519583462,-6.14418419597112
|
90
|
+
2023-01-01T00:02:09.572782,-1.306043283425021,8.236365025202598,-1.1959798600505176
|
91
|
+
2023-01-01T01:21:43.010872,-1.7767207630574982,5.272679845998315,6.3155481925931465
|
92
|
+
2023-01-01T00:50:13.720404,1.2480353327546196,-8.193014267839473,1.612505010356864
|
93
|
+
2023-01-01T00:30:04.698667,1.5810014652662085,-3.2346834458753,-7.606039947863848
|
94
|
+
2023-01-01T01:09:03.789328,-0.8742342596169408,-1.2269783418420623,8.275759789420542
|
95
|
+
2023-01-01T00:52:55.175125,0.989450079120868,-7.807061861374834,3.050775469694659
|
96
|
+
2023-01-01T00:17:00.658814,0.3363066999728969,3.7070166772459356,-7.539070284272322
|
97
|
+
2023-01-01T00:49:27.260499,1.3153696787702975,-8.25548046612535,1.186603191701913
|
98
|
+
2023-01-01T00:34:28.705749,1.7768144844622977,-5.299438203808603,-6.3033355963313635
|
99
|
+
2023-01-01T00:12:33.820544,-0.19739093265368807,5.7014278656941295,-6.183218103392741
|
100
|
+
2023-01-01T00:47:28.273901,1.471364002367263,-8.314267567435394,0.08377659463283968
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# Apache License 2.0
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
import numpy as np
|
6
|
+
|
7
|
+
from ostk.mathematics.geometry.d3.object import Cuboid
|
8
|
+
from ostk.mathematics.geometry.d3.object import Composite
|
9
|
+
from ostk.mathematics.geometry.d3.object import Point
|
10
|
+
|
11
|
+
from ostk.physics.unit 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.object.celestial import Earth
|
22
|
+
|
23
|
+
from ostk.astrodynamics.trajectory.state import CoordinateSubset
|
24
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianPosition
|
25
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianVelocity
|
26
|
+
from ostk.astrodynamics.trajectory.state import CoordinateBroker
|
27
|
+
|
28
|
+
from ostk.astrodynamics.trajectory import State
|
29
|
+
from ostk.astrodynamics.trajectory.state import CoordinateSubset, CoordinateBroker
|
30
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import (
|
31
|
+
CartesianPosition,
|
32
|
+
CartesianVelocity,
|
33
|
+
)
|
34
|
+
from ostk.astrodynamics import Dynamics
|
35
|
+
from ostk.astrodynamics.dynamics import AtmosphericDrag
|
36
|
+
|
37
|
+
|
38
|
+
@pytest.fixture
|
39
|
+
def earth() -> Earth:
|
40
|
+
return Earth.from_models(
|
41
|
+
EarthGravitationalModel(EarthGravitationalModel.Type.Undefined),
|
42
|
+
EarthMagneticModel(EarthMagneticModel.Type.Undefined),
|
43
|
+
EarthAtmosphericModel(EarthAtmosphericModel.Type.Exponential),
|
44
|
+
)
|
45
|
+
|
46
|
+
|
47
|
+
@pytest.fixture
|
48
|
+
def dry_mass() -> float:
|
49
|
+
return 100.0
|
50
|
+
|
51
|
+
|
52
|
+
@pytest.fixture
|
53
|
+
def surface_area() -> float:
|
54
|
+
return 500.0
|
55
|
+
|
56
|
+
|
57
|
+
@pytest.fixture
|
58
|
+
def drag_coefficient() -> float:
|
59
|
+
return 2.1
|
60
|
+
|
61
|
+
|
62
|
+
@pytest.fixture
|
63
|
+
def dynamics(earth: Earth) -> AtmosphericDrag:
|
64
|
+
return AtmosphericDrag(earth)
|
65
|
+
|
66
|
+
|
67
|
+
@pytest.fixture
|
68
|
+
def coordinate_broker() -> CoordinateBroker:
|
69
|
+
return CoordinateBroker(
|
70
|
+
[
|
71
|
+
CartesianPosition.default(),
|
72
|
+
CartesianVelocity.default(),
|
73
|
+
CoordinateSubset.mass(),
|
74
|
+
CoordinateSubset.surface_area(),
|
75
|
+
CoordinateSubset.drag_coefficient(),
|
76
|
+
]
|
77
|
+
)
|
78
|
+
|
79
|
+
|
80
|
+
@pytest.fixture
|
81
|
+
def instant() -> Instant:
|
82
|
+
return Instant.date_time(DateTime(2021, 3, 20, 12, 0, 0), Scale.UTC)
|
83
|
+
|
84
|
+
|
85
|
+
@pytest.fixture
|
86
|
+
def position_coordinates() -> list:
|
87
|
+
return [7000000.0, 0.0, 0.0]
|
88
|
+
|
89
|
+
|
90
|
+
@pytest.fixture
|
91
|
+
def velocity_coordinates() -> list:
|
92
|
+
return [0.0, 7546.05329, 0.0]
|
93
|
+
|
94
|
+
|
95
|
+
@pytest.fixture
|
96
|
+
def state(
|
97
|
+
instant: Instant,
|
98
|
+
position_coordinates: list,
|
99
|
+
velocity_coordinates: list,
|
100
|
+
dry_mass: float,
|
101
|
+
surface_area: float,
|
102
|
+
drag_coefficient: float,
|
103
|
+
coordinate_broker: CoordinateBroker,
|
104
|
+
) -> State:
|
105
|
+
coordinates = (
|
106
|
+
position_coordinates
|
107
|
+
+ velocity_coordinates
|
108
|
+
+ [dry_mass, surface_area, drag_coefficient]
|
109
|
+
)
|
110
|
+
return State(instant, coordinates, Frame.GCRF(), coordinate_broker)
|
111
|
+
|
112
|
+
|
113
|
+
class TestAtmosphericDrag:
|
114
|
+
def test_constructors(self, dynamics: AtmosphericDrag):
|
115
|
+
assert dynamics is not None
|
116
|
+
assert isinstance(dynamics, AtmosphericDrag)
|
117
|
+
assert isinstance(dynamics, Dynamics)
|
118
|
+
assert dynamics.is_defined()
|
119
|
+
|
120
|
+
def test_getters(self, dynamics: AtmosphericDrag, earth: Earth):
|
121
|
+
assert dynamics.get_celestial() == earth
|
122
|
+
|
123
|
+
def test_compute_contribution(self, dynamics: AtmosphericDrag, state: State):
|
124
|
+
contribution = dynamics.compute_contribution(
|
125
|
+
state.get_instant(), state.get_coordinates(), state.get_frame()
|
126
|
+
)
|
127
|
+
|
128
|
+
assert len(contribution) == 3
|
@@ -0,0 +1,58 @@
|
|
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.object.celestial import Earth
|
14
|
+
|
15
|
+
from ostk.astrodynamics.trajectory import State
|
16
|
+
from ostk.astrodynamics import Dynamics
|
17
|
+
from ostk.astrodynamics.dynamics import CentralBodyGravity
|
18
|
+
|
19
|
+
|
20
|
+
@pytest.fixture
|
21
|
+
def earth() -> Earth:
|
22
|
+
return Earth.spherical()
|
23
|
+
|
24
|
+
|
25
|
+
@pytest.fixture
|
26
|
+
def dynamics(earth: Earth) -> CentralBodyGravity:
|
27
|
+
return CentralBodyGravity(earth)
|
28
|
+
|
29
|
+
|
30
|
+
@pytest.fixture
|
31
|
+
def state() -> State:
|
32
|
+
frame: Frame = Frame.GCRF()
|
33
|
+
position: Position = Position.meters([7000000.0, 0.0, 0.0], frame)
|
34
|
+
velocity: Velocity = Velocity.meters_per_second([0.0, 0.0, 0.0], frame)
|
35
|
+
instant = Instant.date_time(DateTime(2021, 3, 20, 12, 0, 0), Scale.UTC)
|
36
|
+
return State(instant, position, velocity)
|
37
|
+
|
38
|
+
|
39
|
+
class TestCentralBodyGravity:
|
40
|
+
def test_constructors(
|
41
|
+
self,
|
42
|
+
dynamics: CentralBodyGravity,
|
43
|
+
):
|
44
|
+
assert dynamics is not None
|
45
|
+
assert isinstance(dynamics, CentralBodyGravity)
|
46
|
+
assert isinstance(dynamics, Dynamics)
|
47
|
+
assert dynamics.is_defined()
|
48
|
+
|
49
|
+
def test_getters(self, dynamics: CentralBodyGravity, earth: Earth):
|
50
|
+
assert dynamics.get_celestial() == earth
|
51
|
+
|
52
|
+
def test_compute_contribution(self, dynamics: CentralBodyGravity, state: State):
|
53
|
+
contribution = dynamics.compute_contribution(
|
54
|
+
state.get_instant(), state.get_coordinates(), state.get_frame()
|
55
|
+
)
|
56
|
+
|
57
|
+
assert len(contribution) == 3
|
58
|
+
assert contribution == pytest.approx([-8.134702887755102, 0.0, 0.0])
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Apache License 2.0
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
from ostk.physics import Environment
|
6
|
+
|
7
|
+
from ostk.astrodynamics import Dynamics
|
8
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianPosition
|
9
|
+
|
10
|
+
|
11
|
+
@pytest.fixture
|
12
|
+
def name() -> str:
|
13
|
+
return "MyDynamics"
|
14
|
+
|
15
|
+
|
16
|
+
@pytest.fixture
|
17
|
+
def environment() -> Environment:
|
18
|
+
return Environment.default()
|
19
|
+
|
20
|
+
|
21
|
+
@pytest.fixture
|
22
|
+
def dynamics(name: str) -> Dynamics:
|
23
|
+
class MyDynamics(Dynamics):
|
24
|
+
def is_defined():
|
25
|
+
return True
|
26
|
+
|
27
|
+
def get_read_coordinate_subsets(self):
|
28
|
+
return [CartesianPosition.default()]
|
29
|
+
|
30
|
+
def get_write_coordinate_subsets(self):
|
31
|
+
return [CartesianPosition.default()]
|
32
|
+
|
33
|
+
def compute_contribution(self, instant, state_vector, frame):
|
34
|
+
return state_vector
|
35
|
+
|
36
|
+
return MyDynamics(name)
|
37
|
+
|
38
|
+
|
39
|
+
class TestDynamics:
|
40
|
+
def test_subclass(self, dynamics: Dynamics):
|
41
|
+
assert dynamics is not None
|
42
|
+
|
43
|
+
def test_get_name(self, dynamics: Dynamics, name: str):
|
44
|
+
assert dynamics.get_name() == name
|
45
|
+
|
46
|
+
def test_from_environment(self, environment: Environment):
|
47
|
+
dynamics: list[Dynamics] = Dynamics.from_environment(environment)
|
48
|
+
|
49
|
+
assert dynamics is not None
|
50
|
+
assert isinstance(dynamics, list)
|
@@ -0,0 +1,51 @@
|
|
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.object.celestial import Earth
|
14
|
+
|
15
|
+
from ostk.astrodynamics.trajectory import State
|
16
|
+
from ostk.astrodynamics import Dynamics
|
17
|
+
from ostk.astrodynamics.dynamics import PositionDerivative
|
18
|
+
|
19
|
+
|
20
|
+
@pytest.fixture
|
21
|
+
def dynamics() -> PositionDerivative:
|
22
|
+
return PositionDerivative()
|
23
|
+
|
24
|
+
|
25
|
+
@pytest.fixture
|
26
|
+
def state() -> State:
|
27
|
+
frame: Frame = Frame.GCRF()
|
28
|
+
position: Position = Position.meters([7500000.0, 0.0, 0.0], frame)
|
29
|
+
velocity: Velocity = Velocity.meters_per_second(
|
30
|
+
[0.0, 5335.865450622126, 5335.865450622126], frame
|
31
|
+
)
|
32
|
+
instant = Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0), Scale.UTC)
|
33
|
+
return State(instant, position, velocity)
|
34
|
+
|
35
|
+
|
36
|
+
class TestPositionDerivative:
|
37
|
+
def test_constructors(
|
38
|
+
self,
|
39
|
+
dynamics: PositionDerivative,
|
40
|
+
):
|
41
|
+
assert dynamics is not None
|
42
|
+
assert isinstance(dynamics, PositionDerivative)
|
43
|
+
assert isinstance(dynamics, Dynamics)
|
44
|
+
assert dynamics.is_defined()
|
45
|
+
|
46
|
+
def test_compute_contribution(self, dynamics: PositionDerivative, state: State):
|
47
|
+
contribution = dynamics.compute_contribution(
|
48
|
+
state.get_instant(), state.get_coordinates(), state.get_frame()
|
49
|
+
)
|
50
|
+
assert len(contribution) == 3
|
51
|
+
assert contribution == pytest.approx(state.get_coordinates()[:3])
|
@@ -0,0 +1,138 @@
|
|
1
|
+
# Apache License 2.0
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
import numpy as np
|
6
|
+
|
7
|
+
from ostk.mathematics.curve_fitting import Interpolator
|
8
|
+
|
9
|
+
from ostk.physics.time import Instant
|
10
|
+
from ostk.physics.time import DateTime
|
11
|
+
from ostk.physics.time import Duration
|
12
|
+
from ostk.physics.time import Scale
|
13
|
+
from ostk.physics.coordinate import Frame
|
14
|
+
|
15
|
+
from ostk.astrodynamics.trajectory.state import CoordinateSubset
|
16
|
+
from ostk.astrodynamics.trajectory.state.coordinate_subset import CartesianVelocity
|
17
|
+
from ostk.astrodynamics import Dynamics
|
18
|
+
from ostk.astrodynamics.dynamics import Tabulated
|
19
|
+
|
20
|
+
|
21
|
+
@pytest.fixture
|
22
|
+
def instants() -> list[Instant]:
|
23
|
+
return [
|
24
|
+
Instant.date_time(DateTime(2021, 3, 20, 12, 0, 0), Scale.UTC),
|
25
|
+
Instant.date_time(DateTime(2021, 3, 20, 12, 0, 1), Scale.UTC),
|
26
|
+
Instant.date_time(DateTime(2021, 3, 20, 12, 0, 2), Scale.UTC),
|
27
|
+
Instant.date_time(DateTime(2021, 3, 20, 12, 0, 3), Scale.UTC),
|
28
|
+
Instant.date_time(DateTime(2021, 3, 20, 12, 0, 4), Scale.UTC),
|
29
|
+
Instant.date_time(DateTime(2021, 3, 20, 12, 0, 5), Scale.UTC),
|
30
|
+
Instant.date_time(DateTime(2021, 3, 20, 12, 0, 6), Scale.UTC),
|
31
|
+
Instant.date_time(DateTime(2021, 3, 20, 12, 0, 7), Scale.UTC),
|
32
|
+
Instant.date_time(DateTime(2021, 3, 20, 12, 1, 8), Scale.UTC),
|
33
|
+
Instant.date_time(DateTime(2021, 3, 20, 12, 1, 9), Scale.UTC),
|
34
|
+
]
|
35
|
+
|
36
|
+
|
37
|
+
@pytest.fixture
|
38
|
+
def contribution_profile() -> np.ndarray:
|
39
|
+
return np.array(
|
40
|
+
[
|
41
|
+
[1.0, 2.0, 3.0, -1.0],
|
42
|
+
[4.0, 5.0, 6.0, -1.0],
|
43
|
+
[7.0, 8.0, 9.0, -1.0],
|
44
|
+
[10.0, 11.0, 12.0, -1.0],
|
45
|
+
[13.0, 14.0, 15.0, -1.0],
|
46
|
+
[16.0, 17.0, 18.0, -1.0],
|
47
|
+
[19.0, 20.0, 21.0, -1.0],
|
48
|
+
[22.0, 23.0, 24.0, -1.0],
|
49
|
+
[25.0, 26.0, 27.0, -1.0],
|
50
|
+
[28.0, 29.0, 30.0, -1.0],
|
51
|
+
]
|
52
|
+
)
|
53
|
+
|
54
|
+
|
55
|
+
@pytest.fixture
|
56
|
+
def coordinate_subsets() -> list[CoordinateSubset]:
|
57
|
+
return [
|
58
|
+
CartesianVelocity.default(),
|
59
|
+
CoordinateSubset.mass(),
|
60
|
+
]
|
61
|
+
|
62
|
+
|
63
|
+
@pytest.fixture
|
64
|
+
def frame() -> Frame:
|
65
|
+
return Frame.GCRF()
|
66
|
+
|
67
|
+
|
68
|
+
@pytest.fixture
|
69
|
+
def dynamics(
|
70
|
+
instants: list[Instant],
|
71
|
+
contribution_profile: np.ndarray,
|
72
|
+
coordinate_subsets: list[CoordinateSubset],
|
73
|
+
frame: Frame,
|
74
|
+
) -> Tabulated:
|
75
|
+
return Tabulated(
|
76
|
+
instants,
|
77
|
+
contribution_profile,
|
78
|
+
coordinate_subsets,
|
79
|
+
frame,
|
80
|
+
Interpolator.Type.Linear,
|
81
|
+
)
|
82
|
+
|
83
|
+
|
84
|
+
class TestTabulated:
|
85
|
+
def test_constructor(
|
86
|
+
self,
|
87
|
+
dynamics: Tabulated,
|
88
|
+
):
|
89
|
+
assert dynamics is not None
|
90
|
+
assert isinstance(dynamics, Tabulated)
|
91
|
+
assert isinstance(dynamics, Dynamics)
|
92
|
+
assert dynamics.is_defined()
|
93
|
+
|
94
|
+
def test_accessor(
|
95
|
+
self,
|
96
|
+
dynamics: Tabulated,
|
97
|
+
instants: list[Instant],
|
98
|
+
contribution_profile: np.ndarray,
|
99
|
+
frame: Frame,
|
100
|
+
):
|
101
|
+
assert np.array_equal(
|
102
|
+
dynamics.access_contribution_profile(), contribution_profile
|
103
|
+
)
|
104
|
+
|
105
|
+
assert dynamics.access_instants() == instants
|
106
|
+
|
107
|
+
assert dynamics.access_frame() == frame
|
108
|
+
|
109
|
+
def test_getters(
|
110
|
+
self,
|
111
|
+
dynamics: Tabulated,
|
112
|
+
contribution_profile: np.ndarray,
|
113
|
+
):
|
114
|
+
assert np.array_equal(
|
115
|
+
dynamics.get_contribution_profile_from_coordinate_subsets(
|
116
|
+
[CartesianVelocity.default()]
|
117
|
+
),
|
118
|
+
contribution_profile[:, 0:3],
|
119
|
+
)
|
120
|
+
|
121
|
+
assert dynamics.get_interpolation_type() == Interpolator.Type.Linear
|
122
|
+
|
123
|
+
def test_compute_contribution(
|
124
|
+
self,
|
125
|
+
dynamics: Tabulated,
|
126
|
+
instants: list[Instant],
|
127
|
+
contribution_profile: np.ndarray,
|
128
|
+
):
|
129
|
+
for i in range(len(instants)):
|
130
|
+
contribution = dynamics.compute_contribution(instants[i], [], Frame.GCRF())
|
131
|
+
assert contribution == pytest.approx(contribution_profile[i])
|
132
|
+
|
133
|
+
new_contribution = dynamics.compute_contribution(
|
134
|
+
instants[i] + Duration.seconds(0.5), [], Frame.GCRF()
|
135
|
+
)
|
136
|
+
|
137
|
+
assert new_contribution is not None
|
138
|
+
assert len(new_contribution) == 4
|
@@ -0,0 +1,67 @@
|
|
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.object.celestial import Moon
|
14
|
+
|
15
|
+
from ostk.astrodynamics.trajectory import State
|
16
|
+
from ostk.astrodynamics import Dynamics
|
17
|
+
from ostk.astrodynamics.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([7000000.0, 0.0, 0.0], frame)
|
34
|
+
velocity: Velocity = Velocity.meters_per_second([0.0, 0.0, 0.0], frame)
|
35
|
+
instant = Instant.date_time(DateTime(2021, 3, 20, 12, 0, 0), Scale.UTC)
|
36
|
+
return State(instant, position, velocity)
|
37
|
+
|
38
|
+
|
39
|
+
class TestThirdBodyGravity:
|
40
|
+
def test_constructors(
|
41
|
+
self,
|
42
|
+
dynamics: ThirdBodyGravity,
|
43
|
+
):
|
44
|
+
assert dynamics is not None
|
45
|
+
assert isinstance(dynamics, ThirdBodyGravity)
|
46
|
+
assert isinstance(dynamics, Dynamics)
|
47
|
+
assert dynamics.is_defined()
|
48
|
+
|
49
|
+
def test_getters(
|
50
|
+
self,
|
51
|
+
dynamics: ThirdBodyGravity,
|
52
|
+
moon: Moon,
|
53
|
+
):
|
54
|
+
assert dynamics.get_celestial() == moon
|
55
|
+
|
56
|
+
def test_compute_contribution(
|
57
|
+
self,
|
58
|
+
dynamics: ThirdBodyGravity,
|
59
|
+
state: State,
|
60
|
+
):
|
61
|
+
contribution = dynamics.compute_contribution(
|
62
|
+
state.get_instant(), state.get_coordinates(), state.get_frame()
|
63
|
+
)
|
64
|
+
assert len(contribution) == 3
|
65
|
+
assert contribution == pytest.approx(
|
66
|
+
[-4.620543790697659e-07, 2.948717888154649e-07, 1.301648617451192e-07]
|
67
|
+
)
|