Installation¶
From PyPI¶
The PyPI release is a source distribution: pip builds the Fortran extension on your machine during installation, so you need a Fortran compiler available (see Requirements).
From source¶
Building the Fortran extension¶
Performance-critical paths (SED interpolation, flux dilution, integration, filter convolution, zero-points) live in two Fortran files:
These are compiled into the sed_model.cc_api extension module. For an editable install, build in place with either:
or:
Both routes drive f2py; with NumPy ≥ 1.26 the f2py backend uses Meson and Ninja under the hood.
The Fortran extension is required at run time, not import time
import sed_model succeeds without the compiled extension — cc_api is loaded lazily on the first run_forward call. If the extension is missing you will get an ImportError at that point with instructions to run make.
Requirements¶
| Requirement | Purpose |
|---|---|
| Python ≥ 3.10 | |
numpy ≥ 1.22 |
arrays, f2py |
pandas ≥ 1.5 |
lookup-table validation |
emcee ≥ 3.1 |
inverse-model MCMC sampling |
gfortran |
compiling the Fortran kernels |
meson, ninja |
f2py build backend |
matplotlib |
optional — plotting in the demo scripts only |
The optional extras defined in pyproject.toml:
Data products¶
SED_Model consumes data prepared by SED_Tools:
- an atmosphere grid directory containing
flux_cube.bin(and alookup_table.csvfor optional validation), and - filter transmission files (two-column
.dat: wavelength in Å, transmission 0–1), optionally organised into instrument directories with an index file.
A Vega reference SED (CSV: wavelength Å, flux erg/s/cm²/Å) is required only if you want Vega-system zero-points. See Grids and Filters for the formats in detail.