qsospec
Fit UV, optical, and near-infrared quasar spectra with reproducible continuum, emission-line, host-decomposition, QA, and batch workflows.
Install qsospec and fit a spectrum with the default global model.
Compare array, file, host-decomposition, and batch interfaces.
Read fitted, masked, unmodelled, and residual regions correctly.
See the built-in line complexes and their current coverage rules.
Minimal array example
Array spectra are uncorrected by default. Prepare them explicitly before using the low-level numerical fitters.
import qsospec
spectrum = qsospec.Spectrum.from_arrays(
wavelength,
flux,
err=uncertainty,
z=redshift,
wave_frame="observed",
flux_unit="cgs",
ra=ra,
dec=dec,
)
result = qsospec.fit_global_lines(
qsospec.prepare_spectrum(spectrum)
)
print(result.continuum_success)
print(result.complex_statuses)
What is included
Global power-law, Fe II, and continuous Balmer pseudo-continuum fitting.
Coverage-aware Lyα/N V, C IV, C III], Mg II, Balmer, optical, and NIR recipes.
Optional pPXF host decomposition for objects with \(z < 1.2\).
Galactic dereddening for file and batch workflows.
User-friendly preparation of uncorrected in-memory arrays.
QA plots that distinguish fitted, pPXF-masked, and unmodelled regions.
Resumable Parquet run bundles for single objects and large samples.
User Guide
How-to Guides
Science Model
Reference
Contributing
Project links
GitHub · PyPI · Issues · GPLv3 license