TablePSF¶
-
class
gammapy.irf.
TablePSF
(rad_axis, psf_value, interp_kwargs=None)[source]¶ Bases:
object
Radially-symmetric table PSF.
- Parameters
Attributes Summary
Methods Summary
containment
(rad_max)Compute PSF containment fraction.
containment_radius
(fraction)Containment radius.
evaluate
(rad)Evaluate PSF.
from_shape
(shape, width, rad)Make TablePSF objects with commonly used shapes.
info
()Print basic info.
Normalize PSF to unit integral.
plot_psf_vs_rad
([ax])Plot PSF vs radius.
Attributes Documentation
-
rad_axis
¶
Methods Documentation
-
containment
(rad_max)[source]¶ Compute PSF containment fraction.
- Parameters
- rad_max
Quantity
Offset angle range
- rad_max
- Returns
- integralfloat
PSF integral
-
containment_radius
(fraction)[source]¶ Containment radius.
- Parameters
- fractionarray_like
Containment fraction (range 0 .. 1)
- Returns
- rad
Angle
Containment radius angle
- rad
-
evaluate
(rad)[source]¶ Evaluate PSF.
The following PSF quantities are available:
‘dp_domega’: PDF per 2-dim solid angle \(\Omega\) in sr^-1
\[\frac{dP}{d\Omega}\]
-
classmethod
from_shape
(shape, width, rad)[source]¶ Make TablePSF objects with commonly used shapes.
This function is mostly useful for examples and testing.
- Parameters
- Returns
- psf
TablePSF
Table PSF
- psf
Examples
>>> import numpy as np >>> from astropy.coordinates import Angle >>> from gammapy.irf import TablePSF >>> rad = Angle(np.linspace(0, 0.7, 100), 'deg') >>> psf = TablePSF.from_shape(shape='gauss', width='0.2 deg', rad=rad)
-
normalize
()[source]¶ Normalize PSF to unit integral.
Computes the total PSF integral via the \(dP / dr\) spline and then divides the \(dP / dr\) array.
-
plot_psf_vs_rad
(ax=None, **kwargs)[source]¶ Plot PSF vs radius.
- Parameters
- ax``
- kwargsdict
Keyword arguments passed to
matplotlib.pyplot.plot