PySPEDAS allows you to override mission-specific defaults (stored in each mission's config.py) using a user TOML file. This prevents the need to edit the installed package directly.
Precedence Order
When determining a value, PySPEDAS follows this order of precedence:
- Explicit load-function parameter
- Existing environment variable
- User preference (TOML file)
- PySPEDAS default
Note: A preference cannot override an environment variable already recognized by a mission. Only keys already present in a mission's CONFIG dictionary are supported.
Configuration File Location
The default file is preferences.toml located in the platform's user configuration directory (e.g., ~/.config/pyspedas/preferences.toml on Linux). You can find the exact path using pyspedas.preferences.preferences_path().
You can point PySPEDAS to a different file (for testing or project-specific setups) by setting the PYSPEDAS_CONFIG_FILE environment variable.
[projects.themis]
local_data_dir = "/data/themis"
remote_data_dir = "https://spdf.gsfc.nasa.gov/pub/data/themis/"
[pyspedas.plotting]
global_display = false
plot_directory = "pyspedas_plots"
[pyspedas.testing]
output_dir = "/data/pyspedas-tests"
validation_dir = "https://github.com/spedas/test_data/raw/refs/heads/main/"
global_display = false