Skip to main content

A fast and robust Python package for fitting quasar spectra

Project description

qsospec

Documentation Status PyPI Python License

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.

Installation

python -m pip install qsospec

For host-galaxy decomposition:

python -m pip install "qsospec[host]"

Minimal example

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.

Features

  • 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qsospec-0.1.1.tar.gz (851.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qsospec-0.1.1-py3-none-any.whl (346.6 kB view details)

Uploaded Python 3

File details

Details for the file qsospec-0.1.1.tar.gz.

File metadata

  • Download URL: qsospec-0.1.1.tar.gz
  • Upload date:
  • Size: 851.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qsospec-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0a8e2573a256163505708cb3899c7d9a0eb4acaeae0a055d14e5f45b92192706
MD5 e62f034d34fb945c59cb4af433a2fa42
BLAKE2b-256 d65476edb8c7e4e40bc46a5ce6da48c1db7d8d275868f63df0ef6a9beddeb98a

See more details on using hashes here.

Provenance

The following attestation bundles were made for qsospec-0.1.1.tar.gz:

Publisher: python-publish.yml on rudolffu/qsospec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qsospec-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: qsospec-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 346.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qsospec-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a66cfc60c96c1491f0a9d01ffb02cd3f3d9669e314f1c90709ed6bef7129768
MD5 420ede96e313797ec7ec776e1bff954a
BLAKE2b-256 12c45ea02d35521d5ca96928634ed89ae305cc73f6400ffcc7f1e3e47a49b55c

See more details on using hashes here.

Provenance

The following attestation bundles were made for qsospec-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on rudolffu/qsospec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page