API reference#

The Python package spectroxide wraps the Rust PDE solver and provides a pure-Python analytic Green’s-function implementation. Most users will only need the top-level import:

import spectroxide

Plot styling lives in submodules and must be imported explicitly:

from spectroxide.plot_params import SINGLE_COL, DOUBLE_COL

Primary solver#

spectroxide.solver. The full photon-Boltzmann PDE (Kompaneets + double Compton + bremsstrahlung) with adaptive redshift stepping. Handles single-burst, custom-scenario, photon-injection, and tabulated-heating runs. This is what you almost certainly want.

PDE solver (spectroxide.solver)

Approximations and helpers#

The remaining modules support cross-checks, fast estimates, and publication-quality plotting. They are useful but secondary; the science targets are computed by the PDE solver above.

Analytic Green’s function

spectroxide.greens — pure-Python implementation of the three-component analytic Green’s function of Chluba (2013, MNRAS 436, 2232). Spectral shapes, μ/y/T branching functions, energy-injection and photon-injection convolutions. An approximation — accuracy is documented on that page.

Analytic Green’s function (spectroxide.greens)
PDE-based numerical Green’s function

spectroxide.greens_table — precomputed numerical Green’s function from the Rust PDE, tabulated for fast convolution. More accurate than the analytic GF in the μ↔y transition region (3 × 10⁴ < z < 10⁵).

PDE-based numerical Green’s function (spectroxide.greens_table)
FIRAS data

spectroxide.firas — load the COBE/FIRAS monopole, residuals, and the full 43 × 43 covariance matrix from the LAMBDA archive. Includes χ² and upper-limit utilities for downstream constraints.

FIRAS data (spectroxide.firas)
Cosmology

spectroxide.cosmology — flat ΛCDM background quantities (Hubble rate, densities, recombination history), the Cosmology dataclass, and the DEFAULT_COSMO / PLANCK2015_COSMO / PLANCK2018_COSMO presets that other modules pull from.

Cosmology (spectroxide.cosmology)
Plotting

spectroxide.style and spectroxide.plot_params — Matplotlib style and constants for publication-quality figures.

Plotting utilities (spectroxide.style, spectroxide.plot_params)