HESSMultiGaussPSF¶
-
class
gammapy.irf.
HESSMultiGaussPSF
(source)[source]¶ Bases:
object
Multi-Gauss PSF as represented in the HESS software.
The 2D Gaussian is represented as a 1D exponential probability density function per offset angle squared: dp / dtheta**2 = [0]*(exp(-x/(2*[1]*[1]))+[2]*exp(-x/(2*[3]*[3]))
@param source: either a dict of a filename
The following two parameters control numerical precision / speed. Usually the defaults are fine. @param theta_max: Maximum offset in numerical computations @param npoints: Number of points in numerical computations @param eps: Allowed tolerance on normalization of total P to 1
Methods Summary
containment_radius
(containment_fraction)Convolve this PSF with a Gaussian source of width sigma, then compute the containment angle of that distribution. dpdtheta2
(theta2)dp / dtheta2 at position theta2 = theta ^ 2. n_gauss
()Count number of Gaussians. to_MultiGauss2D
([normalize])Use this to compute containment angles and fractions. to_file
(filename, binsz[, fmt])Convert parameters to Sherpa format and write them to a JSON file. to_sherpa
(binsz)Convert parameters to Sherpa format. Methods Documentation
-
containment_radius
(containment_fraction)[source]¶ Convolve this PSF with a Gaussian source of width sigma, then compute the containment angle of that distribution.
-
to_MultiGauss2D
(normalize=True)[source]¶ Use this to compute containment angles and fractions.
Note: We have to set norm = 2 * A * sigma ^ 2, because in MultiGauss2D norm represents the integral, and in HESS A represents the amplitude at 0.
-
to_file
(filename, binsz, fmt='json')[source]¶ Convert parameters to Sherpa format and write them to a JSON file.
-
to_sherpa
(binsz)[source]¶ Convert parameters to Sherpa format.
@param binsz: Bin size (deg) @return: dict of Sherpa parameters
Note: Sherpa uses the following function f(x,y) = f(r) = A exp[-f(r/F)^2] f = 2.7725887 = 4log2 relates the full-width at half-maximum F to the Gaussian sigma.
Note: The sigma parameters in this class are in deg, but in Sherpa we use pix, so we convert here.
For further explanations on how to convert 1D to 2D Gaussian, see the docstring of GCTAResponse::psf_dummy in GammaLib
Input is unnormalized anyways, so we don’t care about absolute PSF normalization here, Sherpa automatically renormalizes. -> Check!
-