JMOT.planet

  1from JMOT import connect, extra
  2from typing import Literal
  3import numpy as np
  4
  5_PLANET_INFO_SIGNALS = {
  6    "planet_mass":100,
  7    "planet_radius":101,
  8    "is_solid_ground":102,
  9    "planet_SOI_radius":103,
 10    "planet_len_of_day":104,
 11    "planet_len_of_year":105,
 12    "planet_local_name":106,
 13    "target_planet":107,
 14    "planet_parent":108,
 15    "planet_child_list":109,
 16    "planet_craft_list":110,
 17    "planet_craft_ID_list":111,
 18    "planet_structure_list":112,
 19    "get_terrain_color":113
 20}
 21
 22class info:
 23    def planet_mass(planet:str)->float:
 24        '''Get the mass of a planet in kg.\n'''
 25        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_mass']}<<{planet}")
 26        return rec[0]
 27    def planet_radius(planet:str)->float:
 28        '''Get the radius of a planet in meters.\n'''
 29        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_radius']}<<{planet}")
 30        return rec[0]
 31    def is_solid_ground(planet:str)->bool:
 32        '''Get the status of whether the surface of a planet is solid.\n
 33        if solid, return True, else return False.'''
 34        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['is_solid_ground']}<<{planet}")
 35        return rec[0]
 36    def planet_SOI_radius(planet:str)->float:
 37        '''Get the radius of the sphere of influence of a planet in meters.\n'''
 38        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_SOI_radius']}<<{planet}")
 39        return rec[0]
 40    def planet_len_of_day(planet:str)->float:
 41        '''Get the length of a day on a planet in seconds.\n'''
 42        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_len_of_day']}<<{planet}")
 43        return rec[0]
 44    def planet_len_of_year(planet:str)->float:
 45        '''Get the length of a year on a planet in seconds.\n'''
 46        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_len_of_year']}<<{planet}")
 47        return rec[0]
 48    def planet_local_name()->str:
 49        '''Get the name of the current vessel's main celestial body.'''
 50        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_local_name']}")
 51        return rec[0]
 52    def target_planet()->str:
 53        '''Get the name of the current vessel's target celestial body.'''
 54        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['target_planet']}")
 55        return rec[0]
 56    def planet_parent(planet:str)->str:
 57        '''Get the name of the parent body of a planet.\n'''
 58        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_parent']}<<{planet}")
 59        return rec[0]
 60    def planet_child_list(planet:str)->list:
 61        '''Get the list of child bodies of a planet.'''
 62        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_child_list']}<<{planet}")
 63        return rec
 64    def planet_craft_list(planet:str)->list:
 65        '''Get the list of craft name in orbit around a planet.'''
 66        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_craft_list']}<<{planet}")
 67        return rec
 68    def planet_craft_ID_list(planet:str)->list:
 69        '''Get the list of craft ID in orbit around a planet.'''
 70        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_craft_ID_list']}<<{planet}")
 71        return rec
 72    def planet_structure_list(planet:str)->list:
 73        '''Get the list of structures on a planet.'''
 74        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_structure_list']}<<{planet}")
 75        return rec
 76    def get_terrain_color(position:np.ndarray)->np.ndarray:
 77        '''Get the terrain RGB color at a position in latitude, longitude, and 0.\n
 78        The Z value of the position is ignored.'''
 79        position = tuple(position)
 80        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['get_terrain_color']}<<{position}")
 81        return list(rec[0])
 82
 83_PLANET_ATMOSPHERE_SIGNALS = {
 84    "air_desity":130,
 85    "air_pressure":131,
 86    "speed_of_sound":132,
 87    "temperature":133,
 88    "atmosphere_air_desity":134,
 89    "atmosphere_height":135,
 90    "atmosphere_fade_out":136
 91}
 92
 93class atmosphere:
 94    def air_desity()->float:
 95        '''Get the air density at the current vessel's location in kg/m^3.'''
 96        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['air_desity']}")
 97        return rec[0]
 98    def air_pressure()->float:
 99        '''Get the air pressure at the current vessel's location in Pa.'''
