All content

This is the list of all content in paseos.

class paseos.ActorBuilder

Bases: object

This class is used to construct actors.

static add_comm_device(actor: BaseActor, device_name: str, bandwidth_in_kbps: float)

Creates a communication device.

Parameters
  • device_name (str) – device_name of the communication device.

  • bandwidth_in_kbps (float) – device bandwidth in kbps.

static add_custom_property(actor: BaseActor, property_name: str, initial_value: Any, update_function: Callable)

Adds a custom property to the actor. This e.g. allows tracking any physical the user would like to track.

The update functions needs to take three parameters as input: the actor, the time to advance the state / model and the current_power_consumption_in_W and return the new value of the custom property. The function will be called with (actor,0,0) to check correctness.

Parameters
  • actor (BaseActor) – The actor to add the custom property to.

  • property_name (str) – The name of the custom property.

  • initial_value (Any) – The initial value of the custom property.

  • update_function (Callable) – The function to update the custom property.

static get_actor_scaffold(name: str, actor_type: object, epoch: epoch)

Initiates an actor with minimal properties.

Parameters
  • name (str) – Name of the actor.

  • actor_type (object) – Type of the actor (e.g. SpacecraftActor)

  • epoch (pykep.epoch) – Current local time of the actor.

Returns

Created actor

static set_TLE(actor: SpacecraftActor, line1: str, line2: str)

Define the orbit of the actor using a TLE. For more information on TLEs see https://en.wikipedia.org/wiki/Two-line_element_set .

TLEs can be obtained from https://www.space-track.org/ or https://celestrak.com/NORAD/elements/

Parameters
  • actor (SpacecraftActor) – Actor to update.

  • line1 (str) – First line of the TLE.

  • line2 (str) – Second line of the TLE.

Raises

RuntimeError – If the TLE could not be read.

static set_central_body(actor: ~paseos.actors.spacecraft_actor.SpacecraftActor, pykep_planet: <module 'pykep.planet' from '/home/docs/checkouts/readthedocs.org/user_builds/paseos/conda/latest/lib/python3.11/site-packages/pykep/planet/__init__.py'>, mesh: tuple = None, radius: float = None, rotation_declination: float = None, rotation_right_ascension: float = None, rotation_period: float = None)

Define the central body of the actor. This is the body the actor is orbiting around.

If a mesh is provided, it will be used to compute visibility and eclipse checks. Otherwise, a sphere with the provided radius will be used. One of the two has to be provided.

Note the specification here will not affect the actor orbit. For that, use set_orbit, set_TLE or set_custom_orbit.

