pyradtran.config.save_master_config

pyradtran.config.save_master_config#

pyradtran.config.save_master_config(libradtran_bin: str | Path, libradtran_data: str | Path, atmosphere_profile: str | Path | None = None, solar_spectrum: str | Path | None = None, radiosonde_base: str | Path | None = None, output_dir: str | Path = './pyradtran_output', working_dir: str | Path = './pyradtran_work', max_workers: int | None = None, extra: Dict[str, Any] | None = None) Path[source]#

Write (or update) the user master config at ~/.pyradtran/config.yaml.

The master config is layer 2 of the three-layer config cascade. It is ideal for storing machine-specific paths (libRadtran install location, radiosonde archive, …) once so that every individual simulation YAML can stay minimal.

Parameters:
  • libradtran_bin (str or pathlib.Path) – Absolute path to the uvspec executable.

  • libradtran_data (str or pathlib.Path) – Absolute path to the libRadtran data/ directory.

  • atmosphere_profile (str or pathlib.Path, optional) – Default atmosphere profile.

  • solar_spectrum (str or pathlib.Path, optional) – Solar-spectrum file.

  • radiosonde_base (str or pathlib.Path, optional) – Root directory for local radiosonde files.

  • output_dir (str or pathlib.Path, default "./pyradtran_output")

  • working_dir (str or pathlib.Path, default "./pyradtran_work")

  • max_workers (int, optional) – Maximum parallel uvspec processes.

  • extra (dict, optional) – Additional config sections / keys to merge in (e.g. {'execution': {'debug_mode': True}}).

Returns:

The path to the master config file.

Return type:

pathlib.Path

Examples

>>> from pyradtran.config import save_master_config
>>> save_master_config(
...     libradtran_bin="/opt/libradtran/bin/uvspec",
...     libradtran_data="/opt/libradtran/share/libRadtran/data",
... )
PosixPath('/home/user/.pyradtran/config.yaml')