speclib documentation

speclib provides tools for loading, interpolating, resampling, binning, broadening, and synthesizing photometry from stellar model spectra. It currently supports PHOENIX ACES (Husser et al. 2013), MPS-ATLAS (Kostogryz et al. 2023), SPHINX (Iyer et al. 2023), PHOENIX/1D NewEra spectra (Hauschildt et al. 2025), and the discrete 3D-MHD stellar surface-component spectra of Smitha et al. (2025), and center-to-limb specific intensities from Kostogryz et al. (2026).

The package provides Spectrum and SpectralGrid for flux spectra, plus SpecificIntensitySpectrum and SpecificIntensityGrid for angle-dependent intensities. Units remain explicit throughout.

Install the current development release with:

python -m pip install git+https://github.com/brackham/speclib.git

A minimal spectrum that requires no download is only a few lines:

import astropy.units as u
import numpy as np
from speclib import Spectrum

wavelength = np.linspace(5000, 5100, 1001) * u.AA
flux = np.ones(wavelength.size) * u.erg / (u.s * u.cm**2 * u.AA)
spectrum = Spectrum(spectral_axis=wavelength, flux=flux)
sampled = spectrum.resample(np.linspace(5010, 5090, 81) * u.AA)

Start with the Quickstart, work through the downloadable Tutorials and examples, or go directly to the API reference. Before downloading a model grid, read Model libraries for coverage, archive size, cache behavior, citations, and limitations.

New users

Installation · Quickstart · Tutorials and examples

Scientific reference

User guide · Model libraries · API reference