qsospec fits UV, optical, and near-infrared quasar spectra. It provides
coverage-aware emission-line recipes, continuum decomposition, optional pPXF
host subtraction, QA figures, and resumable Parquet run bundles.
python -m pip install qsospecFor host-galaxy decomposition:
python -m pip install "qsospec[host]"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_object_to_store(
spectrum,
"runs/my-quasar",
object_id="my-quasar",
global_config=qsospec.GlobalContinuumConfig(
power_law=qsospec.PowerLawConfig(mode="auto"),
),
write_qa=True,
)
result.show_qa()Uncorrected spectra are dereddened by default with Planck GNILC and the
Fitzpatrick (1999) law. This requires locally configured
dustmaps
data; already-corrected spectra can be declared with
galactic_extinction_corrected=True.
- Single or automatically selected broken power-law continua, Fe II, and a continuous Balmer pseudo-continuum.
- Lyα/N V, C IV, C III], Mg II, Balmer, optical, and NIR line complexes.
- Optional pPXF host decomposition for quasars at
z < 1.2. - Notebook-friendly and saved QA figures.
- Shared single-object and parallel batch run format.
See the documentation for setup, workflows, model definitions, examples, and API reference.
qsospec is distributed under the
GPLv3 license.