File: plot_edisp_kernel.py

package info (click to toggle)
gammapy 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,800 kB
  • sloc: python: 81,999; makefile: 211; sh: 11; javascript: 10
file content (13 lines) | stat: -rw-r--r-- 470 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
"""Plot the energy dispersion at a given offset."""

from astropy.coordinates import Angle
import matplotlib.pyplot as plt
from gammapy.irf import EnergyDispersion2D

filename = "$GAMMAPY_DATA/hess-dl3-dr1/data/hess_dl3_dr1_obs_id_020136.fits.gz"
edisp = EnergyDispersion2D.read(filename, hdu="EDISP")
# offset at which we want to examine the energy dispersion
offset = Angle("0.5 deg")
edisp_kernel = edisp.to_edisp_kernel(offset=offset)
edisp_kernel.peek()
plt.show()