[Paper Review] Gammapy - A prototype for the CTA science tools
Gammapy is an open-source Python package built on Numpy, Scipy, and Astropy for high-level gamma-ray data analysis, serving as a prototype for the Cherenkov Telescope Array (CTA) science tools. It enables sky image, spectrum, and lightcurve generation from event lists and instrument response functions, with validated applications on H.E.S.S., Fermi-LAT, and simulated CTA data, demonstrating its readiness for CTA's open, collaborative science framework.
Gammapy is a Python package for high-level gamma-ray data analysis built on Numpy, Scipy and Astropy. It enables us to analyze gamma-ray data and to create sky images, spectra and lightcurves, from event lists and instrument response information, and to determine the position, morphology and spectra of gamma-ray sources. So far Gammapy has mostly been used to analyze data from H.E.S.S. and Fermi-LAT, and is now being used for the simulation and analysis of observations from the Cherenkov Telescope Array (CTA). We have proposed Gammapy as a prototype for the CTA science tools. This contribution gives an overview of the Gammapy package and project and shows an analysis application example with simulated CTA data.
Motivation & Objective
- To develop a flexible, open-source software framework for high-energy gamma-ray data analysis that supports the upcoming Cherenkov Telescope Array (CTA) observatory.
- To establish a common, community-driven analysis pipeline based on scientific Python, leveraging existing astronomical software stacks like Astropy and Numpy.
- To enable interoperability and standardization of data formats and analysis methods across current and future gamma-ray experiments.
- To prototype a scalable, extensible, and maintainable science tools stack for CTA, supporting both 1D and 3D analysis methods.
- To foster collaboration across the gamma-ray astronomy community by building on widely adopted tools like Astropy and providing accessible, well-documented software.
Proposed method
- Leverages the scientific Python stack (Numpy, Scipy, Astropy) as a foundation for high-performance, readable, and maintainable code.
- Uses FITS format for event lists and instrument response functions (IRFs), with support for energy and spatial binning for sky image and spectrum production.
- Implements background estimation via ring models or data-driven templates, and computes exposure maps using event energy and direction information.
- Supports 2D and 3D (cube) analysis methods, with the latter enabling simultaneous spatial and spectral modeling of source emission.
- Integrates optional tools like Sherpa for modeling and fitting, Matplotlib for visualization, and regions/reproject/healpy for spatial and sky coordinate operations.
- Deploys a modular, object-oriented design with classes for EventList, SkyImage, Background2D, and SourceSpectralModel, enabling reusable and composable analysis workflows.
Experimental results
Research questions
- RQ1Can a Python-based, open-source package built on Astropy and Numpy serve as a viable and extensible prototype for the CTA science tools?
- RQ2How well does Gammapy support high-level gamma-ray analysis tasks such as source detection, morphology fitting, spectral extraction, and lightcurve production?
- RQ3To what extent can Gammapy integrate with existing data formats and pipelines from current IACTs (e.g., H.E.S.S., MAGIC) and Fermi-LAT?
- RQ4How effective is Gammapy’s 3D (cube) analysis approach in comparison to classical 1D spectral analysis for simulated CTA data?
- RQ5Can Gammapy’s architecture and development model support long-term evolution and community contributions over CTA’s 30-year operational lifetime?
Key findings
- Gammapy successfully enables high-level gamma-ray data analysis—including sky image, spectrum, and lightcurve production—using event lists and instrument response functions.
- The package has been validated on real data from H.E.S.S. and Fermi-LAT, and is now actively used for simulation and analysis of CTA data.
- Gammapy supports both 2D and 3D analysis methods, with the 3D cube analysis showing promise for improved source characterization in complex source regions.
- The use of Astropy and Numpy allows for efficient computation on large event lists and sky images, with performance accelerated via C extensions in Numpy and Astropy.
- Gammapy is distributed via PyPI, conda, and multiple Linux package managers, ensuring broad accessibility and ease of installation for the scientific community.
- The project has attracted contributions from ~30 gamma-ray astronomers, demonstrating strong community adoption and collaborative development potential.
Better researchstarts right now
From paper design to paper writing, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.