100        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['air_pressure']}")
101        return rec[0]
102    def speed_of_sound()->float:
103        '''Get the speed of sound at the current vessel's location in m/s.'''
104        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['speed_of_sound']}")
105        return rec[0]
106    def temperature()->float:
107        '''Get the temperature at the current vessel's location in K.'''
108        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['temperature']}")
109        return rec[0]
110    def atmosphere_air_desity(planet:str)->float:
111        '''Get the air density at sea level of a planet in kg/m^3.\n'''
112        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['atmosphere_air_desity']}<<{planet}")
113        return rec[0]
114    def atmosphere_height(planet:str)->float:
115        '''Get the height of the atmosphere of a planet in meters.\n'''
116        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['atmosphere_height']}<<{planet}")
117        return rec[0]
118    def atmosphere_fade_out(planet:str)->float:
119        '''Get the fade out of the atmosphere of a planet in meters.\n'''
120        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['atmosphere_fade_out']}<<{planet}")
121        return rec[0]
122
123_PLANET_ORBIT_SIGNALS = {
124    "planet_solar_position":150,
125    "planet_velocity":151,
126    "planet_apoapsis_position":152,
127    "planet_periapsis_position":153,
128    "planet_period":154,
129    "planet_apoapsis_time":155,
130    "planet_periapsis_time":156,
131    "planet_inclination":157,
132    "planet_eccentricity":158,
133    "planet_mean_anomaly":159,
134    "planet_mean_motion":160,
135    "planet_periapsis_argument":161,
136    "planet_right_ascension":162,
137    "planet_true_anomaly":163,
138    "planet_SMA":164,
139    "get_terrain_height":165
140}
141
142class orbit:
143    def planet_solar_position(planet:str)->np.ndarray:
144        '''Get the position of a planet relative to the sun in ECI coordinates in meters.\n'''
145        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_solar_position']}<<{planet}")
146        vec = extra.tuple2array(rec)
147        return vec
148    def planet_velocity(planet:str)->np.ndarray:
149        '''Get the velocity of a planet in ECI coordinates in m/s.\n'''
150        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_velocity']}<<{planet}")
151        vec = extra.tuple2array(rec)
152        return vec
153    def planet_apoapsis_position(planet:str)->np.ndarray:
154        '''Get the position of a planet's apoapsis in ECI coordinates in meters.\n'''
155        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_apoapsis_position']}<<{planet}")
156        vec = extra.tuple2array(rec)
157        return vec
158    def planet_periapsis_position(planet:str)->np.ndarray:
159        '''Get the position of a planet's periapsis in ECI coordinates in meters.\n'''
160        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_periapsis_position']}<<{planet}")
161        vec = extra.tuple2array(rec)
162        return vec
163    def planet_period(planet:str)->float:
164        '''Get the orbital period of a planet in seconds.\n'''
165        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_period']}<<{planet}")
166        return rec[0]
167    def planet_apoapsis_time(planet:str)->float:
168        '''Get the time of apoapsis of a planet in seconds.\n'''
169        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_apoapsis_time']}<<{planet}")
170        return rec[0]
171    def planet_periapsis_time(planet:str)->float:
172        '''Get the time of periapsis of a planet in seconds.\n'''
173        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_periapsis_time']}<<{planet}")
174        return rec[0]
175    def planet_inclination(planet:str)->float:
176        '''Get the inclination of a planet in radians.\n'''
177        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_inclination']}<<{planet}")
178        return rec[0]
179    def planet_eccentricity(planet:str)->float:
180        '''Get the eccentricity of a planet.\n'''
181        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_eccentricity']}<<{planet}")
182        return rec[0]
183    def planet_mean_anomaly(planet:str)->float:
184        '''Get the mean anomaly of a planet.\n'''
185        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_mean_anomaly']}<<{planet}")
186        return rec[0]
187    def planet_mean_motion(planet:str)->float:
188        '''Get the mean motion of a planet in radians/second.\n'''
189        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_mean_motion']}<<{planet}")
190        return rec[0]
191    def planet_periapsis_argument(planet:str)->float:
192        '''Get the argument of periapsis of a planet in radians.\n'''
193        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_periapsis_argument']}<<{planet}")
194        return rec[0]
195    def planet_right_ascension(planet:str)->float:
196        '''Get the right ascension of a planet in radians.\n'''
197        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_right_ascension']}<<{planet}")
198        return rec[0]
199    def planet_true_anomaly(planet:str)->float:
200        '''Get the true anomaly of a planet in radians.\n'''
201        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_true_anomaly']}<<{planet}")
202        return rec[0]
203    def planet_SMA(planet:str)->float:
204        '''Get the semi-major axis of a planet in meters.\n'''
205        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_SMA']}<<{planet}")
206        return rec[0]
207    def get_terrain_height(position:np.ndarray)->float:
208        '''Get the terrain height at a position in latitude, longitude, and 0.\n
209        The Z value of the position is ignored.'''
210        position = tuple(position)
211        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['get_terrain_height']}<<{position}")
212        return rec[0]
class info:
23class info:
24    def planet_mass(planet:str)->float:
25        '''Get the mass of a planet in kg.\n'''
26        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_mass']}<<{planet}")
27        return rec[0]
28    def planet_radius(planet:str)->float:
29        '''Get the radius of a planet in meters.\n'''
30        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_radius']}<<{planet}")
31        return rec[0]
32    def is_solid_ground(planet:str)->bool:
33        '''Get the status of whether the surface of a planet is solid.\n
34        if solid, return True, else return False.'''
35        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['is_solid_ground']}<<{planet}")
36        return rec[0]
37    def planet_SOI_radius(planet:str)->float:
38        '''Get the radius of the sphere of influence of a planet in meters.\n'''
39        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_SOI_radius']}<<{planet}")
40        return rec[0]
41    def planet_len_of_day(planet:str)->float:
42        '''Get the length of a day on a planet in seconds.\n'''
43        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_len_of_day']}<<{planet}")
44        return rec[0]
45    def planet_len_of_year(planet:str)->float:
46        '''Get the length of a year on a planet in seconds.\n'''
47        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_len_of_year']}<<{planet}")
48        return rec[0]
49    def planet_local_name()->str:
50        '''Get the name of the current vessel's main celestial body.'''
51        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_local_name']}")
52        return rec[0]
53    def target_planet()->str:
54        '''Get the name of the current vessel's target celestial body.'''
55        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['target_planet']}")
56        return rec[0]
57    def planet_parent(planet:str)->str:
58        '''Get the name of the parent body of a planet.\n'''
59        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_parent']}<<{planet}")
60        return rec[0]
61    def planet_child_list(planet:str)->list:
62        '''Get the list of child bodies of a planet.'''
63        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_child_list']}<<{planet}")
64        return rec
65    def planet_craft_list(planet:str)->list:
66        '''Get the list of craft name in orbit around a planet.'''
67        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_craft_list']}<<{planet}")
68        return rec
69    def planet_craft_ID_list(planet:str)->list:
70        '''Get the list of craft ID in orbit around a planet.'''
71        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_craft_ID_list']}<<{planet}")
72        return rec
73    def planet_structure_list(planet:str)->list:
74        '''Get the list of structures on a planet.'''
75        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_structure_list']}<<{planet}")
76        return rec
77    def get_terrain_color(position:np.ndarray)->np.ndarray:
78        '''Get the terrain RGB color at a position in latitude, longitude, and 0.\n
79        The Z value of the position is ignored.'''
80        position = tuple(position)
81        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['get_terrain_color']}<<{position}")
82        return list(rec[0])
def planet_mass(planet: str) -> float:
24    def planet_mass(planet:str)->float:
25        '''Get the mass of a planet in kg.\n'''
26        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_mass']}<<{planet}")
27        return rec[0]

