irf - Instrument response functions


gammapy.irf handles instrument response functions (IRFs):

  • Effective area (AEFF)
  • Energy dispersion (EDISP)
  • Point spread function (PSF)

Most of the formats defined at IACT IRFs are supported. Otherwise, at the moment, there is very little support for Fermi-LAT or other instruments.

Most users will not use gammapy.irf directly, but will instead use IRFs as part of their spectrum, image or cube analysis to compute exposure and effective EDISP and PSF for a given dataset.

Most (at some point maybe all) classes in gammapy.irf have an gammapy.utils.nddata.NDDataArray as data attribute to support interpolation.

Getting Started

See cta_1dc_introduction.html for an example how to access IACT IRFs.

Effective area

See EffectiveAreaTable and EffectiveAreaTable2D.


See Background2D and Background2D.


The TablePSF and EnergyDependentTablePSF classes represent radially-symmetric PSFs where the PSF is given at a number of offsets.

The PSFKernel represents a PSF kernel.

(png, hires.png, pdf)


Energy Dispersion

The EnergyDispersion class represents an energy migration matrix (finite probabilities per pixel) with y=log(energy_reco).

The EnergyDispersion2D class represents a probability density with y=energy_reco/energy_true that can also have a FOV offset dependence.

(png, hires.png, pdf)


Using gammapy.irf

If you’d like to learn more about using gammapy.irf, read the following sub-pages:


gammapy.irf Package

Instrument response functions (IRFs).


apply_containment_fraction(aeff, psf, radius) Estimate PSF containment inside a given radius and correct effective area for leaking flux.
compute_energy_thresholds(aeff, edisp[, …]) Compute safe energy thresholds from 1D energy dispersion and effective area.
load_cta_irfs(filename) load CTA instrument response function and return a dictionary container.
make_mean_edisp(observations, position, …) Compute mean energy dispersion.
make_mean_psf(observations, position[, …]) Compute mean energy-dependent PSF.
make_psf(observation, position[, energy, rad]) Make energy-dependent PSF for a given source position.


Background2D(energy_lo, energy_hi, …[, …]) Background 2D.
Background3D(energy_lo, energy_hi, …[, …]) Background 3D.
EffectiveAreaTable(energy_lo, energy_hi, data) Effective area table.
EffectiveAreaTable2D(energy_lo, energy_hi, …) 2D effective area table.
EnergyDependentMultiGaussPSF(energy_lo, …) Triple Gauss analytical PSF depending on energy and theta.
EnergyDependentTablePSF(energy, rad[, …]) Energy-dependent radially-symmetric table PSF (gtpsf format).
EnergyDispersion(e_true_lo, e_true_hi, …) Energy dispersion matrix.
EnergyDispersion2D(e_true_lo, e_true_hi, …) Offset-dependent energy dispersion matrix.
IRFStacker(list_aeff, list_livetime[, …]) Stack instrument response functions.
PSF3D(energy_lo, energy_hi, offset, rad_lo, …) PSF with axes: energy, offset, rad.
PSFKing(energy_lo, energy_hi, offset, gamma, …) King profile analytical PSF depending on energy and offset.
TablePSF(rad, psf_value[, interp_kwargs]) Radially-symmetric table PSF.