pyradtran.config

pyradtran.config#

Configuration system for pyRadtran.

The configuration is assembled from up to three layers, each overriding the previous:

  1. Package defaultsconfig/clean_simulation.yaml shipped with pyRadtran.

  2. User master config~/.pyradtran/config.yaml (paths to libRadtran, preferred solver, etc.).

  3. Simulation config — the YAML file passed to ds.pyradtran.run(config_path=...).

All settings are represented as dataclasses so they can be accessed as typed attributes and validated on construction.

Examples

Load the merged configuration and inspect paths:

>>> from pyradtran.config import load_config
>>> cfg = load_config("config/my_simulation.yaml")
>>> cfg.paths.libradtran_bin
PosixPath('/opt/libradtran/2.0.6/bin/uvspec')

create_example_config(output_path)

Write a commented example YAML config to output_path.

list_atmosphere_profiles()

Print a table of available atmosphere profile short names.

list_solar_spectra()

Print a table of available solar spectrum short names.

load_config([config_path])

Load and merge the three-layer configuration.

save_master_config(libradtran_bin, ...[, ...])

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

CloudParameters([enabled, cloud_type, ...])

Declarative cloud settings used inside SimulationDefaults.

ExecutionConfig([max_workers, ...])

Run-time execution settings.

OutputConfig(filename_prefix, ...)

NetCDF output-file settings.

PathsConfig(libradtran_bin, libradtran_data)

File-system paths required by libRadtran.

SimulationConfig(paths, simulation_defaults, ...)

Top-level configuration container.

SimulationDefaults(rte_solver, ...)

Core simulation parameters passed to uvspec.