nav.config

YAML-backed configuration for RMS-NAV.

Loads and merges settings from bundled defaults and optional user YAML files using ruamel.yaml.YAML (safe typ), then exposes sections as nav.support.attrdict.AttrDict for attribute-style access. The Config class is the main public entry; helpers such as _as_str_list() validate list-shaped YAML fragments used when building config structures.

Bases: object

Manages configuration settings for the navigation system.

This class handles loading, updating, and accessing configuration settings from YAML files. It provides access to various configuration sections through properties and methods.

Returns backplanes configuration, including bodies, rings, and target LIDs.

Returns the celestial bodies configuration settings.

Returns the bootstrap configuration settings.

Returns the configuration settings for the specified category.

Load bundled default YAML if not already loaded.

Safe to call repeatedly; delegates to read_config() with no path (same early-return behavior when data is already present).

Returns the environment configuration settings.

Returns the list of fuzzy satellites for the specified planet.

Parameters:

planet – The name of the planet to get fuzzy satellites for.

Returns:

A list of fuzzy satellite names for the specified planet.

Returns the general configuration settings.

Whether merged YAML is present (after read_config / update_config).

Returns the offset configuration settings.

Returns PDS4 bundle generation configuration.

Returns the list of configured planet names.

Reads configuration from the specified YAML file.

Parameters:
  • config_path – Path to the configuration file. If None, uses the default config files.

  • reread – Whether to reread the configuration file if it has already been read.

Returns the list of ring satellites for the specified planet.

Parameters:

planet – The name of the planet to get ring satellites for.

Returns:

A list of ring satellite names for the specified planet.

Returns the planetary rings configuration settings.

Returns the list of satellites for the specified planet.

Parameters:

planet – The name of the planet to get satellites for.

Returns:

A list of satellite names for the specified planet.

Returns the stars configuration settings.

Returns the Titan-specific configuration settings.

Updates the current configuration with values from the specified YAML file.

Parameters:
  • config_path – Path to the configuration file containing update values.

  • read_default – Whether to read the default configuration file if no config has been previously read.

Logger instances and setup for the nav_offset pipeline.

Provides two PdsLogger instances:

  • MAIN_LOGGER ("nav_offset") – top-level program events, written to stdout and to a timestamped logfile under NAV_RESULTS_ROOT/logs/nav_offset/.

  • IMAGE_LOGGER ("nav_image") – per-image processing events; both its stdout handler and its per-image logfile handler are attached as local handlers inside each logger.open() context so they are active only while that image is being processed.

Call setup_logging() from main() after the nav-results root and CLI arguments have been resolved. It is safe to call more than once: existing MAIN_LOGGER handlers are removed before new ones are attached.

Create local handlers for a single image: a stdout handler and a file handler.

Both levels are resolved from arguments, then config.general, then "INFO". The returned handlers should be passed to IMAGE_LOGGER.open() so they are active only while that image is being processed and are automatically removed when that context exits.

Parameters:
  • image_log_path – Destination path for this image’s log file.

  • arguments – Parsed CLI arguments, or None to fall back entirely to config.

  • config – Navigation configuration.

Returns:

A list containing a stdout stream handler and a file handler for the image log.

Raises:
  • TypeError – If a configured log level is not a string or None.

  • ValueError – If a configured log level string is empty or not a standard name.

Configure MAIN_LOGGER with stdout and a timestamped file handler.

Reads each log level from arguments first, then from config.general, then falls back to "INFO". The main logfile is written as a timestamped file under {nav_results_root}/logs/nav_offset/.

IMAGE_LOGGER handlers are not configured here; both its console and per-image file handlers are attached as local handlers inside each IMAGE_LOGGER.open() context via image_log_handlers(). However, the image log levels from --log-level-image-console and --log-level-image-file are validated here so that invalid values are caught at startup (before the batch loop) alongside the main-level validation.

Parameters:
  • arguments – Parsed CLI arguments; may carry log_level_main_console, log_level_main_file, log_level_image_console, and log_level_image_file attributes.

  • config – Navigation configuration providing general.* fallback values.

  • nav_results_root_str – Local filesystem path to the navigation results root.

Raises:
  • TypeError – If a configured log level is not a string or None.

  • ValueError – If a configured log level string is empty or not a standard name.