Get the mass of a planet in kg.

def planet_radius(planet: str) -> float:
28    def planet_radius(planet:str)->float:
29        '''Get the radius of a planet in meters.\n'''
30        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_radius']}<<{planet}")
31        return rec[0]

Get the radius of a planet in meters.

def is_solid_ground(planet: str) -> bool:
32    def is_solid_ground(planet:str)->bool:
33        '''Get the status of whether the surface of a planet is solid.\n
34        if solid, return True, else return False.'''
35        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['is_solid_ground']}<<{planet}")
36        return rec[0]

Get the status of whether the surface of a planet is solid.

if solid, return True, else return False.

def planet_SOI_radius(planet: str) -> float:
37    def planet_SOI_radius(planet:str)->float:
38        '''Get the radius of the sphere of influence of a planet in meters.\n'''
39        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_SOI_radius']}<<{planet}")
40        return rec[0]

Get the radius of the sphere of influence of a planet in meters.

def planet_len_of_day(planet: str) -> float:
41    def planet_len_of_day(planet:str)->float:
42        '''Get the length of a day on a planet in seconds.\n'''
43        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_len_of_day']}<<{planet}")
44        return rec[0]

Get the length of a day on a planet in seconds.

def planet_len_of_year(planet: str) -> float:
45    def planet_len_of_year(planet:str)->float:
46        '''Get the length of a year on a planet in seconds.\n'''
47        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_len_of_year']}<<{planet}")
48        return rec[0]

