From c813cf257dab626e9ecb7fa4e28c7807490ae1cc Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Fri, 30 Oct 2015 01:19:21 +0100 Subject: [PATCH] Document the normalization computation. --- src/model/GModelSpatialEllipticalGauss.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/model/GModelSpatialEllipticalGauss.cpp b/src/model/GModelSpatialEllipticalGauss.cpp index 1728024..cab1059 100644 --- a/src/model/GModelSpatialEllipticalGauss.cpp +++ b/src/model/GModelSpatialEllipticalGauss.cpp @@ -724,10 +724,14 @@ void GModelSpatialEllipticalGauss::free_members(void) * * Computes the normalization * \f[ - * {\tt m\_norm} = \frac{1}{2 \pi (1 - \cos a) (1 - \cos b)} + * {\tt m\_norm} = \frac{1}{2 \pi \times a \times b} * \f] + * where + * \f$a\f$ is the semi-major axis and + * \f$b\f$ is the semi-minor axis of the ellipse. * - * @todo check this formula + * @todo Generalize normalization to the sphere (for the moment only accurate + * in the small angle approximation). ***************************************************************************/ void GModelSpatialEllipticalGauss::update() const { @@ -748,7 +752,10 @@ void GModelSpatialEllipticalGauss::update() const m_minor_rad = m_last_minor * gammalib::deg2rad; m_major_rad = m_last_major * gammalib::deg2rad; - // Perform precomputations + // Perform precomputations. Note that I verified the normalization + // by numerical integration of the resulting Gaussian. Note also + // also that the normalization is only correct in the small angle + // approximation. m_minor2 = m_minor_rad * m_minor_rad; m_major2 = m_major_rad * m_major_rad; double denom = gammalib::twopi * m_minor_rad * m_major_rad; -- libgit2 0.21.4