Gammapy: A Python package for gamma-ray astronomy

Publication date: 
Main author: 
Donath, Axel
IAA authors: 
Ruiz, Jose Enrique;López-Coto, Rubén
Donath, Axel;Terrier, Régis;Remy, Quentin;Sinha, Atreyee;Nigro, Cosimo;Pintore, Fabio;Khélifi, Bruno;Olivera-Nieto, Laura;Ruiz, Jose Enrique;Brügge, Kai;Linhoff, Maximilian;Contreras, Jose Luis;Acero, Fabio;Aguasca-Cabot, Arnau;Berge, David;Bhattacharjee, Pooja;Buchner, Johannes;Boisson, Catherine;Carreto Fidalgo, David;Chen, Andrew;de Bony de Lavergne, Mathieu;de Miranda Cardoso, José Vinicius;Deil, Christoph;Füßling, Matthias;Funk, Stefan;Giunti, Luca;Hinton, Jim;Jouvin, Léa;King, Johannes;Lefaucheur, Julien;Lemoine-Goumard, Marianne;Lenain, Jean-Philippe;López-Coto, Rubén;Mohrmann, Lars;Morcuende, Daniel;Panny, Sebastian;Regeard, Maxime;Saha, Lab;Siejkowski, Hubert;Siemiginowska, Aneta;Sipőcz, Brigitta M.;Unbehaun, Tim;van Eldik, Christopher;Vuillaume, Thomas;Zanin, Roberta
Astronomy and Astrophysics
Publication type: 
Context. Traditionally, TeV-γ-ray astronomy has been conducted by experiments employing proprietary data and analysis software. However, the next generation of γ-ray instruments, such as the Cherenkov Telescope Array Observatory (CTAO), will be operated as open observatories. Alongside the data, they will also make the associated software tools available to a wider community. This necessity prompted the development of open, high-level, astronomical software customized for high-energy astrophysics. <BR /> Aims: In this article, we present Gammapy, an open-source Python package for the analysis of astronomical γ-ray data, and illustrate the functionalities of its first long-term-support release, version 1.0. Built on the modern Python scientific ecosystem, Gammapy provides a uniform platform for reducing and modeling data from different γ-ray instruments for many analysis scenarios. Gammapy complies with several well-established data conventions in high-energy astrophysics, providing serialized data products that are interoperable with other software packages. <BR /> Methods: Starting from event lists and instrument response functions, Gammapy provides functionalities to reduce these data by binning them in energy and sky coordinates. Several techniques for background estimation are implemented in the package to handle the residual hadronic background affecting γ-ray instruments. After the data are binned, the flux and morphology of one or more γ-ray sources can be estimated using Poisson maximum likelihood fitting and assuming a variety of spectral, temporal, and spatial models. Estimation of flux points, likelihood profiles, and light curves is also supported. <BR /> Results: After describing the structure of the package, we show, using publicly available gamma-ray data, the capabilities of Gammapy in multiple traditional and novel γ-ray analysis scenarios, such as spectral and spectro-morphological modeling and estimations of a spectral energy distribution and a light curve. Its flexibility and its power are displayed in a final multi-instrument example, where datasets from different instruments, at different stages of data reduction, are simultaneously fitted with an astrophysical flux model.
ADS Bibcode: 
methods: statistical;astroparticle physics;methods: data analysis;gamma rays: general;Astrophysics - Instrumentation and Methods for Astrophysics;Astrophysics - High Energy Astrophysical Phenomena