Environment data

Analytical models

Analytical computation of Solar System bodies

At the moment, only the Earth, the Moon and the Sun are available

class beyond.env.solarsystem.EarthPropagator
classmethod propagate(date)

Propagate the orbit to a given date

Parameters

date (Date) –

Return type

Orbit

class beyond.env.solarsystem.MoonPropagator

Dummy propagator for moon position

class beyond.env.solarsystem.SunPropagator

Dummy propagator for Sun position

beyond.env.solarsystem.get_body(name)

Retrieve a given body orbits and parameters

Parameters

name (str) – Object name

Returns

object containig the main parameters of the celestial body

as well as a propagator

Return type

Body

Raises

UnknownBodyError – when the object is not handled

beyond.env.solarsystem.get_frame(name)
Parameters

name (str) – Object name

Returns

A frame centered on a solar system object

Return type

Frame

Raises

UnknownBodyError – when the object is not handled

JPL ephemeris

This module allow to extract data from .bsp files (provided by JPL) and integrate them in the frames stack.

See the NAIF website for more informations about the format and content of these files.

For the module to work properly, the .bsp files should be sourced via the env.jpl.files configuration variable.

The following configuration will provide access to the Solar System, Mars, Jupiter, Saturn and their respective major satellites

from beyond.config import config

config.set("env", "jpl", "files", [
    "/path/to/de430.bsp",
    "/path/to/mar097.bsp",
    "/path/to/jup310.bsp",
    "/path/to/sat360xl.bsp"
])

This module rely heavily on the jplephem library, which parse the binary .bsp format

In order to use a reference frame of a celestial object, one has to create it first. For example, to compute the Orbit of the ISS with respect to the reference frame of Mars (because, why not !)

from beyond.env.jpl import create_frames

iss.frame = "Mars"  # would fail

create_frames()
iss.frame = "Mars"  # would succeed

Alternatively, it is possible to set the env.jpl.dynamic_frames configuration variable to True to force the frame creation when needed. By default this is disabled.

In addition to .bsp files, you can provide files in the PCK text format (generally with a .tpc extension), which contain informations about masses and dimensions of most of the solar system bodies.

These files allows to convert to keplerian elements with correct physical constants (mainly µ).

config.set("env", "jpl", "files", [
    "/path/to/de430.bsp",
    "/path/to/mar097.bsp",
    "/path/to/jup310.bsp",
    "/path/to/sat360xl.bsp",
    "/path/to/pck00010.tpc",
    "/path/to/gm_de431.tpc"
])

Examples of both .bsp and .tcp files are available in the tests/data/jpl folder.

To display the content of a .bsp file you can use:

$ python -m beyond.env.jpl <file>...
beyond.env.jpl.create_frames()

Create all frames available from the .bsp files

beyond.env.jpl.get_orbit(name, date)

Get an Orbit object of a celestial body at a given date

beyond.env.jpl.list_bodies()

List bodies available through .tpc files