Get the length of a year on a planet in seconds.

def planet_local_name() -> str:
49    def planet_local_name()->str:
50        '''Get the name of the current vessel's main celestial body.'''
51        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_local_name']}")
52        return rec[0]

Get the name of the current vessel's main celestial body.

def target_planet() -> str:
53    def target_planet()->str:
54        '''Get the name of the current vessel's target celestial body.'''
55        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['target_planet']}")
56        return rec[0]

Get the name of the current vessel's target celestial body.

def planet_parent(planet: str) -> str:
57    def planet_parent(planet:str)->str:
58        '''Get the name of the parent body of a planet.\n'''
59        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_parent']}<<{planet}")
60        return rec[0]

Get the name of the parent body of a planet.

def planet_child_list(planet: str) -> list:
61    def planet_child_list(planet:str)->list:
62        '''Get the list of child bodies of a planet.'''
63        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_child_list']}<<{planet}")
64        return rec

Get the list of child bodies of a planet.

def planet_craft_list(planet: str) -> list:
65    def planet_craft_list(planet:str)->list:
66        '''Get the list of craft name in orbit around a planet.'''
67        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_craft_list']}<<{planet}")
68        return rec

Get the list of craft name in orbit around a planet.

def planet_craft_ID_list(planet: str) -> list:
69    def planet_craft_ID_list(planet:str)->list:
70        '''Get the list of craft ID in orbit around a planet.'''
71        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_craft_ID_list']}<<{planet}")
72        return rec

Get the list of craft ID in orbit around a planet.

def planet_structure_list(planet: str) -> list:
73    def planet_structure_list(planet:str)->list:
74        '''Get the list of structures on a planet.'''
75        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['planet_structure_list']}<<{planet}")
76        return rec

Get the list of structures on a planet.

def get_terrain_color(position: numpy.ndarray) -> numpy.ndarray:
77    def get_terrain_color(position:np.ndarray)->np.ndarray:
78        '''Get the terrain RGB color at a position in latitude, longitude, and 0.\n
79        The Z value of the position is ignored.'''
80        position = tuple(position)
81        rec = connect._send_message(f"true<<{_PLANET_INFO_SIGNALS['get_terrain_color']}<<{position}")
82        return list(rec[0])

Get the terrain RGB color at a position in latitude, longitude, and 0.

The Z value of the position is ignored.

