File: plot_fermi_psf.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 (15 lines) | stat: -rw-r--r-- 479 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""Plot Fermi PSF."""

from gammapy.irf import PSFMap
from gammapy.maps import MapAxis, WcsGeom

filename = "$GAMMAPY_DATA/fermi_3fhl/fermi_3fhl_psf_gc.fits.gz"
psf = PSFMap.read(filename, format="gtpsf")

axis = MapAxis.from_energy_bounds("10 GeV", "2 TeV", nbin=20, name="energy_true")
geom = WcsGeom.create(npix=50, binsz=0.01, axes=[axis])

# .to_image() computes the exposure weighted mean PSF
kernel = psf.get_psf_kernel(geom=geom).to_image()

kernel.psf_kernel_map.plot()