Commit c813cf257dab626e9ecb7fa4e28c7807490ae1cc
1 parent
5506fcad
Document the normalization computation.
Showing
1 changed file
with
10 additions
and
3 deletions
src/model/GModelSpatialEllipticalGauss.cpp
| @@ -724,10 +724,14 @@ void GModelSpatialEllipticalGauss::free_members(void) | @@ -724,10 +724,14 @@ void GModelSpatialEllipticalGauss::free_members(void) | ||
| 724 | * | 724 | * |
| 725 | * Computes the normalization | 725 | * Computes the normalization |
| 726 | * \f[ | 726 | * \f[ |
| 727 | - * {\tt m\_norm} = \frac{1}{2 \pi (1 - \cos a) (1 - \cos b)} | 727 | + * {\tt m\_norm} = \frac{1}{2 \pi \times a \times b} |
| 728 | * \f] | 728 | * \f] |
| 729 | + * where | ||
| 730 | + * \f$a\f$ is the semi-major axis and | ||
| 731 | + * \f$b\f$ is the semi-minor axis of the ellipse. | ||
| 729 | * | 732 | * |
| 730 | - * @todo check this formula | 733 | + * @todo Generalize normalization to the sphere (for the moment only accurate |
| 734 | + * in the small angle approximation). | ||
| 731 | ***************************************************************************/ | 735 | ***************************************************************************/ |
| 732 | void GModelSpatialEllipticalGauss::update() const | 736 | void GModelSpatialEllipticalGauss::update() const |
| 733 | { | 737 | { |
| @@ -748,7 +752,10 @@ void GModelSpatialEllipticalGauss::update() const | @@ -748,7 +752,10 @@ void GModelSpatialEllipticalGauss::update() const | ||
| 748 | m_minor_rad = m_last_minor * gammalib::deg2rad; | 752 | m_minor_rad = m_last_minor * gammalib::deg2rad; |
| 749 | m_major_rad = m_last_major * gammalib::deg2rad; | 753 | m_major_rad = m_last_major * gammalib::deg2rad; |
| 750 | 754 | ||
| 751 | - // Perform precomputations | 755 | + // Perform precomputations. Note that I verified the normalization |
| 756 | + // by numerical integration of the resulting Gaussian. Note also | ||
| 757 | + // also that the normalization is only correct in the small angle | ||
| 758 | + // approximation. | ||
| 752 | m_minor2 = m_minor_rad * m_minor_rad; | 759 | m_minor2 = m_minor_rad * m_minor_rad; |
| 753 | m_major2 = m_major_rad * m_major_rad; | 760 | m_major2 = m_major_rad * m_major_rad; |
| 754 | double denom = gammalib::twopi * m_minor_rad * m_major_rad; | 761 | double denom = gammalib::twopi * m_minor_rad * m_major_rad; |