Unbinned analysis framework for Gammapy

Applicant

Prof. Dr. Stefan Funk
Erlangen Centre for Astroparticle Physics (ECAP)
Friedrich-Alexander-Universität Erlangen-Nürnberg

Project Summary

For more than 30 years Imaging-Air-Cherenkov telescopes (IACTs) have  been used to study the high-energy universe. They detect γ-rays between 20 GeV  and 100 TeV which are produced in (or nearby) the most violent phenomena in the  universe, such as Supernova remnants, jets around spinning neutron stars or black  holes. By observing the flux of high-energy particles, we aim to answer currently  open physics questions such as which acceleration mechanisms are responsible for  the acceleration of elementary particles to extreme energies or what is the nature of  dark matter. The currently in-construction Cherenkov-Telescope-Array (CTA) will be  the next-generation IACT array with Gammapy as the official science-analysis tool.  Gammapy is open-source and builds on numpy, astropy, scipy, and other Python packages and is part of the NumFOCUS eco system. Its  innovative and flexible analysis framework is already very popular in IACT collaborations as it allows for 3D likelihood fitting, customized models, and the combination  of data from different instruments. Initially developed for small field-of-view (FoV)  instruments Gammapy now also support wide FoV instruments like Fermi-LAT or  HAWC. And even the data of non-pointing neutrino detectors like KM3NeT can be  processed with Gammapy which makes it a very promising tool in the raising era of  multi-messenger astronomy. Because of the large data stores needed for the analyses, Gammapy is run frequently on HPC systems and will continue so as it gains  more in popularity.

In this project we were able to improve the likelihood calculation for the unbinned  analysis where no binning of the data is needed. Instead the likelihood, which is  a measure of the agreement between data and model and essential for the fitting  process, is computed per event which is especially challenging in the case of many  events. The improvements are dominantly seen in the common case of point-like  source with known position. For those sources the CPU time per likelihood calculation  was lowered by a factor of ∼100 which almost directly translates to the time needed  to fit a model to the data. For event numbers of up to 500k the unbinned analysis  is faster or compatible with respect to the binned analysis. Once fully integrated in  the Gammapy framework this will enable users to employ unbinned analysis also for  slightly larger datasets and use the native advantages for example when it comes to  timing analyses.