Parameters
  • actor (SpacecraftActor) – Actor to update.

  • pykep_planet (pk.planet) – Central body as a pykep planet in heliocentric frame.

  • mesh (tuple) – A tuple of vertices and triangles defining a mesh.

  • radius (float) – Radius of the central body in meters. Only used if no mesh is provided.

  • rotation_declination (float) – Declination of the rotation axis in degrees in the

  • 0. (the central body's inertial frame. Rotation at current actor local time is presumed to be) –

  • rotation_right_ascension (float) – Right ascension of the rotation axis in degrees in

  • 0.

  • rotation_period (float) – Rotation period in seconds. Rotation at current actor local time is presumed to be 0.

static set_custom_orbit(actor: SpacecraftActor, propagator_func: Callable, epoch: epoch)

Define the orbit of the actor using a custom propagator function. The custom function has to return position and velocity in meters and meters per second respectively. The function will be called with the current epoch as the only parameter.

Parameters
  • actor (SpacecraftActor) – Actor to update.

  • propagator_func (Callable) – Function to propagate the orbit.

  • epoch (pk.epoch) – Current epoch.

static set_ground_station_location(actor: GroundstationActor, latitude: float, longitude: float, elevation: float = 0, minimum_altitude_angle: float = 30)

Define the position of a ground station actor.

Parameters
  • actor (GroundstationActor) – Actor to update.

  • latitude (float) – Latitude of the ground station in degrees.

  • longitude (float) – Longitude of the ground station in degrees.

  • elevation (float) – A distance specifying elevation above (positive)

  • below (or) –

  • 0. (ellipsoid specified by the WSG84 model in meters. Defaults to) –

  • minimum_altitude_angle (float) – Minimum angle above the horizon that

  • with. (this station can communicate) –

static set_orbit(actor: ~paseos.actors.spacecraft_actor.SpacecraftActor, position, velocity, epoch: ~pykep.core.core.epoch, central_body: <module 'pykep.planet' from '/home/docs/checkouts/readthedocs.org/user_builds/paseos/conda/latest/lib/python3.11/site-packages/pykep/planet/__init__.py'>)

Define the orbit of the actor

Parameters
  • actor (BaseActor) – The actor to define on

  • position (list of floats) – [x,y,z].

  • velocity (list of floats) – [vx,vy,vz].

  • epoch (pk.epoch) – Time of position / velocity.

  • central_body (pk.planet) – Central body around which the actor is orbiting as a pykep planet.

static set_position(actor: BaseActor, position: list)

Sets the actors position. Use this if you do not want the actor to have a keplerian orbit around a central body.

Parameters
  • actor (BaseActor) – Actor set the position on.

  • position (list) – [x,y,z] position for SpacecraftActor.

static set_power_devices(actor: SpacecraftActor, battery_level_in_Ws: float, max_battery_level_in_Ws: float, charging_rate_in_W: float, power_device_type: PowerDeviceType = PowerDeviceType.SolarPanel)

Add a power device (battery + some charging mechanism (e.g. solar power)) to the actor. This will allow constraints related to power consumption.

Parameters
  • actor (SpacecraftActor) – The actor to add to.

  • battery_level_in_Ws (float) – Current battery level in Watt seconds / Joule

  • max_battery_level_in_Ws (float) – Maximum battery level in Watt seconds / Joule

  • charging_rate_in_W (float) – Charging rate of the battery in Watt

  • power_device_type (PowerDeviceType) – Type of power device.

  • SolarPanel. (Either "SolarPanel" or "RTG" at the moment. Defaults to) –

static set_radiation_model(actor: SpacecraftActor, data_corruption_events_per_s: float, restart_events_per_s: float, failure_events_per_s: float)

Enables the radiation model allowing data corruption, activities being interrupted by restarts and potentially critical device failures. Set any of the passed rates to 0 to disable that particular model.

Parameters
  • actor (SpacecraftActor) – The actor to add to.

  • data_corruption_events_per_s (float) – Single bit of data being corrupted, events per second,

  • Upset (i.e. a Single Event) –

  • restart_events_per_s (float) – Device restart being triggered, events per second.

  • failure_events_per_s (float) – Complete device failure, events per second, i.e. a Single Event Latch-Up (SEL).

static set_thermal_model(actor: SpacecraftActor, actor_mass: float, actor_initial_temperature_in_K: float, actor_sun_absorptance: float, actor_infrared_absorptance: float, actor_sun_facing_area: float, actor_central_body_facing_area: float, actor_emissive_area: float, actor_thermal_capacity: float, body_solar_irradiance: float = 1360, body_surface_temperature_in_K: float = 288, body_emissivity: float = 0.6, body_reflectance: float = 0.3, power_consumption_to_heat_ratio: float = 0.5)

Add a thermal model to the actor to model temperature based on heat flux from sun, central body albedo, central body IR, actor IR emission and due to actor activities. For the moment, it is a slightly simplified version of the single node model from “Spacecraft Thermal Control” by Prof. Isidoro Martínez available at http://imartinez.etsiae.upm.es/~isidoro/tc3/Spacecraft%20Thermal%20Modelling%20and%20Testing.pdf

Parameters
  • actor (SpacecraftActor) – Actor to model.

  • actor_mass (float) – Actor’s mass in kg.

  • actor_initial_temperature_in_K (float) – Actor’s initial temperature in K.

  • actor_sun_absorptance (float) – Actor’s absorptance ([0,1]) of solar light

  • actor_infrared_absorptance (float) – Actor’s absportance ([0,1]) of IR.

  • actor_sun_facing_area (float) – Actor area facing the sun in m^2.

  • actor_central_body_facing_area (float) – Actor area facing central body in m^2.

  • actor_emissive_area (float) – Actor area emitting (radiating) heat.

  • actor_thermal_capacity (float) – Actor’s thermal capacity in J / (kg * K).

  • body_solar_irradiance (float, optional) – Irradiance from the sun in W. Defaults to 1360.

  • body_surface_temperature_in_K (float, optional) – Central body surface temperature. Defaults to 288.

  • body_emissivity (float, optional) – Centrla body emissivity [0,1] in IR. Defaults to 0.6.

  • body_reflectance (float, optional) – Central body reflectance of sun light. Defaults to 0.3.

  • power_consumption_to_heat_ratio (float, optional) – Conversion ratio for activities.

  • 0.5. (0 leads to know heat-up due to activity. Defaults to) –

class paseos.BaseActor(name: str, epoch: epoch)

Bases: ABC

This (abstract) class is the baseline implementation of an actor (e.g. spacecraft, ground station) in the simulation. The abstraction allows some actors to have e.g. limited power (spacecraft) and others not to.

property central_body: CentralBody

Returns the central body this actor is orbiting.

charge(duration_in_s: float)

Charges the actor from now for that period. Note that it is only verified the actor is neither at start nor end of the period in eclipse, thus short periods are preferable.

Parameters

duration_in_s (float) – How long the activity is performed in seconds

property communication_devices: DotMap

Returns the communications devices.

Returns

Dictionary (DotMap) of communication devices.

Return type

DotMap

property current_activity: str

Returns the name of the activity the actor is currently performing.

Returns

Activity name. None if no activity being performed.

Return type

str

property custom_properties

Returns a dictionary of custom properties for this actor.

discharge(consumption_rate_in_W: float, duration_in_s: float)

Discharge battery depending on power consumption. Not implemented by default.

Parameters
  • consumption_rate_in_W (float) – Consumption rate of the activity in Watt

  • duration_in_s (float) – How long the activity is performed in seconds

get_altitude(t0: epoch = None) float

Returns altitude above [0,0,0]. Will only compute if not computed for this timestep.

Parameters

t0 (pk.epoch) – Epoch to get altitude at. Defaults to local time.

Returns

Altitude in meters.

Return type

float

get_custom_property(property_name: str) Any

Returns the value of the specified custom property.

Parameters

property_name (str) – The name of the custom property.

Returns

The value of the custom property.

Return type

Any

get_custom_property_update_function(property_name: str) Callable

Returns the update function for the specified custom property.

Parameters

property_name (str) – The name of the custom property.

Returns

The update function for the custom property.

Return type

Callable

get_position(epoch: epoch)

Compute the position of this actor at a specific time. Requires orbital parameters or position set.

Parameters

epoch (pk.epoch) – Time as pykep epoch

Returns

[x,y,z] in meters

Return type

np.array

get_position_velocity(epoch: epoch)

Compute the position / velocity of this actor at a specific time. Requires orbital parameters set.

Parameters

epoch (pk.epoch) – Time as pykep epoch.

Returns

[x,y,z] in meters

Return type

np.array

property has_central_body: bool

Returns true if actor has a central body, else false.

Returns

bool indicating presence.

Return type

bool

property has_power_model: bool

Returns true if actor’s battery is modeled, else false.

Returns

bool indicating presence.

Return type

bool

property has_radiation_model: bool

Returns true if actor’s temperature is modeled, else false.

Returns

bool indicating presence.

Return type

bool

property has_thermal_model: bool

Returns true if actor’s temperature is modeled, else false.

Returns

bool indicating presence.

Return type

bool

is_in_eclipse(t: epoch = None)

Checks if the actors is in eclipse at the specified time.

Parameters

t (pk.epoch, optional) – Time to check, if None will use current local actor time.

is_in_line_of_sight(other_actor: BaseActor, epoch: epoch, minimum_altitude_angle: float = None, plot=False)

Determines whether a position is in line of sight of this actor

Parameters
  • other_actor (BaseActor) – The actor to check line of sight with

  • epoch (pk,.epoch) – Epoch at which to check the line of sight

  • minimum_altitude_angle (float) – The altitude angle (in degree) at which the actor has

  • 90. (to be in relation to the ground station position to be visible. It has to be between 0 and) –

  • station. (Only relevant if one of the actors is a ground) –

  • plot (bool) – Whether to plot a diagram illustrating the positions.

Returns

true if in line-of-sight.

Return type

bool

property local_time: epoch

Returns local time of the actor as pykep epoch. Use e.g. epoch.mjd2000 to get time in days.

Returns

local time of the actor

Return type

pk.epoch

property mass: float

Returns actor’s mass in kg.

Returns

Mass

Return type

float

name = None
set_custom_property(property_name: str, value: Any) None

Sets the value of the specified custom property.

Parameters
  • property_name (str) – The name of the custom property.

  • value (Any) – The value to set for the custom property.

set_time(t: epoch)

Updates the local time of the actor.

Parameters

t (pk.epoch) – Local time to set to.

class paseos.CentralBody(planet: <module 'pykep.planet' from '/home/docs/checkouts/readthedocs.org/user_builds/paseos/conda/latest/lib/python3.11/site-packages/pykep/planet/__init__.py'>, initial_epoch: ~pykep.core.core.epoch, mesh: tuple = None, encompassing_sphere_radius: float = None, rotation_declination: float = None, rotation_right_ascension: float = None, rotation_period: float = None)

Bases: object

Class representing a central body. This can be the Earth but also any other user-defined body in the solar system.

blocks_sun(actor, t: epoch, plot=False) bool

Checks whether the central body blocks the sun for the given actor.

Parameters
  • actor (SpacecraftActor) – The actor to check

  • t (pk.epoch) – Epoch at which to check

  • plot (bool) – Whether to plot a diagram illustrating the positions.

Returns

True if the central body blocks the sun

Return type

bool

is_between_actors(actor_1, actor_2, t: epoch, plot=False) bool

Checks whether the central body is between the two actors.

Parameters
  • actor_1 (SpacecraftActor) – First actor

  • actor_2 (SpacecraftActor) – Second actor

  • t (pk.epoch) – Epoch at which to check

  • plot (bool) – Whether to plot a diagram illustrating the positions.

Returns

True if the central body is between the two actors

Return type

bool

is_between_points(point_1, point_2, t: epoch, reference_frame: ReferenceFrame = ReferenceFrame.CentralBodyInertial, plot: bool = False) bool

Checks whether the central body is between the two points.

Parameters
  • point_1 (np.array) – First point

  • point_2 (np.array) – Second point

  • t (pk.epoch) – Epoch at which to check

  • reference_frame (ReferenceFrame, optional) – Reference frame of the points.

  • ReferenceFrame.CentralBodyInertial. (Defaults to) –

  • plot (bool) – Whether to plot a diagram illustrating the positions.

Returns

True if the central body is between the two points

Return type

bool

property planet
class paseos.GroundstationActor(name: str, epoch: epoch)

Bases: BaseActor

This class models a groundstation actor.

get_position(epoch: epoch)

Compute the position of this ground station at a specific time. Positions are in J2000 geocentric reference frame, same reference frame as for the spacecraft actors. Since the Earth is rotating, ground stations have a non-constant position depending on time.

Parameters

epoch (pk.epoch) – Time as pykep epoch

Returns

[x,y,z] in meters

Return type

np.array

class paseos.PASEOS(local_actor: BaseActor, cfg)

Bases: object

This class serves as the main interface with the user.

add_known_actor(actor: BaseActor)

Adds an actor to the simulation.

Parameters

actor (BaseActor) – Actor to add

advance_time(time_to_advance: float, current_power_consumption_in_W: float, constraint_function: function = None)

Advances the simulation by a specified amount of time

Parameters
  • time_to_advance (float) – Time to advance in seconds.

  • current_power_consumption_in_W (float) – Current power consumed per second in Watt.

  • constraint_function (FunctionType) – Constraint function which will be evaluated

  • False. (every cfg.sim.activity_timestep seconds. Aborts the advancement if) –

Returns

Time remaining to advance (or 0 if done)

Return type

float

empty_known_actors()

Clears the list of known actors.

get_cfg() DotMap

Returns the current cfg of the simulation

Returns

cfg

Return type

DotMap

property is_running_activity

Allows checking whether there is currently an activity running.

Returns

Yes if running an activity.

Return type

bool

property known_actor_names: list

Returns names of known actors.

Returns

List of names of known actors.

Return type

list

property known_actors: dict

Returns known actors.

Returns

Dictionary of the known actors.

Return type

dict of BaseActor

property local_actor: BaseActor

Returns the local actor.

Returns

Local actor

Return type

BaseActor

property local_time: epoch

Returns local time of the actor as pykep epoch. Use e.g. epoch.mjd2000 to get time in days.

Returns

local time of the actor

Return type

pk.epoch

log_status()

Updates the status log.

model_data_corruption(data_shape: list, exposure_period_in_s: float)

Computes a boolean mask for each data element that has been corrupted.

Parameters
  • data_shape (list) – Shape of the data to corrupt.

  • exposure_period_in_s (float) – Period of radiation exposure.

Returns

Boolean mask which is True if an entry was corrupted.

Return type

np.array

property monitor

Access paseos operations monitor which tracks local actor attributes such as temperature or state of charge.

Returns

Monitor object.

Return type

OperationsMonitor

perform_activity(name: str, activity_func_args: list = None, termination_func_args: list = None, constraint_func_args: list = None)

Perform the specified activity. Will advance the simulation if automatic clock is not disabled.

Parameters
  • name (str) – Name of the activity

  • power_consumption_in_watt (float, optional) – Power consumption of the

  • None. (activity in seconds if not specified. Defaults to) –

  • duration_in_s (float, optional) – Time to perform this activity. Defaults to 1.0.

Returns

Whether the activity was performed successfully.

Return type

bool

register_activity(name: str, activity_function: coroutine, power_consumption_in_watt: float, on_termination_function: coroutine = None, constraint_function: coroutine = None)

Registers an activity that can then be performed on the local actor.

Parameters
  • name (str) – Name of the activity.

  • activity_function (types.CoroutineType) – Function to execute during the activity.

  • later. (Can accept a list of arguments to be specified) –

  • power_consumption_in_watt (float) – Power consumption of the activity in W (per second).

  • on_termination_function (types.CoroutineType) – Function to execute when the activities stops

  • async. (False if they aren't. Needs to be) –

  • later.

  • constraint_function (types.CoroutineType) – Function to evaluate if constraints are still valid.

  • valid (Should return True if constraints are) –

  • async.

  • later.

remove_activity(name: str)

Removes a registered activity

Parameters

name (str) – Name of the activity.

remove_known_actor(actor_name: str)

Remove an actor from the list of known actors.

Parameters

actor_name (str) – name of the actor to remove.

save_status_log_csv(filename) None

Saves the status log incl. all kinds of information such as battery charge, running activtiy, etc.

Parameters

filename (str) – File to save the log in.

property simulation_time: float

Get the current simulation time of this paseos instance in seconds since start.

Returns

Time since start in seconds.

Return type

float

async wait_for_activity()

This functions allows waiting for the currently running activity to finish.

class paseos.PlotType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Describes the different plot types 1 - SpacePlot

SpacePlot = 1
class paseos.PowerDeviceType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Describes the different power device types 1 - Solar Panels 2 - Radioisotope Thermoelectric Generator (RTG)

RTG = 2
SolarPanel = 1
class paseos.ReferenceFrame(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Enum for used reference frames.

CentralBodyInertial = 1
Heliocentric = 2
class paseos.SpacecraftActor(name: str, epoch: epoch)

Bases: BaseActor

This class models a spacecraft actor which in addition to pos, velocity also has additional constraints such as power/battery.

property battery_level_in_Ws

Get the current battery level.

Returns

current battery level in wattseconds.

Return type

float

charge(duration_in_s: float)

Charges the actor from now for that period. Note that it is only verified the actor is neither at start nor end of the period in eclipse, thus short periods are preferable.

Parameters

duration_in_s (float) – How long the activity is performed in seconds

property charging_rate_in_W

Get the current charging rate.

Returns

current charging rate in W.

Return type

float

discharge(consumption_rate_in_W: float, duration_in_s: float)

Discharge battery depending on power consumption.

Parameters
  • consumption_rate_in_W (float) – Consumption rate of the activity in Watt

  • duration_in_s (float) – How long the activity is performed in seconds

property is_dead: bool

Returns whether the device experienced fatal radiation failure.

Returns

True if device is dead.

Return type

bool

property mass: float

Returns actor’s mass in kg.

Returns

Mass

Return type

float

property power_device_type

Get the power device type

Returns

Type of power device.

Return type

PowerDeviceType

set_is_dead()

Sets this device to “is_dead=True” indicating permanent damage.

set_was_interrupted()

Sets this device to “was_interrupted=True” indicating current activities were interrupted.

property state_of_charge

Get the current battery level as ratio of maximum.

Returns

current battery level ratio in [0,1].

Return type

float

property temperature_in_C: float

Returns the current temperature of the actor in C.

Returns

Actor temperature in Celsius.

Return type

float

property temperature_in_K: float

Returns the current temperature of the actor in K.

Returns

Actor temperature in Kelvin.

Return type

float

property was_interrupted: bool

Returns whether the actor was interrupted in its activity.

Returns

True if device is interrupted.

Return type

bool

paseos.find_next_window(local_actor: BaseActor, local_actor_communication_link_name: str, target_actor: BaseActor, search_window_in_s: float, t0: epoch, search_step_size: float = 10)

Returns the start time of the next window in the given timespan (if any).

Parameters
  • local_actor (BaseActor) – Actor to find window from.

  • local_actor_communication_link_name (str) – Name of the comm device.

  • target_actor (BaseActor) – Actor find window with.

  • search_window_in_s (float) – Size of the search window in s.

  • t0 (pk.epoch) – Start time of the search.

  • search_step_size (float) – Size of steps in the search. Defaults to 10.

Returns

Window start (pk.epoch), window length (float [s]), data (int [b]). None,0,0 if none found.

paseos.get_communication_window(local_actor: BaseActor, local_actor_communication_link_name: str, target_actor: BaseActor, dt: float = 10.0, t0: epoch = None, data_to_send_in_b: int = 9223372036854775807, window_timeout_value_in_s=7200)

Returning the communication window and the amount of data that can be transmitted from the local to the target actor.

Parameters
  • local_actor (BaseActor) – Local actor.

  • local_actor_communication_link_name (str) – Name of the local_actor’s communication link to use.

  • target_actor (BaseActor) – other actor.

  • dt (float) – Simulation timestep [s]. Defaults to 10.

  • t0 (pk.epoch) – Current simulation time. Defaults to local time.

  • data_to_send_in_b (int) – Amount of data to transmit [b]. Defaults to maxint.

  • window_timeout_value_in_s (float, optional) – Timeout for estimating the communication window. Defaults to 7200.0.

Returns

Communication window start time. pk.epoch: Communication window end time. int: Data that can be transmitted in the communication window [b].

Return type

pk.epoch

paseos.load_default_cfg()

Loads the default toml config file from the cfg folder.

paseos.plot(sim: PASEOS, plot_type: PlotType, filename: str = None)

Creates the animation object

Parameters
  • sim (PASEOS) – simulation object

  • plot_type (PlotType) – enum deciding what kind of plot object to be made

  • filename (str, optional) – filename to save the animation to. Defaults to None.

Raises

ValueError – supplied plot type not supported

Returns

Animation object

Return type

Animation

paseos.set_log_level(log_level: str)

Set the log level for the logger.

Parameters

log_level (str) – The log level to set. Options are ‘TRACE’,’DEBUG’, ‘INFO’, ‘SUCCESS’, ‘WARNING’, ‘ERROR’, ‘CRITICAL’.