class atmosphere:
 94class atmosphere:
 95    def air_desity()->float:
 96        '''Get the air density at the current vessel's location in kg/m^3.'''
 97        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['air_desity']}")
 98        return rec[0]
 99    def air_pressure()->float:
100        '''Get the air pressure at the current vessel's location in Pa.'''
101        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['air_pressure']}")
102        return rec[0]
103    def speed_of_sound()->float:
104        '''Get the speed of sound at the current vessel's location in m/s.'''
105        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['speed_of_sound']}")
106        return rec[0]
107    def temperature()->float:
108        '''Get the temperature at the current vessel's location in K.'''
109        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['temperature']}")
110        return rec[0]
111    def atmosphere_air_desity(planet:str)->float:
112        '''Get the air density at sea level of a planet in kg/m^3.\n'''
113        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['atmosphere_air_desity']}<<{planet}")
114        return rec[0]
115    def atmosphere_height(planet:str)->float:
116        '''Get the height of the atmosphere of a planet in meters.\n'''
117        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['atmosphere_height']}<<{planet}")
118        return rec[0]
119    def atmosphere_fade_out(planet:str)->float:
120        '''Get the fade out of the atmosphere of a planet in meters.\n'''
121        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['atmosphere_fade_out']}<<{planet}")
122        return rec[0]
def air_desity() -> float:
95    def air_desity()->float:
96        '''Get the air density at the current vessel's location in kg/m^3.'''
97        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['air_desity']}")
98        return rec[0]

Get the air density at the current vessel's location in kg/m^3.

def air_pressure() -> float:
 99    def air_pressure()->float:
100        '''Get the air pressure at the current vessel's location in Pa.'''
101        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['air_pressure']}")
102        return rec[0]

Get the air pressure at the current vessel's location in Pa.

def speed_of_sound() -> float:
103    def speed_of_sound()->float:
104        '''Get the speed of sound at the current vessel's location in m/s.'''
105        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['speed_of_sound']}")
106        return rec[0]

Get the speed of sound at the current vessel's location in m/s.

def temperature() -> float:
107    def temperature()->float:
108        '''Get the temperature at the current vessel's location in K.'''
109        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['temperature']}")
110        return rec[0]

Get the temperature at the current vessel's location in K.

def atmosphere_air_desity(planet: str) -> float:
111    def atmosphere_air_desity(planet:str)->float:
112        '''Get the air density at sea level of a planet in kg/m^3.\n'''
113        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['atmosphere_air_desity']}<<{planet}")
114        return rec[0]

Get the air density at sea level of a planet in kg/m^3.

def atmosphere_height(planet: str) -> float:
115    def atmosphere_height(planet:str)->float:
116        '''Get the height of the atmosphere of a planet in meters.\n'''
117        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['atmosphere_height']}<<{planet}")
118        return rec[0]

Get the height of the atmosphere of a planet in meters.

def atmosphere_fade_out(planet: str) -> float:
119    def atmosphere_fade_out(planet:str)->float:
120        '''Get the fade out of the atmosphere of a planet in meters.\n'''
121        rec = connect._send_message(f"true<<{_PLANET_ATMOSPHERE_SIGNALS['atmosphere_fade_out']}<<{planet}")
122        return rec[0]

Get the fade out of the atmosphere of a planet in meters.

