Skip to main content

Unified liNe Intagration Turbo Engine

Project description

unite — Unified liNe Integration Turbo Engine

PyPI Python License: GPL v2 Tests Documentation

unite is a Python package for fast, Bayesian inference of emission lines from astronomical spectra. It is built on JAX, NumPyro, and Astropy, and supports fitting multiple spectra simultaneously with shared kinematics, calibration tokens, and flexible priors.

Originally designed for JWST/NIRSpec but extensible to any spectrograph.

What it does

  • Exact pixel integration of line profiles — fast, memory-efficient, and correct even for undersampled data
  • Simultaneous multi-spectrum fitting across gratings and instruments with shared kinematic parameters (redshift, FWHM)
  • Multiple line profiles: Gaussian, Voigt, Cauchy, Pseudo-Voigt, Laplace, Gauss-Hermite, Split-Normal
  • Flexible continuum models: Linear, Power-Law, Polynomial — auto-generated from line configurations
  • Calibration tokens (flux scale, resolution scale, pixel offset) with free or fixed priors, shared across spectra
  • YAML serialization for reproducible, human-editable configurations
  • User-controlled samplerModelBuilder returns (model_fn, model_args) for use with any NumPyro backend (NUTS, SVI, nested sampling, ...)
  • Instrument support for JWST/NIRSpec (all gratings + PRISM) and generic spectrographs

Installation

pip install unite

Or with Pixi:

pixi add unite

Quick Start

from unite.line import LineConfiguration, Redshift, FWHM, Flux
from unite.continuum import ContinuumConfiguration
from unite.spectrum import Spectrum, Spectra
from unite.model import ModelBuilder

# Configure lines with shared kinematics
line_config = LineConfiguration(...)
continuum_config = ContinuumConfiguration.from_line_config(line_config)

# Load spectra and build the numpyro model
spectra = Spectra([Spectrum(...)])
model_fn, model_args = ModelBuilder(line_config, continuum_config, spectra).build()

# Run with any NumPyro sampler
import numpyro
from numpyro.infer import MCMC, NUTS
mcmc = MCMC(NUTS(model_fn), num_warmup=500, num_samples=1000)
mcmc.run(jax.random.PRNGKey(0), *model_args)

Contributing

Bug reports, feature requests, and pull requests are welcome on GitHub. If you find a bug or have an idea for an improvement, please open an issue — even a brief description is helpful.

Documentation

Full documentation, tutorials, and API reference at unite.readthedocs.io.

Citing

If you use unite in your research, please cite the Zenodo software release. Each versioned release has a unique DOI minted automatically when a GitHub release is created.

DOI

See CITATION.md for BibTeX and details. The Zenodo record lists all releases — visit the link to cite a specific version. GitHub's "Cite this repository" button (top-right of the repo page) also generates citation text directly from CITATION.cff.

License

GPL v3 or later. See LICENSE for details.

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

unite-1.1.1.tar.gz (286.5 kB view details)

Uploaded Source

Built Distribution

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

unite-1.1.1-py3-none-any.whl (187.6 kB view details)

Uploaded Python 3

File details

Details for the file unite-1.1.1.tar.gz.

File metadata

  • Download URL: unite-1.1.1.tar.gz
  • Upload date:
  • Size: 286.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for unite-1.1.1.tar.gz
Algorithm Hash digest
SHA256 0d78a343720d89a3fe6f5589fb0e138d5bd574a268e5ae18db8c616e64f00ff0
MD5 8d308121c8da6267c3cbc332e3babdc5
BLAKE2b-256 ec1f5a5533c7e113733e80a266f6ae1e173f6ded967083d9bb782687905dcae5

See more details on using hashes here.

Provenance

The following attestation bundles were made for unite-1.1.1.tar.gz:

Publisher: publish.yml on TheSkyentist/unite

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

File details

Details for the file unite-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: unite-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 187.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for unite-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4780098191f5a70e0bf305d7df4ce7b439c8cb5cad31210d35e4405c11b238c4
MD5 e3293aca27ba4349d8ace7ecd299b2d7
BLAKE2b-256 226ed0a11837c9c648c0e0975e8195b0b4d878a7d63c9a34e1659e6de9c5dd38

See more details on using hashes here.

Provenance

The following attestation bundles were made for unite-1.1.1-py3-none-any.whl:

Publisher: publish.yml on TheSkyentist/unite

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