Configuration
RMS-NAV uses a hierarchical YAML-based configuration system that allows you to customize behavior without modifying the source code. Understanding how configuration files are loaded and how to override settings is important for effective use of the system.
Configuration Loading Order
The configuration system loads settings in the following order, with later files overriding earlier ones:
Standard Configuration Files: All YAML files in the
src/nav/config_files/directory are loaded in alphabetical order. These files provide default settings for:config_01_general.yaml: General settings including all logging levelsconfig_02_offset.yaml: Offset-finding and star refinement parametersconfig_03_stars.yaml: Star-model and ring-occlusion parametersconfig_04_bodies.yaml: Body (planet/moon) rendering parametersconfig_05_rings.yaml: Ring model parametersconfig_06_titan.yaml: Titan-specific navigation parametersconfig_07_bootstrap.yaml: Bootstrap navigation parametersconfig_10_satellites.yaml: Satellite definitions for each planetconfig_20_jupiter_rings.yaml: Jupiter ring system parametersconfig_21_saturn_rings.yaml: Saturn ring system parametersconfig_22_uranus_rings.yaml: Uranus ring system parametersconfig_23_neptune_rings.yaml: Neptune ring system parametersconfig_30_inst_coiss.yaml: Cassini ISS instrument-specific settingsconfig_31_inst_gossi.yaml: Galileo SSI instrument-specific settingsconfig_32_inst_nhlorri.yaml: New Horizons LORRI instrument-specific settingsconfig_33_inst_vgiss.yaml: Voyager ISS instrument-specific settingsconfig_40_sim.yaml: Simulated image settingsconfig_90_backplanes.yaml: Backplane generation settingsconfig_95_pds4.yaml: PDS4 metadata and export settings for generated products, overrides for PDS4 label templates and mapping of internal fields to PDS4 keys
User Default Configuration: If present, the file
nav_default_config.yamlin the current working directory is loaded. This allows you to set personal defaults that apply to all runs.Command-Line Configuration Files: Any files specified with the
--config-fileoption are loaded in the order specified. These provide the highest priority and can override any previous settings.
Configuration File Structure
Configuration files use YAML format and are organized into sections:
environment:
nav_results_root: /path/to/results
pds3_holdings_root: /path/to/pds3
general:
log_level_model_rings: DEBUG
log_level_nav_correlate_all: DEBUG
offset:
correlation_fft_upsample_factor: 128
star_refinement_enabled: true
bodies:
min_bounding_box_area: 9
oversample_maximum: 2
Each section can contain multiple settings. When multiple configuration files define the same setting, the value from the last file loaded takes precedence.
Logging Configuration
All logging levels are set in the general section of config_01_general.yaml.
Each key accepts a standard log-level string: DEBUG, INFO, WARNING,
ERROR, or CRITICAL.
Main logger (nav_offset – top-level program events):
general.log_level_main_console(default:INFO): Level for output written to stdout while the program runs.general.log_level_main_file(default:INFO): Level for the timestamped logfile written to$NAV_RESULTS_ROOT/logs/nav_offset/.
Image logger (nav_image – per-image processing events, active only while
an image is being processed):
general.log_level_image_console(default:INFO): Level for output written to stdout during image processing.general.log_level_image_file(default:INFO): Level for the per-image logfile written to$NAV_RESULTS_ROOT/logs/{results_path_stub}.log.
Navigation model loggers:
general.log_level_model_bodies(default:INFO): Logging level for the body (planet and moon) navigation model.general.log_level_model_stars(default:INFO): Logging level for the star navigation model.general.log_level_model_rings(default:INFO): Logging level for the ring navigation model.
Navigation technique loggers:
general.log_level_nav_correlate_all(default:INFO): Logging level for thecorrelate_alltechnique, including star refinement.
Annotation:
general.log_level_annotate(default:ERROR): Logging level for the image annotation step.
Example – enable verbose output for star and ring models while keeping other components at the default level:
general:
log_level_model_stars: DEBUG
log_level_model_rings: DEBUG
Creating a User Configuration File
To create your own default configuration:
Create a file named
nav_default_config.yamlin your working directoryAdd only the settings you want to override:
environment: nav_results_root: /my/custom/results/path offset: correlation_fft_upsample_factor: 256
The system will automatically load this file if it exists
Using Command-Line Configuration Overrides
You can override configuration on a per-run basis using --config-file:
nav_offset coiss N1234567890 --config-file /path/to/special_config.yaml
You can specify multiple configuration files, and they will be loaded in order:
nav_offset coiss N1234567890 \
--config-file base_overrides.yaml \
--config-file run_specific.yaml
Command-Line Option Overrides
In addition to configuration files, certain command-line options can override configuration settings directly. These options take precedence over all configuration file settings:
Environment Options
--pds3-holdings-root PATH: Overrides thePDS3_HOLDINGS_DIRenvironment variable and anyenvironment.pds3_holdings_rootconfiguration setting. This specifies the root directory or URL for PDS3 holdings.--nav-results-root PATH: Overrides theNAV_RESULTS_ROOTenvironment variable and anyenvironment.nav_results_rootconfiguration setting. This specifies the root directory or URL where navigation results will be written.
Logging Options
All four logging-level options override the corresponding general.* config
key for that run. Each accepts a standard log-level string: DEBUG, INFO,
WARNING, ERROR, or CRITICAL.
--log-level-main-console LEVEL: Overridegeneral.log_level_main_console– the level at which the main logger writes to stdout.--log-level-main-file LEVEL: Overridegeneral.log_level_main_file– the level at which the main logger writes to its logfile under$NAV_RESULTS_ROOT/logs/nav_offset/.--log-level-image-console LEVEL: Overridegeneral.log_level_image_console– the level at which the image logger writes to stdout during image processing.--log-level-image-file LEVEL: Overridegeneral.log_level_image_file– the level at which the image logger writes to the per-image logfile under$NAV_RESULTS_ROOT/logs/{results_path_stub}.log.
These command-line options provide the highest priority override mechanism,
taking precedence over all configuration files, including those specified with
--config-file.
Example: Combining Configuration Methods
The following example demonstrates how different configuration methods interact:
Default configuration files in
src/nav/config_files/setoffset.correlation_fft_upsample_factor: 128User’s
nav_default_config.yamloverrides it to256Command-line
--config-file custom.yamloverrides it to512The final value used is
512
If you also specify --nav-models stars,rings on the command line, this
overrides any model selection from configuration files, regardless of what’s in
the configuration.