2.0 (August 26, 2025)#
Released August 26, 2025
26 contributors (10 new contributors)
312 pull requests since v1.3, 497 pull requests since 1.0
118 closed issues
Summary#
Gammapy v2.0 is a new Long Term Stable (LTS) release. It will be maintained for the next development cycle (approximately two years), while support for Gammapy 1.x versions is now dropped. With Gammapy 2.0, we provide analysis support for most major Imaging Atmospheric Cherenkov Telescopes including H.E.S.S., VERITAS, MAGIC, LST1, Water Cherenkov Telescopes like HAWC and SWGO, as well as Fermi-LAT.
Since Gammapy 1.3, improved support is provided for Fermi-LAT analysis, and analysis of VERITAS telescope data has been validated.
Bayesian inference with nested sampling is now supported.
A Sampler
class that wraps around sampler libraries is introduced. It provides
an interface similar to the Fit class. For now, the Sampler
relies on the ultranest
library.
A detailed tutorial is provided.
Flux sensitivity can now be computed by the various flux estimator classes such as FluxPointsEstimator
,
with the "sensitivity"
option. The calculation is based on the Asimov dataset following the method described in ParameterSensitivityEstimator
.
There has been significant code cleanup and restructuring. They should not break user codes but might marginally change analysis results. We mention here a number of changes and undergoing re-structuring efforts:
The computation of flux errors is no longer performed with regular error propagation. Because the latter is a linear approximation, it frequently leads to unexpected flux ranges when extrapolating over a wide range of energies. Butterfly plots computed this way can become incorrect far from the decorrelation energy. To overcome this, error bands are now computed using multi-normal sampling of spectral parameters taking into account all correlations. The
plot_error
method now builds an envelope of the sampled spectra using vectorized evaluation of the model.The separation of the internal DL3 data model from GADF specification is close to being over. In particular, the
EventList
internal table does no longer follow the GADF structure now.The restructuring of statistics and
Dataset
has started with the addition ofFitStatistic
classes and a registry to allow configuration of the statistic on a dataset.
Significant effort has been put in cleaning up the documentation and re-organising the tutorial structure.
API changes#
Two API-breaking changes have been introduced in this version:
gammapy.data.EventList.select_parameter
now takes avalues
andis_range
argument instead ofband
to allow exact matchescta_south
andcta_north
have been renamed asctao_south
andctao_north
, respectively, inobservatory_locations
Features deprecated since Gammapy v1.3 have been removed.
Documentation improvements#
Documentation appearance has been updated using less custom css code, and now support a dark theme.
The ordering of tutorials has been restructured for clarity.
Four new tutorials have been added:
one exposing VERITAS analysis along with addition of VERITAS data in
$GAMMAPY_DATA
(VERITAS with Gammapy)one exposing computation of upper limits for non-detected sources (Computing flux upper limits)
one explaining computation of upper limits on parameters (Constraining parameter limits)
one introducing Bayesian inference with nested sampling (Bayesian analysis with nested sampling)
The tutorial showing how to handle Fermi-LAT data (Fermi-LAT with Gammapy) has been rewritten to expose a full Fermi-LAT analysis.
Code examples have been added in docstrings.
New features#
gammapy.catalog
Add pulse profiles for Fermi
SourceCatalog3PC
gammapy.data
Helper method for observation selection at
Datastore
level, specially useful for WCD
gammapy.datasets
Add a helper function to create a global dataset from a list of datasets
gammapy.estimators
Add optional sensitivity computation on
TSMapEstimator
andFluxPointsEstimator
gammapy.makers
Added spatial model to
gammapy.makers.FoVBackgroundMaker
initAdd time integration of 3D background model aligned on Alt-Az during an observation in
MapDatasetMaker
Add a
FermipyDatasetsReader
to convert Fermi-LAT maps from Fermipy into a gammapyDatasets
.
gammapy.modeling
Support for pixel-wise weighted likelihood as implemented in Fermi-LAT science tools
Add
Sampler
class to support nested sampling for bayesian analysisAddition of a
LogUniformPrior
Implement a more robust error propagation method using parameter sampling
Add
datasets_names
argument tocreate_fermi_isotropic_diffuse_model
Add interp_scale to parameter scaling
Make a distinction between
free_parameters
andfree_unique_parameters
gammapy.stats
Introduce optional numba optimized fit statistic functions. By default, Gammapy v2.0 still relies on Cython optimized code.
gammapy.utils
Introduce a FoVFrame in
gammapy.utils.coordinates
Allow energy selection in
make_theta_squared_table
Bug fixes and improvements#
Improvement of the
gammapy.datasets.MapDataset.peek
function to show relevant infoFix memory leak related to lru_cache and caching coordinates in WcsGeom
Fix
TSMapEstimator
pad_widthFix mask handling in
TSMapEstimator
Preserve parameters links in
gammapy.modeling.models.Models.copy()
Fix link label display in parameters.to_table
Fix
e_peak
implementation ofSuperExpCutoffPowerLaw4FGLDR3SpectralModel
to give results compatible with Eq 21 of https://iopscience.iop.org/article/10.3847/1538-4357/acee67Fix of a
HpxGeom
simulation error
Infrastructure#
Remove dependency on
sphinx-astropy
Support of astropy v7.1
Utilise OpenAstronomy in our release workflow to build wheels
Added extra workflows for
Scheduling run for doctests in rst and examples
Scheduling link check (separated from CI)
Contributors#
Fabio Acero
Arnau Aguasca-Cabot
Tora T H Arnesen
Luis Barrios-Jiménez
Anushka Bhatt
Tomas Bylund
Katharina Egg
Kirsty Feijen
Lucas Gréaux
Bruno Khélifi
Maximilian Linhoff
Edgar Molina
Daniel Morcuende
Mireia Nievas-Rosillo
Robert Daniel Parsons
Natthan Pigoux
Fabio Pintore
Tobi Preis
Maxime Regeard
Quentin Remy
Leander Schlegel
Atreyee Sinha
Hanna Stapel
Mitsunari Takahashi
Régis Terrier
Samantha Wong