class orbit:
143class orbit:
144    def planet_solar_position(planet:str)->np.ndarray:
145        '''Get the position of a planet relative to the sun in ECI coordinates in meters.\n'''
146        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_solar_position']}<<{planet}")
147        vec = extra.tuple2array(rec)
148        return vec
149    def planet_velocity(planet:str)->np.ndarray:
150        '''Get the velocity of a planet in ECI coordinates in m/s.\n'''
151        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_velocity']}<<{planet}")
152        vec = extra.tuple2array(rec)
153        return vec
154    def planet_apoapsis_position(planet:str)->np.ndarray:
155        '''Get the position of a planet's apoapsis in ECI coordinates in meters.\n'''
156        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_apoapsis_position']}<<{planet}")
157        vec = extra.tuple2array(rec)
158        return vec
159    def planet_periapsis_position(planet:str)->np.ndarray:
160        '''Get the position of a planet's periapsis in ECI coordinates in meters.\n'''
161        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_periapsis_position']}<<{planet}")
162        vec = extra.tuple2array(rec)
163        return vec
164    def planet_period(planet:str)->float:
165        '''Get the orbital period of a planet in seconds.\n'''
166        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_period']}<<{planet}")
167        return rec[0]
168    def planet_apoapsis_time(planet:str)->float:
169        '''Get the time of apoapsis of a planet in seconds.\n'''
170        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_apoapsis_time']}<<{planet}")
171        return rec[0]
172    def planet_periapsis_time(planet:str)->float:
173        '''Get the time of periapsis of a planet in seconds.\n'''
174        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_periapsis_time']}<<{planet}")
175        return rec[0]
176    def planet_inclination(planet:str)->float:
177        '''Get the inclination of a planet in radians.\n'''
178        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_inclination']}<<{planet}")
179        return rec[0]
180    def planet_eccentricity(planet:str)->float:
181        '''Get the eccentricity of a planet.\n'''
182        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_eccentricity']}<<{planet}")
183        return rec[0]
184    def planet_mean_anomaly(planet:str)->float:
185        '''Get the mean anomaly of a planet.\n'''
186        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_mean_anomaly']}<<{planet}")
187        return rec[0]
188    def planet_mean_motion(planet:str)->float:
189        '''Get the mean motion of a planet in radians/second.\n'''
190        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_mean_motion']}<<{planet}")
191        return rec[0]
192    def planet_periapsis_argument(planet:str)->float:
193        '''Get the argument of periapsis of a planet in radians.\n'''
194        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_periapsis_argument']}<<{planet}")
195        return rec[0]
196    def planet_right_ascension(planet:str)->float:
197        '''Get the right ascension of a planet in radians.\n'''
198        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_right_ascension']}<<{planet}")
199        return rec[0]
200    def planet_true_anomaly(planet:str)->float:
201        '''Get the true anomaly of a planet in radians.\n'''
202        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_true_anomaly']}<<{planet}")
203        return rec[0]
204    def planet_SMA(planet:str)->float:
205        '''Get the semi-major axis of a planet in meters.\n'''
206        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_SMA']}<<{planet}")
207        return rec[0]
208    def get_terrain_height(position:np.ndarray)->float:
209        '''Get the terrain height at a position in latitude, longitude, and 0.\n
210        The Z value of the position is ignored.'''
211        position = tuple(position)
212        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['get_terrain_height']}<<{position}")
213        return rec[0]
def planet_solar_position(planet: str) -> numpy.ndarray:
144    def planet_solar_position(planet:str)->np.ndarray:
145        '''Get the position of a planet relative to the sun in ECI coordinates in meters.\n'''
146        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_solar_position']}<<{planet}")
147        vec = extra.tuple2array(rec)
148        return vec

Get the position of a planet relative to the sun in ECI coordinates in meters.

def planet_velocity(planet: str) -> numpy.ndarray:
149    def planet_velocity(planet:str)->np.ndarray:
150        '''Get the velocity of a planet in ECI coordinates in m/s.\n'''
151        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_velocity']}<<{planet}")
152        vec = extra.tuple2array(rec)
153        return vec

Get the velocity of a planet in ECI coordinates in m/s.

def planet_apoapsis_position(planet: str) -> numpy.ndarray:
154    def planet_apoapsis_position(planet:str)->np.ndarray:
155        '''Get the position of a planet's apoapsis in ECI coordinates in meters.\n'''
156        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_apoapsis_position']}<<{planet}")
157        vec = extra.tuple2array(rec)
158        return vec

Get the position of a planet's apoapsis in ECI coordinates in meters.

