Source-linked AI summary
Fermipy: An open-source Python package for analysis of Fermi-LAT Data
Matthew Wood, Regina Caputo, Eric Charles, Mattia Di Mauro, Jeffrey Magill, Jeremy Perkins
TL;DR
Fermipy addresses the need for accessible, reproducible analysis of Fermi-LAT data. It provides high-level Python workflows built on the ScienceTools for spectral, spatial, localization, TS-map, and source-finding tasks. The package’s future development focuses on broader data-format and software integration, systematic-uncertainty support, and faster or more scalable analysis.
Problem
Fermi-LAT data analysis relies on the ScienceTools, whose core is primarily C++ despite a Python scripting interface.
Method
Fermipy provides a high-level Python framework built on ScienceTools and pyLikelihood, with methods for SEDs, TS maps, localization, extension, and iterative source finding.
Results
Fermipy provides an end-to-end high-level tool for studying known gamma-ray sources and searching for new source populations.
Takeaways & Limitations
Future releases target HEALPix support, instrument-response systematic uncertainties, integration with other gamma-ray software, multithreading, and standardized FITS formats.
Takeaways & Limitations
Both pip and conda installations require an existing precompiled ScienceTools installation from the Fermi Science Support Center.
Abstract
from arXiv · showhide
Fermipy is an open-source python framework that facilitates analysis of data collected by the Fermi Large Area Telescope (LAT). Fermipy is built on the Fermi Science Tools, the publicly available software suite provided by NASA for the LAT mission. Fermipy provides a high-level interface for analyzing LAT data in a simple and reproducible way. The current feature set includes methods for extracting spectral energy distributions and lightcurves, generating test statistic maps, finding new source candidates, and fitting source position and extension. Fermipy leverages functionality from other scientific python packages including NumPy, SciPy, Matplotlib, and Astropy and is organized as a community-developed package following an open-source development model. We review the current functionality of Fermipy and plans for future development.
1. Introduction
Fermipy provides a high-level Python interface for analyzing publicly available Fermi-LAT data through the Fermi ScienceTools and related scientific libraries. It is community-developed under an open-source model, with this proceeding reviewing its functionality and future development.
- 1. Introduction: The Fermi LAT is a pair-conversion telescope sensitive to gamma rays from below 20 MeV to above 300 GeV.The LAT has operated primarily in all-sky survey mode since June 2008, with photon-like data publicly released through the LAT archive.
- 1. Introduction: Fermipy provides a high-level Python interface for analyzing Fermi-LAT data through the ScienceTools and pyLikelihood.It uses NumPy, SciPy, and Astropy, while Matplotlib supports visualizations as an optional dependency.
- 1. Introduction: Fermipy follows an open-source development model available to the LAT scientific community.Its source code is hosted on GitHub under a 3-clause BSD-style license, with contributions accepted through pull requests.
- 1. Introduction: The proceeding reviews Fermipy’s main features, while more complete descriptions and tutorials are provided in online documentation.
2. Installation
Fermipy can be installed with pip or conda, but both methods require a pre-existing Fermi ScienceTools installation. Docker images package Fermipy, ScienceTools, and Anaconda Python together.
- 2. Installation: Fermipy releases are distributed through both pip and conda, with installation instructions in the online documentation.
- 2. Installation: Both installation methods require precompiled ScienceTools binaries supplied by the Fermi Science Support Center.Pre-built Docker images are also available with Fermipy, ScienceTools, and Anaconda Python.
3. Analysis Workflow
A Fermipy analysis combines a YAML configuration with a Python script operating on a global GTAnalysis state object. The workflow prepares data and models, optimizes and characterizes sources, and writes reusable results.
- 3. Analysis Workflow: GTAnalysis manages data and model preparation while exposing high-level methods through a user-composed Python script.
- 3. Analysis Workflow: A YAML configuration defines data selection, ROI geometry, and model specification using nested parameter groups.The configuration initializes the analysis object.
- 3. Analysis Workflow: The setup method runs data selection, filtering, binning, livetime and exposure calculations, and spatial-template generation through the corresponding gt-tools.
- 3. Analysis Workflow: A typical sequence optimizes background-model parameters, generates TS or residual maps, and extracts source flux, TS, spectral fits, or SEDs.In the example, localize and sed characterize Mkn 421.
- 3. Analysis Workflow: write_roi saves the analysis results to an output file, while result dictionaries and FITS or NumPy serialization support postprocessing and restoration.
4. Analysis Methods
Fermipy automates spectral, spatial, localization, test-statistic, and source-finding analyses with diagnostic outputs. Its methods expose likelihood-based measurements and iterative workflows for characterizing sources and identifying candidates.
- 4.1 sed: sed fits source normalization independently in each energy bin after replacing the source spectrum with a power law.It returns flux, errors or upper limits, TS, and predicted counts, and can generate diagnostic comparisons with the global parameterization.
- 4.2 extension: extension profiles likelihood against spatial size to evaluate TSext, best-fit extension, errors, and upper limits relative to a point-source model.Diagnostic plots show residual TS maps and angular-size likelihood profiles.
- 4.3 localize: localize maximizes likelihood over source position using coarse and fine spatial scans, then fits a 2D paraboloid to estimate position and uncertainties.
- 4.4 tsmap: tsmap places a test source at each spatial pixel and fits its amplitude and TS while fixing background and restricting nearby pixels.These simplifications allow a typical 30×100×100-pixel data cube to be calculated on one CPU core in a few minutes.
- 4.5 find_sources: find_sources iteratively identifies candidate sources from high-TS peaks, adds qualifying candidates to the model, and repeats until no candidates remain or max_iter is reached.In a blended pair, adding the first source reveals a fainter candidate in the second iteration.
5. Conclusions
Fermipy is an end-to-end, community-supported tool for high-level LAT analysis, with active development expanding data handling, uncertainty propagation, interoperability, parallelism, and output standardization.
- Fermipy provides end-to-end high-level analysis for studying known gamma-ray sources and searching for new source populations.
- Future releases will support analysis of data pixelized with HEALPix.
- Future releases will propagate systematic uncertainties associated with instrument response functions, including effective area and PSF.
- Future releases will improve integration with open-source gamma-ray analysis software such as Gammapy, 3ML, and Gammalib/ctools.
- Future releases will improve support for multi-threaded analysis and standardize FITS outputs through the gamma-astro-data-formats effort.
- Fermipy aims to remain a community-supported effort by welcoming contributions from LAT scientific community members.