mds_api¶
mds_api package initialization.
Exposes: - client - event_mission_builder - mds_api (main API functions) - response - NetworkConfiguration - camera interface
- The modules can be accessed as:
>>> import mds_api >>> mds_api.client.some_function() >>> mds_api.get_config() # from mds_api.py
- mds_api.add_ground_asset(asset_name: str, centralBody: str, longitudeDeg: float | str, latitudeDeg: float | str, altitudeMeters: float, canFly: bool = True, maxSpeed: float = 250.0, maxAscentRate: float = 12.0, loopWaypoints: bool = True, waypoints=None, currentWaypointIndex: int | None = None, tx_frequency: float = 2047000000.0, rx_frequency: float = 8250000000.0, radius: float = 10, r: int = 255, g: int = 255, b: int = 255, assetType: int = 1, print_debug: bool = False) bytes[source]¶
Add ground asset
- Parameters:
asset_name – name of your ground asset (string)
longitudeDeg – longitude, in dgrees (float)
latitudeDeg – latitude, in degrees (float)
altitudeMeters – altitude in meters, above sea level (float)
canFly – is the asset allowed to lift off above 0m altitude? (bool, default=True)
maxSpeed – maximum speed in m/s (float, default=250)
maxAscentRate – maximum speed in m/s, at which the asset can ascend/descend (float, default=12)
loopWaypoints – Whether to loop waypoints. If True, then upon reachng the last waypoint will redirect to the first one. Otherwise will stop at the last waypoint. (bool, default=True)
waypoints – list of waypoints or None. If you provide a list, waypoints will be updated. If you provide None, waypoints are not modified. Create each item in the list using the function create_ground_asset_waypoint. (list or None, default=None)
currentWaypointIndex – index of waypoint that the ground asset is currently heading to. Place the index of waypoint, -1 to make the asset stop or None to not modify current value. (int or None, default=None)
tx_frequency – Tranzsmission frequency in Hz (default = 2047 MHz)
rx_frequency – reception frequency, in Hz (default = 8520 MHz)
r – Color of the spherical marker, as byte from 0 to 255. (default = 255,255,255)
g – Color of the spherical marker, as byte from 0 to 255. (default = 255,255,255)
b – Color of the spherical marker, as byte from 0 to 255. (default = 255,255,255)
assetType – ground asset type. Only affects the icon displayed, does not affect behaviour. Please see mds_api.ground_asset_types for possible values. (default = 1 (Station))
- mds_api.add_lvlh_frame_measurement(measurement_name: str, reference_sat: str, target_sat: str, description: str = '') bytes[source]¶
Add LVLH measurement, which measures the target’s position and veocity in LVLH frame of the reference sat.
- Parameters:
measurement_name (str) – Name, by which you’re going to call your measurement
reference_sat (str) – reference satellite name, in whose frame measurements are carried out.
target_sat (str) – target satellite name
description (str) – an optional description if you want to attach it to your measurement. Defaults to just empty string.
- mds_api.add_multiple_sats_from_elements(constellation_name: str, num_spacecraft: float, mass: float, a: float, e: float, i: float, Omega: float, omega: float, nu_offset: float, central_body: str) bytes[source]¶
Instantiate multiple satellites in the same orbit. The true anomaly of the first satellite is nu_offset and the rest of satellites are spaced evenly with respect to true anomaly.
- Parameters:
constellation_name (str) – name of the new spacecraft to be instantiated
num_spacecraft (int) – number of spacecraft
mass (float) – mass of the spacecraft [kg]
a (float) – semi-major axis [m]
e (float) – eccentricity [-]
i (float) – inclination [deg]
Omega (float) – right ascension of the ascending node [deg]
omega (float) – argument of periapsis [deg]
nu_offset (float) – true anomaly offset for the first spacecraft [deg]
central_body (str) – name of central body
- mds_api.add_polygons_from_csv(csv_path: str, r: float, g: float, b: float, a: float)[source]¶
Add polygons from a CSV file.
- Parameters:
csv_path (str) – path to a csv file (on client computer).
r (float) – red component of the polygon color.
g (float) – green component of the polygon color.
b (float) – blue component of the polygon color.
a (float) – alpha component of the polygon color.
- mds_api.add_radio(sat_name: str, orientation: list[float], antenna_input_power: float, tx_frequency: float, rx_frequency: float, comms_law: str = 'Nearest', antenna_pattern_path: str = '', friendlyStations: list[str] = [], friendlySpacecraft: list[str] = []) bytes[source]¶
Add a radio subsystem to a spacecraft.
- Parameters:
sat_name (str) – name of the spacecraft, for which to add the radio.
orientation (list[float]) – orientation quaternion w.r.t. the spacecraft.
antenna_input_power (float) – the power fed into the antenna input [W].
tx_frequency (float) – transmission frequency [Hz].
rx_frequency (float) – receive frequency [Hz].
antenna_pattern_path (str, optional) – path to an antenna radiation pattern csv file. path can be absolute, or if it is not absolute, it will be interpreted as relative to /MDS_Solaris_Data/StreamingAssets/.
friendlyStations (list[str], optional) – list of friendly station names. is only relevant if comms_law is “Friendly”.
friendlySpacecraft (list[str], optional) – list of friendly spacecraft names. is only relevant if comms_law is “Friendly”.
- mds_api.add_sat(sat_name: str, mass: float, local_pos: list[float], local_vel: list[float], central_body: str, referenceArea: float = 1.0, coefficientDrag: float = 2.2, coefficientSRP: float = 1.2, attitude: list[float] = [0, 0, 0, 1], angularVelocity: list[float] = [0, 0, 0], max_ang_rate: float = 2, max_ang_acc: float = 0.1, rigidbody: bool = False, custom_model_path: str = None, model_rotation_offset: list[float] = [0, 0, 0, 1], print_debug: bool = False) bytes[source]¶
Instantiate a satellite, orbiting around a specified celestial body.
- Parameters:
sat_name (str) – name of the new spacecraft to be instantiated.
mass (float) – mass of the spacecraft [kg]
local_pos (list[float]) – local position of the spacecraft, relative to the central body, in body centered inertial frame (ICRF aligned) [m].
local_vel (list[float]) – velocity relative to central body, in body centered inertial frame (ICRF aligned) [m/s].
central_body (str) – name of the celestial body, around which the spacecraft will be rotating.
attitude (list[float], optional) – attitude quaternion of the spacecraft, relative to ICRF.
angularVelocity (list[float], optional) – angular velocity [rad/s] of the spacecraft, relative to ICRF.
max_ang_rate (float, optional) – maximum angular rate for the spacecraft pointing maneuvers in degrees per second. defaults to 2 [rad/s].
max_ang_acc (float, optional) – maximum angular acceleration for the spacecraft pointing maneuvers in degrees per second per second. defaults to 0.1 [rad/s/s].
rigidbody (bool, optional) – flag to enable or disable rigidbody 6DOF simulation for this spacecraft. defaults to False.
custom_model_path (str, optional) – path to a custom .glb or .gltf 3D model. path can be absolute, or if it is not absolute, it will be interpreted as relative to /MDS_Solaris_Data/StreamingAssets/.
model_rotation_offset (list[float], optional) – orientation quaternion of the 3D model relative to the spacecraft.
print_debug (bool, optional) – flag to turn debug message printing on/off
- mds_api.add_sat_from_elements(sat_name: str, mass: float, a: float, e: float, i: float, Omega: float, omega: float, nu: float, central_body: str, referenceArea: float = 1.0, coefficientDrag: float = 2.2, coefficientSRP: float = 1.2, attitude: list[float] = [0, 0, 0, 1], angular_velocity: list[float] = [0, 0, 0], max_ang_rate: float = 2, max_ang_acc: float = 0.1, rigidbody: bool = False, model_rotation_offset: list[float] = [0, 0, 0, 1], custom_model_path: str = None) bytes[source]¶
Instantiate a satellite with a custom 3d model, orbiting around a specified celestial body.
- Parameters:
sat_name (str) – name of the new spacecraft to be instantiated
mass (float) – mass of the spacecraft [kg]
a (float) – semi-major axis [m]
e (float) – eccentricity [-]
i (float) – inclination [deg]
Omega (float) – right ascension of the ascending node [deg]
omega (float) – argument of periapsis [deg]
nu (float) – true anomaly [deg]
central_body (str) – name of central body
attitude (list[float], optional) – attitude quaternion of the spacecraft, relative to ICRF.
max_ang_rate (float, optional) – maximum angular rate for the spacecraft pointing maneuvers in degrees per second. defaults to 2 [rad/s].
max_ang_acc (float, optional) – maximum angular acceleration for the spacecraft pointing maneuvers in degrees per second per second. defaults to 0.01 [rad/s/s].
rigidbody (bool, optional) – flag to enable or disable rigidbody 6DOF simulation for this spacecraft. defaults to False.
custom_model_path (str, optional) – path to a custom .glb or .gltf 3D model. path can be absolute, or if it is not absolute, it will be interpreted as relative to /MDS_Solaris_Data/StreamingAssets/.
model_rotation_offset (list[float], optional) – orientation quaternion of the 3D model relative to the spacecraft.
- mds_api.add_sensor(sensor_name: str, sat_name: str, sensor_type: str, orientation: list[float], fov: list[float], pixel_dims: list[float], range: float, line_color_r: int = 0, line_color_g: int = 0, line_color_b: int = 255, line_color_a: int = 255, cone_color_r: int = 0, cone_color_g: int = 0, cone_color_b: int = 255, cone_color_a: int = 60, replace: bool = False) bytes[source]¶
Add a sensor to the spacecraft.
- Parameters:
sat_name (str) – name of the spacecraft, for which to add the sensor.
sensor_type (str) – type of the sensor. currently only ‘Optical’.
orientation (list[float]) – orientation quaternion w.r.t. the spacecraft body axes.
fov (list[float]) – field of view angles [deg].
pixel_dims (list[int]) – horizontal and vertical pixel dimensions.
range (float) – range of the sensor [m].
- mds_api.add_single_spacecraft_measurement(measurement_name: str, reference_sat: str, description: str = '') bytes[source]¶
Add single spacecraft, which measures the target’s position and veocity in LVLH frame of the reference sat.
- Parameters:
measurement_name (str) – Name, by which you’re going to call your measurement
reference_sat (str) – reference satellite name, in whose frame measurements are carried out.
description (str) – an optional description if you want to attach it to your measurement. Defaults to just empty string.
- mds_api.add_solar_panel(sat_name: str, position: list[float], rotation: list[float], area: float, max_power: float, efficiency: float, display_axis: bool = True) bytes[source]¶
Add a solar panel to the spacecraft.
- Parameters:
sat_name (str) – name of the spacecraft to which the panel shall be added.
position (list) – local position vector of the solar panel’s center, w.r.t. spacecraft body frame origin [m].
rotation (list) – local rotation quaternion of the solar panel w.r.t. spacecraft body z-axis.
max_power (float) – maximum power that can be generated by this solar panel [W].
area (float) – area of the solar panel [m^2].
efficiency (float) – efficiency of the solar cells [-].
display_axis (bool, optional) – flag to turn the visual aid axis on/off. default True.
- mds_api.add_solar_sat(sat_name: str, mass: float, position: list[float], velocity: list[float]) bytes[source]¶
Instantiate a new spacecraft with specified mass, global position and velocity.
- Parameters:
sat_name (str) – name of the spnew spacecraft
mass (float) – mass of the new spacecraft [kg].
position (list[float]) – solar barycentric position of a spacecraft [m].
velocity (list[float]) – velocity of the spacecraft in ICRF coordinates, [m/s]
- mds_api.add_thrusters(sat_name: str, thruster_config: list, main_thrusters: bool = False) bytes[source]¶
Add new RCS thrusters for the satellite.
@param sat_name: name of the satellite for which the thrusters are being added. @param thruster_config: list of thruster configs to add. Each member must be a
dict with parameters, use create_thruster_config_dict() function to create such a dict
@param
- mds_api.apply_thrust(sat_name: str, thrust: list[float], inertial: bool = False) bytes[source]¶
Apply a thrust.
- Parameters:
sat_name (str) – name of the spacecraft to which the thrust should be applied.
thrust (list) – thrust vector in ICRF, to be applied during the next simulation step [N].
inertial (bool) – if True, thrust is applied in the inertial ICRF frame.
- mds_api.apply_thrust_torque(sat_name: str, thrust: list[float], torque: list[float], inertial: bool = False) bytes[source]¶
Apply a thrust and a torque.
- Parameters:
sat_name (str) – name of the spacecraft to which the thrust and torque should be applied.
thrust (list) – thrust vector in spacecraft body frame, to be applied during the next simulation step [N].
torque (list) – torque vector in spacecraft body frame, to be applied during the next simulation step [Nm].
inertial (bool) – if True, thrust and torque are applied in the inertial ICRF frame.
- mds_api.apply_torque(sat_name: str, torque: list[float], inertial: bool = False) bytes[source]¶
Apply a torque
- Parameters:
sat_name (str) – name of the spacecraft, for which the torque will be applied.
torque (list[float]) – torque vector in the spacecraft body frame [Nm].
inertial (bool) – if True, torque is applied in the inertial ICRF frame.
- mds_api.attach_camera_to_sat(sat_name: str, attach: bool = True, focal_length: float = 20.78461, distance_from_satellite: float = 0.0, near_plane: float = 0.3, far_plane: float = 1000000.0, sensor_size_x: float = 36.0, sensor_size_y: float = 24.0, lens_shift_x: float = 0.0, lens_shift_y: float = 0.0, gate_fit: str = 'Horizontal', iso: int = 200, shutter_speed: float = 100, focus_distance: float = 5.0, aperture: float = 16, lens_distortion_intensity: float = 0.0, bloom_intensity: float = 0.0, bloom_scatter: float = 0.0, color_grain_intensity: float = 0.0, color_grain_response: float = 0.0, chromatic_aberration: float = 0.0, enable_lens_flare: bool = False, texture_width: int = 1024, texture_height: int = 1024, enable_capture: bool = False, capture_interval: float = 1.0, camera_quaternion: list[float] = [0, 0, 0, 1], python_server_ip: str = None, python_server_port: int = None, enable_depth_of_field: bool = True)[source]¶
Attach a camera to a spacecraft.
- Parameters:
sat_name (str) – name of the spacecraft, to which the camera will be attached.
attach (bool, optional) – True attaches the camera, False detaches it.
focal_length (float, optional) – focal length of the camera [mm].
distance_from_satellite (float, optional) – distance from the satellite [m].
near_plane (float, optional) – near clipping plane of the camera [m].
far_plane (float, optional) – far clipping plane of the camera [m].
sensor_size_x (float, optional) – sensor size in the horizontal dimension [mm].
sensor_size_y (float, optional) – sensor size in the vertical dimension [mm].
lens_shift_x (float, optional) – The lens offset of the camera in the x direction. The lens shift is relative to the sensor size. For example, a lens shift of 0.5 offsets the sensor by half its horizontal size.
lens_shift_y (float, optional) – The lens offset of the camera in the y direction.
gate_fit (str, optional) – Enum used to specify how the sensor gate (sensor frame) defined by sensor_size fits into the resolution gate (render frame). Options are: “Vertical”, “Horizontal”, “Fill”, “Overscan”, “None”.
enable_capture (bool, optional) – Flag to turn frame capture on and off. When True, frames are saved to a local directory every capture_interval. Default is False.
camera_quaternion (list[float], optional) – quaternion of the camera orientation relative to X axis
capture_interval (float, optional) – interval at which to capture frames, if enable_capture is True [s].
python_server_ip (str, optional) – IP of a python server to send the frames to. Default is None.
python_server_port (int, optional) – port of a python server to send the frames to. Default is None.
- mds_api.calculate_coverage(resolution=50000, data_index=0)[source]¶
call to take fleet-data, create an Earth-grid and perform a coverage calculation.
- Parameters:
resolution (int, optional) – total propagation time. Defaults to 50000.
data_index (int, optional) – the propagated data’s time index to be used for the
0. (instantaneous coverage calculation. Defaults to)
Returns:
- mds_api.calculate_gs_pass(prop_time=3600, prop_time_step=60)[source]¶
call to do an offline fleet propagation and compute ground station passes between added satellites and available ground assests
- Parameters:
prop_time (int, optional) – total propagation time. Defaults to 3600.
prop_time_step (int, optional) – propagation timestep. Defaults to 60.
Returns:
- mds_api.check_constraint(sat_name: str)[source]¶
Check constraints on satellite for monitoring
- Parameters:
sat_name (str) – sat name
- mds_api.clear_objects(object_name_list: list[str])[source]¶
Remove objects from the simulation.
- Parameters:
object_name_list (list[str]) – list of object names to be removed.
- mds_api.clear_sensors(sat_name: str) bytes[source]¶
Remove all sensors from a satellite.
- Parameters:
sat_name (str) – name of the satellite, from which all sensors will be removed.
- mds_api.configure_rcs_thrusters(sat_name: str, configs: dict) bytes[source]¶
- Configure RCS thruster params. You can set new position, rotation or
enable/disable firing directions.
@param sat_name: name of the satellite for which you are configuring. @param configs: a dict with key being the index of a thruster,
and value being a dict with data for corresponding thruster. You may use create_thruster_config_dict() function to create such a dict.
- mds_api.create_thruster_config_dict(position=None, rotation=None, XPlus=None, XMinus=None, YPlus=None, YMinus=None, ZPlus=None, ZMinus=None)[source]¶
Create the dict that holds the knowledge of configuration
- mds_api.create_walker_constellation(constellation_name: str, mass: float, i: float, t: int, p: int, f: float, ANLongitude: float, orbitRadius: float, central_body: str, ta_offset: float = 0, referenceArea: float = 1.0, coefficientDrag: float = 2.2, coefficientSRP: float = 1.2) bytes[source]¶
Create satellites in a walker constallation
- Parameters:
constellation_name (str) – name of the new spacecraft to be instantiated
mass (float) – mass of the spacecraft [kg]
i (float) – inclination [deg]
t (int) – number of spacecraft
p (int) – number of planes
f (float) – relative spacing between satellites in adjacent planes. actual spacing in degrees is calculated by formula f*360/t
ANLongitude (float) – right ascension of the ascending node [deg]
orbitRadius (float) – orbit radius [m]
central_body (str) – name of central body
ta_offset (float) – true anomaly offset for the first spacecraft [deg], defaults to 0
- mds_api.extract_pos_vel(dict)[source]¶
extract position and velocity from config dict.
Return tuple (name, position, velocity)
- mds_api.get_camera_frame(sat_name: str, delay: bool = True) bytes[source]¶
Get the current frame from a camera attached to satellite.
- Parameters:
sat_name (str) – name of the spacecraft with the camera of interest
delay (bool) – workaround in MDS1.3.0 to make sure camera image matches camera UI
- mds_api.get_celestial_body_data(*names: str) tuple[float, dict][source]¶
Get data about specified celestial bodies.
- Parameters:
names (str) – names of the celestial bodies.
- mds_api.get_config_part(part_name: str) tuple[float, str][source]¶
Retrieve a specified part of the simulation config from MDS.
- Parameters:
part_name (str) – the name of the CelestialBody, PropagatedBody or GroundStation to get the config of.
- mds_api.get_degrees(deg: str) float[source]¶
Utility function: get degrees in float format. If you give argument as float, you get the same float. If you give argument as string, it must be degrees-minutes-seconds and E or W or N or S in the end.
You then get a numeric representation of it as float. For example: 45o35’43’’E or 33deg15’53’’S
- mds_api.get_ground_asset_data(*names: str) tuple[float, dict][source]¶
Get data about a specified ground station(s).
- Parameters:
names (str) – names of the ground stations.
- mds_api.get_sat_data(*names: str) tuple[float, dict][source]¶
Get data about a specified satellite/spacecraft.
- Parameters:
names (str) – names of the spacecraft
- mds_api.get_sat_elements(*names: str) tuple[float, list[float]][source]¶
Get osculating Kepler elements of a specified satellite/spacecraft.
- Parameters:
names (str) – names of the spacecraft
- mds_api.get_sat_pos_vel(*names: str) tuple[float, list[float], list[float]][source]¶
Get local position and velocity of a specified satellite/spacecraft.
- Parameters:
names (str) – names of the spacecraft
- mds_api.get_tle(sat_names: str | list, max_iterations: int = 35, max_days_back: int = 5) bytes[source]¶
Get Two-Line Elements. Computes a Two-Line Elements string from the Cartesian state of the spacecraft.
- Parameters:
sat_name (str) – Name of the spacecraft or a list of names.
- mds_api.load_OMM(xml_path: str, desired_spacecraft: list | None = None)[source]¶
Load an OMM file from a specified path
- Parameters:
xml_path – filename to OMM.
- mds_api.load_config(cfg_path: str) bytes[source]¶
Order MDS to load a new configuration. Loads configurationn from a specified file and sends to MDS.
- Parameters:
cfg_path (str) – path to config file (on client machine)
- mds_api.load_orbits_from_csv(csv_path: str)[source]¶
Load a list of spacecraft from a CSV file.
- Parameters:
csv_path (str) – a path to the csv file, on client computer.
- mds_api.load_tle_from_file(filename: str, desired_spacecraft: list | None = None)[source]¶
Load Two-Line Elements. Pre-computes orbital ephemeris with the SGP4 propagator and adds a spacecraft to follow that trajectory. Can be a single TLE or multiple TLEs.
- Parameters:
tle (str) – Two-Line Elements string. May contain one or multiple TLEs.
desired_spacecraft (list) – A list of spacecraft that you want to load from the file. In None or empty, then all spacecraft in the file will be loaded. Otherwise, only spacecraft with names in the list will be loaded. Default: None.
- mds_api.optimize_transfer(sat_name: str, a: float, e: float, i: float, Omega: float, omega: float, alpha1: float | None = None, alpha2: float | None = None, mode: str = 'OPTIMIZE_DELTAV', maxDeltaT: float | None = None, maxDeltaV: float | None = None)[source]¶
Order an optimal orbit transfer.
- Parameters:
sat_name (str) – name of the spacecraft, which will perform the transfer.
a (float) – desired semi-major axis in meters.
e (float) – desired eccentricity.
i (float) – desired inclination in degrees.
Omega (float) – desired ascending node longitude in degrees.
omega (float) – desired argument of periapsis in degrees.
alpha1 (float) – initial orbit exit point true anomaly in degrees (TA in your first orbit where you apply maneuver)
alpha2 (float) – target orbit entry point true anomaly in degrees (TA in transfer orbit, where the second maneuver will be applied)
mode (enum) – desired optimization goal: (default) ‘OPTIMIZE_DELTAV’, ‘OPTIMIZE_TRANSFER_TIME’, ‘OPTIMIZE_TIME’.
maxDeltaT (float) – DeltaV constraint: Maximum allowed DeltaV. Used when you do time optimization.
maxDeltaT – Time constraint: Maximum allowed time for transfer, when you optimize for deltaV.
- mds_api.remove_lvlh_frame_measurement(measurement_name: str) bytes[source]¶
Remove LVLH frame measruement.
- Parameters:
measurement_name (str) – Name of the measurement you want to remove
- mds_api.remove_single_spacecraft_measurement(measurement_name: str) bytes[source]¶
Remove single spacecraft measurement.
- Parameters:
measurement_name (str) – Name of the measurement you want to remove
- mds_api.retrieve_lvlh_frame_measurements(measurement_name: str | list | None = None) bytes[source]¶
Retrive measurement data of one or multiple measurements.
- Parameters:
measurement_name (str or List or None) – Name or list of names of measurements you want to retrieve data from. If not specified, defaults to None, in which case you are going to receive data of all measurements that are there.
- Returns:
julian date of when the measurement was taken
a dict, representing data of measurements. You can access a particular measurement by using its name as a key.
- mds_api.retrieve_single_spacecraft_measurements(measurement_name: str | list | None = None) bytes[source]¶
Retrive measurement data of one or multiple measurements.
- Parameters:
measurement_name (str or List or None) – Name or list of names of measurements you want to retrieve data from. If not specified, defaults to None, in which case you are going to receive data of all measurements that are there.
- Returns:
julian date of when the measurement was taken
a dict, representing data of measurements. You can access a particular measurement by using its name as a key.
- mds_api.save_OMM(sat_names: str | list | None, max_iterations=35, num_days_back=5)[source]¶
Retrieve OMM file of all satellites as string.
- mds_api.schedule_maneuver_at_date(sat_name: str, julian_date: float, delta_v: list[float], burn_time: float) bytes[source]¶
Schedule a maneuver for a specified date.
- Parameters:
sat_name (str) – name of the spacecraft, for which the maneuver will be scheduled.
julian_date (float) – julian date, for which the maneuver is scheduled.
delta_v (list[float]) – a vector of 3 components - delta V in inertial frame [m/s].
burn_time (float) – time, which wil be taken to complete the maneuver [s].
- mds_api.send_log_message(message: str)[source]¶
Send a message to be inserted to the mission log.
- Parameters:
message (string) – message to be added to the mission log.
- mds_api.set_attitude_covariance(sat_name: str, covariance_matrix: list[list[float]]) bytes[source]¶
Set the attitude covariance matrix of a spacecraft.
- Parameters:
sat_name (str) – name of the spacecraft, for which the attitude covariance belongs.
covariance_matrix (list[list[float]]) – 4x4 covariance matrix specified as list of lists.
- mds_api.set_attitude_parameters(sat_name: str, max_rotation_rate: float, max_rotation_accel: float) bytes[source]¶
Set the attitude control constraints for a spacecraft.
- Parameters:
sat_name (str) – name of the spacecraft, for which to set the attitude parameters.
max_rotation_rate (float) – maximum possible rotation rate magnitude in [deg/s].
max_rotation_accel (float) – maximum possible angular acceleration magnitude in [deg/s/s].
- mds_api.set_constraint(sat_name: str, constraint_type: int, limits: list[float], target: str = '')[source]¶
Check constraints on satellite for monitoring
- Parameters:
sat_name (str) – sat name
constraint_type (int) – enum type for constraint 1 - semi_major axis 2 - eccentricity 3 - inclination 4 - ltan
limits (list[float]) – [min, max] limits for constraint
target (str, optional) – when applicable - relative target. Defaults to “”.
Returns:
- mds_api.set_pointing_mode(sat_name: str, mode_name: str) bytes[source]¶
Set the pointing mode of satellite.
- Parameters:
sat_name (str) – name of the spacecraft.
mode_name (str) – a string that represents the pointing mode. available modes are: Idle, Nadir, Sun, Earth,
ClosestStation.
- mds_api.set_pointing_target(sat_name: str, quaternion: list[float]) bytes[source]¶
Set a custom pointing target quaternion for a spacecraft.
- Parameters:
sat_name (str) – name of spacecraft
quaternion ([float]) – list of [x,y,z,w] quaternion values representing ICRF to body frame rotation.
- mds_api.set_sat_angular_velocity(sat_name: str, angular_velocity: list[float], attitude: list[float] = None, convert_to_world: bool = False) bytes[source]¶
Hard set the angular velocity of a spacecraft.
- Parameters:
sat_name (str) – name of the spacecraft.
angular_velocity (list[float]) – rad/s the angular velocity vector, specifying the desired angular velocity of the target in either its body frame (if convert_to_world is set to True, default behaviour) or the ICRF world frame (if convert_to_world is set to False).
attitude (optional, list[float]) – the attitude quaternion, specifying spacecraft’s body frame rotation from the inertial ICRF frame. in [x,y,z,w] format. Necessary only when convert_to_world is set to True to convert from body frame to ICRF frame.
convert_to_world (optional, bool) – Whether or not to convert the given angular velocity from body frame to inertial ICRF frame. True by default because MDS expects the angular velocity to be specified in the inertial ICRF frame. If set to False then the attitude parameter can be left out also.
- mds_api.set_sat_attitude(sat_name: str, quaternion: list[float]) bytes[source]¶
Hard set the attitude of a spacecraft.
- Parameters:
sat_name (str) – name of the spacecraft.
quaternion (list[float]) – the attitude quaternion, specifying spacecraft’s body frame rotation from the inertial ICRF frame. in [x,y,z,w] format.
- mds_api.set_sat_position(sat_name: str, position: list[float]) bytes[source]¶
Hard set the position of a spacecraft.
- Parameters:
sat_name (str) – name of the spacecraft.
position (list[float]) – the position vector, specifying spacecraft’s position in body-centered inertial frame, with origin at the central body’s c.o.g. and axes aligned with ICRF.
- mds_api.set_sat_propagation_attributes(sat_name: str, mass: float = 1, area: float = 1, c_d: float = 2.2, c_srp=1.2)[source]¶
Alter satellite mass, surface area expsoed to drag/srp and drag/srp coefficients
- Parameters:
sat_name (str) – satellite name to select
mass (float, optional) – selected mass [kg]. Defaults to 1.
area (float, optional) – selected surface area [m^2]. Defaults to 1.
c_d (float, optional) – Drag coefficient [-]. Defaults to 2.2.
c_srp (float, optional) – Solar radiation pressure coefficient [-]. Defaults to 1.2.
- mds_api.set_sat_track(sat_name: str, enabled: bool, new_track_interval: int, r: float, g: float, b: float, a: float)[source]¶
Attach a camera to a spacecraft.
- Parameters:
sat_name (str) – name of the spacecraft, to which the camera will be attached.
enabled (bool) – True enables the sensor track, False disables it.
new_track_interval (int) – simulation interval at which to produce track mark [s].
r (float) – RGBA values ranging from 0 to 1 that set the color of the track.
g (float) – RGBA values ranging from 0 to 1 that set the color of the track.
b (float) – RGBA values ranging from 0 to 1 that set the color of the track.
a (float) – RGBA values ranging from 0 to 1 that set the color of the track.
- mds_api.set_state_covariance(sat_name: str, covariance_matrix: list[list[float]]) bytes[source]¶
Set the state covariance matrix of a spacecraft.
- Parameters:
sat_name (str) – name of the spacecraft, for which the state covariance belongs.
covariance_matrix (list[list[float]]) – 6x6 covariance matrix specified as list of lists.
- mds_api.set_time_scale(scale: float)[source]¶
Set the timescale of simulation.
- Parameters:
scale (float) – time multiplier
- mds_api.set_utc_date(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int)[source]¶
Set the simulation date as UTC TDB date-time.
- Parameters:
year (int) – the year.
month (int) – the month.
day (int) – the day.
hour (int) – the hour.
minute (int) – the minute.
second (int) – the second.
millisecond (int) – the millisecond.
- mds_api.toggle_celestial_vector(enabled: bool, celestial_body: str) bytes[source]¶
Toggle celestial vector for a specified celestial body. CelestialBodies values: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, Moon, Sun
- Parameters:
enabled (bool) – flag that enables/disables celestial vector.
celestial_body (str) – name of the celestial body that the celestial vector shall point to.
- mds_api.visualize_thrusters(sat_name, thrust_body, thrust_min=0)[source]¶
visualizes the thrusters by converting body-frame thrust to booleans of whether the positive/negative values exeed the thrust_min_shown threshold
- Parameters:
thrust_body (array) – body-frame thrust [N]
thrust_min (float) – minimum thrust to visualize [N]