def planet_periapsis_position(planet: str) -> numpy.ndarray:
159    def planet_periapsis_position(planet:str)->np.ndarray:
160        '''Get the position of a planet's periapsis in ECI coordinates in meters.\n'''
161        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_periapsis_position']}<<{planet}")
162        vec = extra.tuple2array(rec)
163        return vec

Get the position of a planet's periapsis in ECI coordinates in meters.

def planet_period(planet: str) -> float:
164    def planet_period(planet:str)->float:
165        '''Get the orbital period of a planet in seconds.\n'''
166        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_period']}<<{planet}")
167        return rec[0]

Get the orbital period of a planet in seconds.

def planet_apoapsis_time(planet: str) -> float:
168    def planet_apoapsis_time(planet:str)->float:
169        '''Get the time of apoapsis of a planet in seconds.\n'''
170        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_apoapsis_time']}<<{planet}")
171        return rec[0]

Get the time of apoapsis of a planet in seconds.

def planet_periapsis_time(planet: str) -> float:
172    def planet_periapsis_time(planet:str)->float:
173        '''Get the time of periapsis of a planet in seconds.\n'''
174        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_periapsis_time']}<<{planet}")
175        return rec[0]

Get the time of periapsis of a planet in seconds.

def planet_inclination(planet: str) -> float:
176    def planet_inclination(planet:str)->float:
177        '''Get the inclination of a planet in radians.\n'''
178        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_inclination']}<<{planet}")
179        return rec[0]

Get the inclination of a planet in radians.

def planet_eccentricity(planet: str) -> float:
180    def planet_eccentricity(planet:str)->float:
181        '''Get the eccentricity of a planet.\n'''
182        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_eccentricity']}<<{planet}")
183        return rec[0]

Get the eccentricity of a planet.

def planet_mean_anomaly(planet: str) -> float:
184    def planet_mean_anomaly(planet:str)->float:
185        '''Get the mean anomaly of a planet.\n'''
186        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_mean_anomaly']}<<{planet}")
187        return rec[0]

Get the mean anomaly of a planet.

def planet_mean_motion(planet: str) -> float:
188    def planet_mean_motion(planet:str)->float:
189        '''Get the mean motion of a planet in radians/second.\n'''
190        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_mean_motion']}<<{planet}")
191        return rec[0]

Get the mean motion of a planet in radians/second.

def planet_periapsis_argument(planet: str) -> float:
192    def planet_periapsis_argument(planet:str)->float:
193        '''Get the argument of periapsis of a planet in radians.\n'''
194        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_periapsis_argument']}<<{planet}")
195        return rec[0]

Get the argument of periapsis of a planet in radians.

def planet_right_ascension(planet: str) -> float:
196    def planet_right_ascension(planet:str)->float:
197        '''Get the right ascension of a planet in radians.\n'''
198        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_right_ascension']}<<{planet}")
199        return rec[0]

Get the right ascension of a planet in radians.

def planet_true_anomaly(planet: str) -> float:
200    def planet_true_anomaly(planet:str)->float:
201        '''Get the true anomaly of a planet in radians.\n'''
202        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_true_anomaly']}<<{planet}")
203        return rec[0]

Get the true anomaly of a planet in radians.

def planet_SMA(planet: str) -> float:
204    def planet_SMA(planet:str)->float:
205        '''Get the semi-major axis of a planet in meters.\n'''
206        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['planet_SMA']}<<{planet}")
207        return rec[0]

Get the semi-major axis of a planet in meters.

def get_terrain_height(position: numpy.ndarray) -> float:
208    def get_terrain_height(position:np.ndarray)->float:
209        '''Get the terrain height at a position in latitude, longitude, and 0.\n
210        The Z value of the position is ignored.'''
211        position = tuple(position)
212        rec = connect._send_message(f"true<<{_PLANET_ORBIT_SIGNALS['get_terrain_height']}<<{position}")
213        return rec[0]

Get the terrain height at a position in latitude, longitude, and 0.

The Z value of the position is ignored.