Configuration

The configuration of the library is handled via a dictionary. It is accessible via:

from beyond.config import config
print(config)

In order to dynamically modify values of the dictionary, it is preferable to use the update() method.

The configuration dictionary contains a few fields useful for the library behavior. A description of the fields is provided here.

Config dict specification

eop

missing_policy

Define the behavior of the library when encountering a missing value in the environment data. Current variable behavior are:

  • pass - Use zero as a value

  • warning - Same as pass, and issues a warning

  • error - Raise an exception

If this variable is not set, the library will use MIS_DEFAULT

dbname

Define the database used by the library in order to retrieve model corrections and time-scales differences. See eop. If omitted, the default database will be DEFAULT_DBNAME

env

jpl

files

This variable is optional and is only needed if you wish to track planets or other solar system bodies.

It should be a list of BSP files in which to look for solar system bodies (planets, moons, comets, etc.). de430.bsp, mar097.bsp, jup310.bsp, sat360xl.bsp

More information in the beyond.env.jpl module.

dynamic_frames

This variable is optional and if set to True, allows to create solar system celestial bodies reference frame dynamically, whitout the need to call create_frames(). By default, this variable is False.

from beyond.config import config

config.set("env", "jpl", "files", ["/path/to/de430.bsp"])
config.set("env", "jpl", "dynamic_frames", True)

API

Configuration handler

The configuration is a simple dictionary. See Configuration for details.

class beyond.config.Config

Configuration

Example

from space.config import config

print(config['env']['eop_missing_policy'])
print(config.get('env', 'non-existent-field', fallback=25))
get(*keys, fallback=None)

Retrieve a value in the config, if the value is not available give the fallback value specified.

set(*args)

Set a value in the config dictionary

The last argument is the value to set

Example:

config.set('aaa', 'bbb', True)
print(config)
# {
#     'aaa': {
#         'bbb': True
#     }
# }