pysersic: A Python package for determining galaxy structural properties via Bayesian inference, accelerated with jax
Abstract
A standard practice in extragalactic population studies is the fitting of parametric models to galaxy images. From such fits, key structural parameters of galaxies such as total flux and effective radius (size) can be extracted. One of the most popular parametric forms is that of the Sérsic profile, which is flexible enough to reasonably fit the light distribution of nearly all galaxies. Here we present pysersic, a Bayesian framework created to facilitate the inference of structural parameters from galaxy images. Pysersic is written in pure Python, and is built using the jax framework, allowing for just-in-time compilation, auto-differentiation and seamless execution on CPUs, GPUs or TPUs. Inference is performed with the numpyro package using gradient based methods, e.g., No U-Turn Sampling, for efficient and robust posterior estimation in only a few minutes on a modern laptop. Pysersic is designed to have a user-friendly interface, allowing users to fit single or multiple sources in a few lines of code, while also being flexible enough for integration into current and future analysis pipelines. In addition to sampling, pysersic can produce point estimates of the best model via optimization in several seconds, and approximate the posterior via stochastic variational inference. The use of the numpyro probabilistic language provides future extensibility to arbitrary models beyond the Sérsic.
- Publication:
-
The Journal of Open Source Software
- Pub Date:
- September 2023
- DOI:
- arXiv:
- arXiv:2306.05454
- Bibcode:
- 2023JOSS....8.5703P
- Keywords:
-
- Python;
- astronomy;
- galaxies;
- model fitting;
- Astrophysics - Astrophysics of Galaxies;
- Astrophysics - Instrumentation and Methods for Astrophysics
- E-Print:
- Submitted to the Journal of Open Source Software (JOSS)