jwspecfit

Resolution-aware emission-line fitting, MCMC sampling, and chemical abundance derivation for JWST NIRSpec spectra.

jwspecfit is a coordinated suite of three Python packages covering the complete analysis path from 1-D extracted NIRSpec spectra to element abundances:

jwspecfit

Least-squares Gaussian line fitting with resolution-aware, bin-averaged profiles; broad-Balmer BIC selection; UV doublet tying; Lyα and DLA handling; bootstrap uncertainties.

jwspecfit — least-squares fitting
jwspecmcmc

Bayesian MCMC replacement for the bootstrap fitter. NUTS (via NumPyro) by default, with emcee and nautilus backends. Full posteriors, asymmetric errors, flux-ratio posteriors, R̂ and ESS diagnostics.

jwspecmcmc — Bayesian MCMC fitting
jwspecabund

Chemical abundances: direct T_e (PyNEB), Bayesian forward model (Cullen+25), strong-line calibrations (Sanders+25); multi-Balmer dust correction anchored on Hα or Hβ; Martinez+25 N/O ICFs; Lyα escape fraction.

jwspecabund — chemical abundances

Tip

Recommended method. For science-quality measurements the authors recommend the Bayesian MCMC fitter, jwspecmcmc, over the least-squares jwspecfit bootstrap. MCMC returns full posteriors, asymmetric uncertainties, and parameter covariances, and propagates them correctly into derived quantities (flux ratios, abundances). Use the least-squares engine for quick looks, initial guesses, and BIC model selection; use jwspecmcmc for published results.


Getting started

jwspecfit

jwspecmcmc

jwspecabund

Visualisation

Methodology

Project