2.1 (2nd April, 2026)#
Released: 2nd April, 2026
contributors: 27
pull requests since v2.0: 133
closed issues: 20
Summary#
Gammapy v2.1 is the first feature release since LTS v2.0. This release includes a number of new features, bug fixes, infrastructural changes and documentation improvements.
Notable new features include support for CosmiXs dark matter spectral models, for multiple OFF regions in the theta square plots,
for simultaneous flux point extraction for a collection of sources with FluxCollectionEstimator.
Extracting flux points from datasets generated from different telescope data is now allowed, but should be used with care as responses and the associated systematics might be strongly different.
A bug affecting flux maps calculations in TSMapEstimator has been corrected. It is advised to upgrade to get correct flux maps.
Prototype support for multi-parametric priors and for Bayesian model selection as been introduced.
This is the first feature release where we are using town_crier for the changelog.
Please see below for a list of PRs. Minor fixes are not listed.
API changes#
Change the argument name from
modeltokernel_modelinTSMapEstimatorfor clarity. [#6510]
Infrastructure#
Documentation improvements#
Clarify usage of
from_regionsregarding underlying projection effects. [#6272]Remove unused
obstimeandlocationvariables fromFoVICRSFramedocstring example. [#6460]
New features#
Add an
invertedoption for time selection inselect_timeforEventList,GTIandObservation. [#5436]Switch default SpectrumDataset write/read format to gadf instead of ogip (for better preservation of masks) [#5812]
Add a FitStatisticPenalty class to support constraints on multiple parameters e.g. regularity constraints, multiparametric priors [#5838]
Add
BayesianModelSelectionclass to perform model performance comparison from a Bayesian perspective. [#6025]Add a log parabola model defined such as the energy scale of the exponent and the reference energy can be different. [#6147]
Add
axis_nameargument toplot_ts_profilesto allow the user to select the axis to plot. [#6197]Add support for Field of View frames that have a time axis, such as when one performs drift-scan type observations. [#6198]
Implementation of the option of using
CosmiXsorPPPC4as a source models for creating dark matter spectra. [#6232]Add sample_parameters_from_covariance method on models allowing to create parameters samples from covariance using multivariate normal distribution. [#6255]
Enable the addition of
Datasetsand individualDatasetobjects to create a newDatasetsinstance. [#6256]Add a new
FluxCollectionEstimatorthat enables the computation of flux points or flux samples jointly for a group of sources. [#6322]Add an boolean argument
allow_multiple_telescopeswhich allows the user to computeFluxPointsEstimatorfor multiple telescopes. [#6339]Replace
make_theta_squared_tablewithThetaSquaredTableclass. Overlapping regions are now forbidden. User can define multiple non-overlapping OFF regions. [#6348]Add GTI to datasets created by
FermipyDatasetsReader. [#6378]Make LogScale clipping threshold adaptive to input dtype. This allows interpolation on float64 arrays without hard clipping at the float32 threshold (~1e-38). [#6387]
Add
plot_samples_violin_vs_energyto create a violin plot from samples of a given quantity as a function of energy.` [#6389]Replaced the slow
coadd()fallback inWcsNDMap.cropandWcsNDMap.padwith direct dynamic tensor slicing, drastically improving performance for irregular non-spatial geometries. [#6428]Support chained comparisons in
gammapy.utils.scripts.logic_parser(e.g.,1 < x < 3). [#6467]
Bug Fixes#
Fix issue #5783, the
to_tablemethod now always outputs standard flux units. [#6108]Adapted the
size_factordefault value to be consistent for all spatial models. [#6137]Extra sensitivity options were added to
FluxMaps. The additional options we now support are: “dnde_sensitivity”, “e2dnde_sensitivity”, “eflux_sensitivity”. [#6141]Fixed
gammapy.irf.EDispKernel.plot_biasso the correct axis is now being called for thexaxis.units. [#6159]Fixed the incorrect brackets in the error calculation for
compute_flux_doubling. [#6164]Corrected
TemplatePhaseCurveTemporalModelintegration by performing global normalisation by the duration of the integration window as done in the other temporal models. [#6182]Replaced the deprecated keyword
RADECSYSfor the coordinate system in the GADF event list fits table withRADESYSa. [#6189]Ignore observations without spatial overlap with the target dataset geometry in
DatasetsMakerinstead of raising an error. [#6194]Corrected SkyModel
_check_unitunit requirement for models where exposure is not applied. [#6227]Modify default interpolation conditions in
TemplateSpatialModelto allow using Hpx geometry maps. [#6248]Fixed
plot_errorforBrokenPowerLawSpectralModelandTemplateNDSpectralModel[#6251]Fix
plot_errorfor models evaluated with non-finite values. [#6252]Fix the addition logic so that
gammapy.modeling.models.Modelsandgammapy.modeling.models.DatasetModelscan be added together regardless of the order they are given. [#6253]Fix map stacking if data type is not float. [#6254]
Adapted
SpectrumDataset.create()to avoid creating PSFMap during dataset creation. Moved creation ofSpectrumDataset.create()into theSpectrumDatasetclass. Added check forRegionGeomof given geometry. [#6259]Add an optional normalize argument on
TemplatePhaseCurveTemporalModel. It is set by default to True, for backward compatibility with 2.0. [#6270]Fixed kinematics in
gammapy.astro.darkmatter.DarkMatterDecaySpectralModel. The model now correctly uses mass/2 for the primary flux lookup. [#6298]Correct issue #6304. Include CITATION file in the gammapy directory. Modify the
_get_bibtexand_get_acknowledgementfunctions accordingly. [#6308]Add default
Parametervalues on init in gammapy.astro models. This solves docs build issues which appeared recently. [#6333]Correct bug with command-line-interface (
gammapy analysis run) that forces background maker method to be reflected regions. [#6367]Fix an off-by-one error in
pix_to_idxby clipping indices to npix - 1. [#6383]Fix
hpx.geom.pix_to_idxto correctly handle non-spatial pixel coordinates, ensuring consistency with WCS. [#6388]requestsandtqdmare now included as core dependencies so thatgammapy download datasetsworks out of the box without requiring users to install extra packages manually. [#6400]Parameterbounds are now synchronized dynamically withUniformPriorandLogUniformPriorbounds to prevent Minuit from hitting infinite likelihood. [#6409]Fix
gammapy.datasets.utils.set_and_restore_mask_fitsuch as it does not ignore the existing dataset.mask_fit by default. [#6416]Improve parsing of config file in FermipyDatasetsReader.read() and raise more explicit errors for invalid cases. [#6421]
Fix a
RuntimeWarningdue to division by zero inplot_offset_dependencewhen the maximum effective area is zero. [#6450]Fix flux estimates in
gammapy.estimators.TSMapEstimator(now the kernel is properly normalized in each energy bin rather than over the total energy range). [#6466]Fix
select_timeinEventList,GTIandObservationto always utilise start time (inclusive) and stop time (exclusive). [#6497]Fix unit handling in RegionNDMap.plot_mask [#6520]
Propagated the
overwriteargument in thewritemethod ofTemplateNDSpectralModel. [#6525]Introduce default threshold value to remove numerical artifacts created when applying
to_edisp_kernel(). [#6547]
Contributors#
Fabio Acero
Kush Agarwal
Arnau Aguasca-Cabot
Tora T. H. Arnesen
Ebraam Ashraf
Y.Emre Bahar
Tomas Bylund
Marie-Sophie Carrasco
Alexander Cerviño Cortínez
Pratham Chaudary
Yaocheng Chen
Anshita Dubey
Katharina Egg
Kirsty Feijen
Lea Heckmann
Basmala Hekal
Bruno Khélifi
Daniel Morcuende
Mireia Nievas-Rosillo
Pierre Pichard
Natthan Pigoux
Fabio Pintore
Maxime Regeard
Quentin Remy
Leander Schlegel
Atreyee Sinha
Régis Terrier