[Paper Review] naima: a Python package for inference of relativistic particle energy distributions from observed nonthermal spectra
naima is an open-source Python package that enables inference of relativistic particle energy distributions from nonthermal astrophysical spectra using synchrotron, inverse Compton, bremsstrahlung, and pion decay models. It employs MCMC sampling to fit observed X-ray to VHE gamma-ray spectra, yielding posterior distributions for particle distribution parameters, as demonstrated in a hadronic model fit to RX J1713–3946 with a cutoff energy of $110^{+30}_{-20}$ TeV.
The ultimate goal of the observation of nonthermal emission from astrophysical sources is to understand the underlying particle acceleration and evolution processes, and few tools are publicly available to infer the particle distribution properties from the observed photon spectra from X-ray to VHE gamma rays. Here I present naima, an open source Python package that provides models for nonthermal radiative emission from homogeneous distribution of relativistic electrons and protons. Contributions from synchrotron, inverse Compton, nonthermal bremsstrahlung, and neutral-pion decay can be computed for a series of functional shapes of the particle energy distributions, with the possibility of using user-defined particle distribution functions. In addition, naima provides a set of functions that allow to use these models to fit observed nonthermal spectra through an MCMC procedure, obtaining probability distribution functions for the particle distribution parameters. Here I present the models and methods available in naima and an example of their application to the understanding of a galactic nonthermal source. naima's documentation, including how to install the package, is available at http://naima.readthedocs.org.
Motivation & Objective
- To provide a publicly available, reproducible tool for inferring particle energy distributions from nonthermal astrophysical spectra.
- To address the lack of open-source, auditable software for fitting nonthermal emission models to multi-wavelength data.
- To support model-independent inference of particle distributions in sources like pulsar wind nebulae and supernova remnants.
- To integrate seamlessly with astrophysical analysis workflows via astropy and sherpa.
- To enable uncertainty quantification through Bayesian inference using MCMC sampling.
Proposed method
- The package implements modular radiative models for synchrotron, inverse Compton, nonthermal bremsstrahlung, and neutral pion decay emission.
- It supports user-defined particle distribution functions and uses analytical approximations for inverse Compton scattering on diluted blackbody fields (CMB, FIR, NIR).
- Radiative models are wrapped for use with the sherpa spectral fitting package via naima.sherpa_models.
- MCMC sampling is used to infer posterior distributions of particle distribution parameters, including median values and 16th–84th percentile uncertainties.
- Units are handled via astropy.units, ensuring dimensional consistency and user flexibility in input units.
- Diagnostic and plotting functions are provided to assess MCMC convergence and visualize posterior distributions and model fits.
Experimental results
Research questions
- RQ1What particle energy distribution best explains the observed nonthermal spectrum of RX J1713–3946 across X-ray to VHE gamma-ray bands?
- RQ2How accurately can naima infer the cutoff energy and power-law index of a hadronic particle distribution using MCMC sampling?
- RQ3To what extent can the package reproduce published spectral fits with quantified uncertainties?
- RQ4How does the covariance between particle index and cutoff parameters affect model interpretation?
- RQ5What is the total energy content in protons above 1 TeV, as constrained by the MCMC posterior?
Key findings
- The particle index for RX J1713–3946 is constrained to $s = 1.90 \pm 0.08$ from the MCMC fit.
- The cutoff energy of the proton distribution is estimated at $E_{\mathrm{cutoff}} = 110^{+30}_{-20}$ TeV.
- The total proton energy content above 1 TeV is $W_{p}(E_{p}>1\,\mathrm{TeV}) = (5.74^{+0.17}_{-0.2}) \times 10^{49} n_{\mathrm{H}}^{-1} d^{-2}_{1\,\mathrm{kpc}}$ erg.
- Posterior distributions show strong positive covariance between the particle index and cutoff parameters.
- The MCMC chains successfully converge, as confirmed by diagnostic plots showing stable sampling and clear posterior modes.
- The model reproduces the observed H.E.S.S. spectrum of RX J1713–3946 within uncertainties, with 100 posterior-sampled spectra showing good agreement.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.