A fast and robust Python package for fitting quasar spectra
Project description
qsospec
qsospec is a Python package for fitting UV, optical, and
near-infrared quasar spectra. It provides array-based local and global fitting,
recipe-driven emission complexes, bundled iron and Balmer templates, optional
pPXF host subtraction, and resumable Parquet batch runs.
Installation
python -m pip install qsospec
Install optional pPXF host decomposition with:
python -m pip install "qsospec[host]"
For development:
python -m pip install -e ".[dev,host]"
pytest
Quick start
import qsospec
spectrum = qsospec.Spectrum.from_arrays(
wavelength,
flux,
err=uncertainty,
z=redshift,
wave_frame="observed",
)
result = qsospec.fit_global_lines(spectrum)
Lyα/N V is selected automatically when useful rest-frame coverage exists. The default continuum then uses red-side anchors and the fit records whether coverage is full, red-side-only, edge-truncated, or absent:
result = qsospec.fit_global_lines(
spectrum,
lya_nv_config=qsospec.LyaNVComplexConfig(
nv_mode="effective_blend",
),
)
lya = result.line_complexes.get("lya_nv")
if lya is not None:
print(lya.metadata["lya_coverage_status"])
print(lya.metadata["lya_fit_reliable"])
Pass an explicit complex list without "lya_nv" to disable it. Use
nv_mode="equal_doublet" for a shared-kinematics N V doublet, or pass
global_config=qsospec.GlobalContinuumConfig.lya_safe() explicitly when
customizing the continuum model.
Single spectra and large samples share the same Parquet-backed run format:
run = qsospec.fit_object_to_store("spectrum.fits", "runs/object", redshift=1.2)
batch = qsospec.fit_batch(["spectra-000.parquet"], "runs/sample")
The project is licensed under GPLv3. The initial implementation was extracted
from qsofitmore.neofit; its source history is retained in this repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qsospec-0.1.0.tar.gz.
File metadata
- Download URL: qsospec-0.1.0.tar.gz
- Upload date:
- Size: 352.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d63be5b77bc81ab3a96af83976efb0affcccb9128b6a418fd882bdaa06814bb
|
|
| MD5 |
2332ddfa864339108f3b80a41b14d9e8
|
|
| BLAKE2b-256 |
39498d40aab30d7e16d16dba41a1548e310dad7d5c9477b25772388f557c2289
|
Provenance
The following attestation bundles were made for qsospec-0.1.0.tar.gz:
Publisher:
python-publish.yml on rudolffu/qsospec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qsospec-0.1.0.tar.gz -
Subject digest:
6d63be5b77bc81ab3a96af83976efb0affcccb9128b6a418fd882bdaa06814bb - Sigstore transparency entry: 1883807745
- Sigstore integration time:
-
Permalink:
rudolffu/qsospec@af60a6597e3f4965426398df23f49988ff3601da -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rudolffu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@af60a6597e3f4965426398df23f49988ff3601da -
Trigger Event:
release
-
Statement type:
File details
Details for the file qsospec-0.1.0-py3-none-any.whl.
File metadata
- Download URL: qsospec-0.1.0-py3-none-any.whl
- Upload date:
- Size: 335.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6a42578dd2646901f28f50670ed2b255ecca7489a1d5fd487ca95202451dfcb
|
|
| MD5 |
138c022b3e93cb272ba2e52584cc5b3e
|
|
| BLAKE2b-256 |
aeb64f6c2ded8dfb0c2aeaf897db44628e930866e01d6b4a2a657803e92d4fe1
|
Provenance
The following attestation bundles were made for qsospec-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on rudolffu/qsospec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qsospec-0.1.0-py3-none-any.whl -
Subject digest:
c6a42578dd2646901f28f50670ed2b255ecca7489a1d5fd487ca95202451dfcb - Sigstore transparency entry: 1883807828
- Sigstore integration time:
-
Permalink:
rudolffu/qsospec@af60a6597e3f4965426398df23f49988ff3601da -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rudolffu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@af60a6597e3f4965426398df23f49988ff3601da -
Trigger Event:
release
-
Statement type: