Installation#
Requirements#
Before installing pyRadtran, make sure you have:
Python 3.9 or higher
libRadtran installed on your system
Common scientific Python packages (numpy, pandas, xarray) — installed automatically with pyRadtran
Install from Source#
# Using SSH (if you have SSH keys set up)
git clone git@github.com:FranzFlink/pyRadtran.git
# or standard HTTPS
# git clone https://github.com/FranzFlink/pyRadtran.git
cd pyRadtran
pip install -e .
Installing libRadtran#
pyRadtran requires a working libRadtran installation. Follow these steps:
Download libRadtran from http://www.libradtran.org
Extract the archive and build:
tar -xzvf libradtran-x.yy.tar.gz
cd libradtran-x.yy
./configure
make
make check
Note the installation path — you’ll need it to configure pyRadtran.
Setting Up Your Master Configuration#
pyRadtran uses a layered configuration system. The most important first step after installation is creating your personal master configuration file. This tells pyRadtran where to find libRadtran on your machine:
mkdir -p ~/.pyradtran
Create ~/.pyradtran/config.yaml with the following content, adjusting paths to match your libRadtran installation:
# ~/.pyradtran/config.yaml — User-specific configuration
# This file is loaded automatically and overrides built-in defaults.
# Adjust the paths below to match your local libRadtran installation.
paths:
libradtran_bin: /opt/libradtran/bin/uvspec
libradtran_data: /opt/libradtran/share/libRadtran/data
atmosphere_profile: /opt/libradtran/share/libRadtran/data/atmmod/afglms.dat
solar_spectrum: /opt/libradtran/share/libRadtran/data/solar_flux/NewGuey2003.dat
Tip
Once your master config is set, you typically don’t need to specify libRadtran paths in individual simulation configs — they inherit from your master config automatically.
Optional Dependencies#
Some pyRadtran features require additional packages:
Package |
Purpose |
Install |
|---|---|---|
|
Radiosonde data retrieval from IGRA |
|
|
ERA5 data access from Google Cloud |
|
|
Statistical metrics for validation notebooks |
|
|
Enhanced plotting in some notebooks |
|
# Install all optional dependencies at once
pip install siphon gcsfs scikit-learn seaborn
Verifying Your Installation#
After installation, verify everything works:
import pyradtran
print(pyradtran.__version__)
Then try running the albedo quickstart notebook to confirm that pyRadtran can communicate with libRadtran.