Issue |
A&A
Volume 690, October 2024
|
|
---|---|---|
Article Number | A317 | |
Number of page(s) | 9 | |
Section | Numerical methods and codes | |
DOI | https://doi.org/10.1051/0004-6361/202451736 | |
Published online | 18 October 2024 |
jaxspec: A fast and robust Python library for X-ray spectral fitting
1
IRAP, Université de Toulouse, CNRS, CNES,
UT3-PS,
Toulouse, France
Corresponding author; sdupourque@irap.omp.eu
2
European Space Agency (ESA), European Space Astronomy Centre (ESAC),
Camino Bajo del Castillo s/n,
28692
Villanueva de la Cañada, Madrid, Spain
Received:
31
July
2024
Accepted:
9
September
2024
Context. Inferring spectral parameters from X-ray data is one of the cornerstones of high-energy astrophysics, and is achieved using software stacks that have been developed over the last 20 years and more. However, as models get more complex and spectra are obtained with higher resolutions, these established software solutions become more feature-heavy, difficult to maintain and less efficient.
Aims. We present jaxspec, a Python package for performing this task quickly and robustly in a fully Bayesian framework. Based on the JAX ecosystem, jaxspec allows the generation of differentiable likelihood functions compilable on core or graphical process units (GPUs), enabling the use of robust algorithms for Bayesian inference.
Methods. We demonstrate the effectiveness of jaxspec samplers, in particular the no U-turn sampler, using a composite model and comparing what we obtain with the existing frameworks. We also demonstrate its ability to process high-resolution spectroscopy data using original methods by reproducing the results of the Hitomi collaboration on the Perseus cluster, while solving the inference problem using variational inference on a GPU.
Results. We obtain identical results when compared to other software and approaches, meaning that jaxspec provides reliable results while being ~10 times faster than existing alternatives. In addition, we show that variational inference can produce convincing results even on high-resolution data in less than 10 minutes on a GPU.
Conclusions. With this package, we aim to pursue the goal of opening up X-ray spectroscopy to the existing ecosystem of machine learning and Bayesian inference, enabling researchers to apply new methods to solve increasingly complex problems in the best possible way. Our long-term ambition is the scientific exploitation of the data from the newAthena X-ray Integral Field Unit (X-IFU).
Key words: methods: data analysis / methods: statistical / X-rays: general
© The Authors 2024
Open Access article, published by EDP Sciences, under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
This article is published in open access under the Subscribe to Open model. Subscribe to A&A to support open access publication.
Current usage metrics show cumulative count of Article Views (full-text article views including HTML views, PDF and ePub downloads, according to the available data) and Abstracts Views on Vision4Press platform.
Data correspond to usage on the plateform after 2015. The current usage metrics is available 48-96 hours after online publication and is updated daily on week days.
Initial download of the metrics may take a while.