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

Choose an interface for a first fit, model experiment, archive, or sample.

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

Your first analysis

The Quick start downloads a real SDSS quasar spectrum and fits its continuum and covered lines. Continue to Results and measurements to report broad Hβ and reload a saved analysis. For an introduction to flux units, frames, masks, and widths, read Spectral quantities and conventions.

Fit your own arrays

The following excerpt assumes your own wavelength, flux, uncertainty, redshift, ra, and dec variables. It uses physical cgs flux density (flux_scale=1.0). For scaled survey arrays or relative flux, follow Fit arrays in memory. Array spectra are uncorrected by default; prepare them 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.