qsospec

Fit UV, optical, and near-infrared quasar spectra with reproducible continuum, emission-line, host-decomposition, QA, and batch workflows.

Start fitting

Install qsospec and fit a spectrum with the default global model.

Quick start
Choose a workflow

Compare array, file, host-decomposition, and batch interfaces.

Choose a workflow
Interpret QA

Read fitted, masked, unmodelled, and residual regions correctly.

Reading QA plots
Browse recipes

See the built-in line complexes and their current coverage rules.

Recipe reference

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.