2.2 (xx November, 2026)#
Released: xx November, 2026
New contributors: 7 (Marked with * in the list)
Total contributors: 30
Total merged PRs: 192
Summary#
Gammapy v2.2 is a new feature release with a number of performance improvements, new features and bug fixes. The main themes include new tools for Bayesian inference, a broad overhaul of the dark matter module, and ASDF serialization of the core data structures.
Python 3.14 and 3.15 are now supported, and issues encountered with regions in the
previous versions are now resolved. Three new notebooks have been added and the CTAO
notebook significantly updated.
Dark matter module#
The dark matter module has been substantially refactored and extended in this release.
The spectral model classes have been unified into a single class handling both annihilation
and decay, with improved parameter validation and an overall cleaner code structure.
CosmiXs is now the default source for dark matter spectra, replacing PPPC4DMID;
note that this changes the results of analyses that relied on the previous default.
Users can also provide their own custom spectra from a file.
The computation of astrophysical factors has been improved, with corrections for extragalactic sources, the line-of-sight geometry and the treatment of the central pixel. Notably, uncertainties on the astrophysical factor can now be included as a nuisance parameter profiled in the likelihood fit, so that limits on the annihilation cross-section or decay lifetime account for the uncertainty on the target’s dark matter distribution, yielding more realistic and typically more conservative constraints. The documentation and tutorials have been updated accordingly, with new and improved tutorials covering both a basic introduction and a complete analysis.
ASDF serialization#
Maps, geometries (WCS, HEALPix, region), map axes, GTIs, IRF maps, Datasets and Models can now be written to and read from ASDF. This is the groundwork for storing a complete analysis state in a single, self-describing file, and is a part of an overhaul of the I/O code in Gammapy. An associated entry in the HowTo is added as an explanation for ASDF serialisation.
Estimators and flux upper limits#
Significant additions have been made to our estimator package. Previously, hidden failures sometimes used to occur at low statistics, causing very low upper limits. This has now been corrected. If a failure is detected during the fit for upper limit computation, the method internally switches to upper limit computation using likelihood profiles. The upper limit tutorial has been updated with more information.
A preliminary implementation of a new RegularizedFluxPointsEstimator
is introduced for flux point computation in true-energy space
with a given regularisation, and will be documented in future releases.
Other#
The 4FGL catalog is updated, with support for the FL16Y list. A new
OnOffBackgroundMaker with an associated tutorial is provided
for background estimation with paired off runs. The
nautilus
is now available as a Sampler backend, which is better suited for
higher dimensionality problems, and LogNormalPrior and
SamplesKDEPrior are introduced. A new tutorial is added
explaining the details of Bayesian model selection.
API changes#
The constructor of
ObservationTablenow takes an argumenttableinstead ofdata. [#6620]Deprecated
make_map_exposure_true_energy, use themake_exposuremethod onMapDatasetMakerinstead. [#6882]Deprecate
gammapy.makers.utils.make_psf_map. [#6893]The options of
Samplerare now given in a singleoptionsdictionary, using the backend’s own option names. [#6898]Deprecate
gammapy.makers.utils.make_edisp_mapandgammapy.makers.utils.make_edisp_kernel_map. [#6906]Deprecate
gammapy.makers.utils.make_map_background_irf. [#6946]
Infrastructure#
Documentation improvements#
Add PIG for introducing new plotter classes [#5726]
Improves the documentation in the user guide on fit statistics. [#6623]
Fix issue in Fermi-LAT tutorial where dimmest sources are used for fitting rather than brightest. [#6750]
Add a new tutoial showing detailed Dark Matter analysis [#6774]
Update of the Dark Matter module main documentation. [#6777]
Add tutorial for on-off analysis using paired off runs. [#6835]
Add How-To entry to document ASDF [#6981]
Update the Upper Limit tutorial. [#6997]
Add a tutorial about Bayesian model selection using arviz package. [#7018]
New features#
Add
CirclePixelRegionArrayandCircleSkyRegionArrayclasses to support array valued regions. [#5420]Add
RegularizedFluxPointsEstimatorto perform estimate of flux points in true energy space using a regularized likelihood approach. [#5625]Add
plot_pulse_profile_3PCfunction to plot pulse profiles from the Fermi-LAT 3PC catalog. [#5761]Add utility function to creates a 2D grid of
RectangleSkyRegiontiles on a given WCS. [#6006]Add
SamplesKDEPriorclass to create a prior from samples usingscipy.stats.gaussian_kde. [#6503]Update Fermi-LAT 4FGL catalog and add support for FL16Y list in
SourceCatalog4FGL. [#6617]Add support for creating a
DataStorefrom the results of a ivoa TapQuery. [#6653]Implementation of the option of using custom files as dark matter spectra sources. [#6660]
Add ASDF serialization support for
TimeMapAxisandLabelMapAxis. [#6722]Add
downsamplefunctionality for theenergy_trueaxis, fixdownsamplebehaviour, and restrict the axes for downsampling. [#6740]Added
add_factor_priorhelper function to support log-normal nuisance parameter treatment for astrophysical J-factors and D-factors. [#6741]Fixed JFactory to correctly compute J/D-factors for extragalactic sources by decoupling rmax from distance and propagating the source distance through the line-of-sight integration geometry. [#6743]
Implementation of parameter validation and code restructuring for Dark Matter spectral models. [#6744]
Add ASDF serialization support for
RegionGeom. [#6771]Add a dark matter analysis tutorial covering the basics of J/D-factor computation, spectral models, and expected gamma-ray flux. [#6782]
Add ASDF serialization support for
RegionNDMap. [#6794]Addition of
LogNormalPriorclass. [#6799]Ensure
TimeMapAxisstart and stop values are exported to table in isot format. [#6805]Deprecate
stat_sumand makestat_sum_likelihoodandstat_sum_likelihoodpublic. [#6812]Add
OnOffBackgroundMakerfor on-off analysis. [#6824]Creation of class
DarkMatterSpectralModelas the unification ofDarkMatterAnnihilationSpectralModelandDarkMatterDecaySpectralModel. The new class has a parameterannihilationto set the type of dark matter process. [#6825]Add ASDF serialization support for
PSFMap,RecoPSFMap,EDispMap,EDispKernelMap. [#6833]Add Fourth Fermi-LAT Catalog of High-Energy Sources (4FHL). Older 2FHL catalog has been deprecated as of next release (v2.2). [#6838]
Add
BasePlotterclass, first building plot for the new Plotters API defined in PIG 31. [#6845]Add ASDF serialization support for
MapDatasetandMapDatasetOnOff. [#6849]Adapt the default spectra source in
DarkMatterSpectralModelandContinuumPrimaryFluxfrom PPPC4DMID to CosmiXs. [#6885]Add Eemin, Eemax (for leptonic models) or Epmin, Epmax (for hadronic models) as fit parameters in the
NaimaSpectralModel. [#6889]Remove the limit of 5 non-spatial axes when reading a
RegionNDMapwith gadf format. [#6949]
Bug Fixes#
Correct
plot_residuals()x-axis unit, removeax_spectrumandax_residualsparameter inplot_fit()and adjust documentation. [#6615]stack(other)now skips stacking if othermask_safeis invalid. This prevents stacking gti of invalid dataset. [#6621]Fixes
integrate_spectrumto allow integration of spectral models without a closed analytical form (e.g.BrokenPowerLawSpectralModel) with energy bounds given as arrays of length 1. [#6622]Fixes bug to return
axobject forTemplateSpatialModel.plot(). [#6636]Fixes a bug in the
EnergyDependentMorphologyEstimatorto allow for multiple datasets to be handled correctly. [#6640]Corrects
make_effective_livetime_mapto use observation pointing to compute livetime map. [#6643]Fixes
plot_offset_dependence()to remove area being divided twice. [#6666]Fix default behavior of
sum_over_energy_groups=Falsecase ingammapy.estimators.ExcessMapEstimator. [#6685]Remove dependency to regions deprecated function pixel_scale_angle_at_skycoord in
SkyPolygonRegion. [#6705]Add configuration of interpolation options for
LightCurveTemplateTemporalModel, now default is to return zero when evaluating outside the times in the template. [#6712]Fixes incorrect calling of dataset for frozen models in
FluxCollectionEstimator. [#6721]Add unit support to the violins plot from
plot_samples_violin_vs_energyused with theFluxCollectionEstimator[#6756]Fixes
compute_differential_jfactorto use the physical impact parameter in the line-of-sight integration and avoid evaluating the integrable closest-approach singularity directly. [#6757]Fix Asimov dataset computation for
MapDatasetOnOff: use alpha * N_OFF as expected background. [#6762]Fix the
FluxCollectionEstimatorto support computation over datasets with different spatial geometries, and single flux point. [#6785]Fix
RegionGeomASDF roundtrip for DS9-formatted regions to clearmetaandvisualon write. [#6801]Fix parsing of the
scaleparameter when read from a dictionary inTemplatePhaseCurveTemporalModel. [#6807]Fixes the line-of-sight integration geometry in
JFactoryto account for observers inside or outside the radial integration region. [#6819]Fixes
JFactorywhen a map pixel center coincides exactly with the dark-matter halo center. [#6828]format_plot_xaxisno longer produces overlapping scientific-notation minor tick labels on a log x-axis spanning less than one decade. [#6847]Makes sure FoV offsets in
_get_fov_coordare calculated in the correct coordinate frame. [#6861]Fix
nanin sensitivity computation using Asimov dataset. [#6862]Add
gammapy.stats.utils.ts_to_sigma_sensitivityandgammapy.stats.utils.sigma_to_ts_sensitivityas separate functions and fix computation with more than one degree of freedom [#6864]Fixes an out-of-memory error when computing the covariance of models with a large number of parameters (e.g. a full source catalogue) by building diagonal covariances lazily in
Covariance. [#6867]Fixes
e_peakvalue for the case where the energy scale E_s is different from the reference energy E_0. [#6884]Fixes
containmentwhen rad is larger than the last bin of the PSF rad axis. [#6887]Recompute upper limits using likelihood profiles if the default method using fit confidence fails in
ParameterEstimator. [#6900]Fixes error in getting the
pivot_energyfor aCompoundSpectralModelor model which does not contain areference. [#6916]Fix error in
gammapy.data.ivoa.make_hdu_table. [#6920]Fix
to_dict()ofTemplateSpectralModel,PiecewiseNormSpectralModel,EBLAbsorptionNormSpectralModelandPiecewiseNormSpatialModelfailing on big-endian arrays. [#6952]Fix the normalisation of
compute_fppto match Edelson et al. (2002), also when the light curve has NaN values. [#7014]
Contributors#
Fabio Acero
Nicki R. Bond *
Tomas Bylund
Marie-Sophie Carrasco
Alexander Cerviño-Cortínez
Axel Donath
Katharina Egg
Gabriel Emery
Kirsty Feijen
Júlia Gouvêa Mamprim *
Karthik Koundinya Gowrawaram *
Lea Heckmann
Basmala Hekal
Bruno Khélifi
Ahmed Mahmoud *
Esther Michelle *
Daniel Morcuende
Laura Olivera-Nieto
Michele Peresano
Natthan Pigoux
Fabio Pintore
Tobias Preis
Syed Ahnaf Raza *
Maxime Regeard
Quentin Remy
Atreyee Sinha
Régis Terrier
Tim Unbehaun
Thomas Vuillaume
Ziheng Wang *