settings#

Setup functionality for SkySim. Includes both methods for parsing a configuration TOML, and converting that data in Settings (and friends) objects.

Constants#

AIRY_DISK_RADIUS

How far light from an object should spread.

MAXIMUM_LIGHT_SPREAD

Calculate the spread of light from an object out to this many standard deviations.

Type Aliases#

ConfigValue

Type alias.

ConfigMapping

Type alias.

TOMLConfig

Type alias.

SettingsPair

Type alias.

Classes#

Settings

Base class to interpret often-used configuration values.

ImageSettings

Settings subclass to hold values used when populating the image array.

PlotSettings

Settings subclass to hold values used when generating the final plot Additionally contains a copy of all attributes belonging to the Settings instance it inherits from.

Functions#

High-Level Functions#

load_from_toml(filename[, return_settings])

Load configuration options from a TOML file and parse them into Settings objects.

Low-Level Functions#

toml_to_dicts(filename)

Read the configuration file and combine it with the default configuration to get dictionaries of values which can be used for the various Settings classes.

split_nested_key(full_key)

Convert a string of the form 'a.b.c' into a list of the form ['a','b','c'].

access_nested_dictionary(dictionary, keys)

Access a value from an arbitrarily nested dictionary via a list of keys.

check_key_exists(dictionary, full_key)

Check if a key exists within a nested dictionary.

check_mandatory_toml_keys(dictionary)

Validate the existence of the required keys in the TOML configuration.

parse_angle_dict(dictionary)

Convert a dictionary of the form {degrees:X, arcminutes:Y, arcseconds:Z} to a single Quantity.

time_to_timedelta(time_object)

Converts a datetime.time object to a datetime.timedelta.

get_config_option(toml_dictionary, toml_key, ...)

Access a config value from the TOML config provided, and if not present, search the provded default config.

angle_to_dms(angle)

Convert a astropy angle to a pretty-printed string.