Helpers
- dsns.helpers.GRAVITATIONAL_CONSTANT: float = 6.6743e-11
Gravitational constant, in m^3 / (kg * s^2)
- dsns.helpers.EARTH_MASS = 5.9722e+24
Mass of the Earth, in kg
- dsns.helpers.EARTH_RADIUS = 6378100.0
Radius of the Earth, in m
- dsns.helpers.EARTH_ROTATION_PERIOD = 86400.0
Rotation period of the Earth, in s
- dsns.helpers.EARTH_ORBITAL_PERIOD = 31558118.4
Orbital period of the Earth, in s
- dsns.helpers.EARTH_ORBITAL_RADIUS = 149598000000.0
Orbital radius of the Earth, in m
- dsns.helpers.MARS_MASS = 6.4171e+23
Mass of Mars, in kg
- dsns.helpers.MARS_RADIUS = 3389500.0
Radius of Mars, in m
- dsns.helpers.MARS_ROTATION_PERIOD = 88619.62
Rotation period of Mars, in s
- dsns.helpers.MARS_ORBITAL_PERIOD = 59355072.0
Orbital period of Mars, in s
- dsns.helpers.MARS_ORBITAL_RADIUS = 227939000000.0
Orbital radius of Mars, in m
- dsns.helpers.MOON_MASS = 7.342e+22
Mass of the Moon, in kg
- dsns.helpers.MOON_RADIUS = 1737400.0
Radius of the Moon, in m
- dsns.helpers.MOON_ROTATION_PERIOD = 2360591.5104
Rotation period of the Moon, in s
- dsns.helpers.MOON_ORBITAL_PERIOD = 2360591.5104
Orbital period of the Moon, in s
- dsns.helpers.MOON_ORBITAL_RADIUS = 384748000.0
Orbital radius of the Moon, in m
- dsns.helpers.SPEED_OF_LIGHT = 299792458.0
Speed of light, in m/s
- dsns.helpers.GROUND_STATIONS_AWS = array([[ 53.7798, -7.3055, 0. ], [ 59.3293, 18.0686, 0. ], [ 26.0667, 50.5577, 0. ], [ -33.9249, 18.4241, 0. ], [ 37.5665, 126.978 , 0. ], [ 1.3521, 103.8198, 0. ], [ -32.243 , 148.6048, 0. ], [ 19.8968, -155.5828, 0. ], [ 43.8041, -120.5542, 0. ], [ 40.4173, -82.9071, 0. ], [ -53.1634, -70.9078, 0. ], [ 62.0758, -153.6101, 0. ]])
Locations of cities/countries containing AWS ground stations From https://aws.amazon.com/ground-station/locations/
- dsns.helpers.orbital_period(semi_major_axis: float, mass: float, gravitational_constant: float = 6.6743e-11)
Calculate the orbital period of an orbit given its semi-major axis and the mass of the central body.
- Parameters:
semi_major_axis – Semi-major axis of the orbit (m).
mass – Mass of the central body (kg).
gravitational_constant – Gravitational constant (m^3 / (kg * s^2)).
- Returns:
Orbital period (s).
- dsns.helpers.get_semi_major_axis(orbital_period: float, mass: float, gravitational_constant: float = 6.6743e-11)
Calculate the semi-major axis of an orbit given its orbital period and the mass of the central body.
- Parameters:
orbital_period – Orbital period (s).
mass – Mass of the central body (kg).
gravitational_constant – Gravitational constant (m^3 / (kg * s^2)).
- Returns:
Semi-major axis of the orbit (m).
- dsns.helpers.lat_lon_alt_to_xyz(lat_lon_alt: ndarray, host_radius: float) ndarray
Convert a set of latitude, longitude and altitude coordinates to Cartesian coordinates.
- Parameters:
lat_lon_alt – Array of latitude, longitude and altitude coordinates (degrees, degrees, m).
host_radius – Radius of the central body (m).
- Returns:
Array of Cartesian coordinates (m, m, m).
- class dsns.helpers.IDHelper
Helper class for generating unique IDs.
- __init__()
Initialise the ID helper.
- get_id(name: str) int | None
Get the ID for a given name.
- Parameters:
name – Name to look up.
- Returns:
ID for the given name, or None if no ID has been assigned.
- get_name(id_: int) str | None
Get the name for a given ID.
- Parameters:
id – ID to look up.
- Returns:
Name for the given ID, or None if the ID has not been assigned.
- assign_id(name: str) int
Assign an ID to a name.
- Parameters:
name – Name to assign an ID to.
- Returns:
ID for the given name.
- dsns.helpers.threaded(fn)
Decorator for running a function in a separate thread.