Commit f69180accf42a761395dbf3d692ee16429742dc0

Authored by Jürgen Knödlseder
1 parent dc054bbc

Reduce kluge radius for elliptical models as they are defined in cartesian geome…

…try while the response computation is done in spherical trigonometry.
inst/cta/src/GCTAResponse_helpers.cpp
... ... @@ -49,6 +49,14 @@
49 49 #define G_DEBUG_MODEL_ZERO //!< Debug check for zero model values
50 50  
51 51 /* __ Constants __________________________________________________________ */
  52 +const double g_kulge_radius = 1.0e-12; //!< Tiny angle (radians)
  53 +const double g_ellipse_kulge_radius = 1.0e-6; //!< About 0.2 arc seconds
  54 + // A larger radius is used
  55 + // as the ellipse is defined
  56 + // in cartesian coordinates
  57 + // while distances are
  58 + // computed in spherical
  59 + // trigonometry
52 60  
53 61  
54 62 /*==========================================================================
... ... @@ -285,7 +293,7 @@ double cta_irf_radial_kern_rho::eval(const double&amp; rho)
285 293  
286 294 // Reduce rho by an infinite amount to avoid rounding errors
287 295 // at the boundary of a sharp edged model
288   - double rho_kluge = rho - 1.0e-12;
  296 + double rho_kluge = rho - g_kulge_radius;
289 297 if (rho_kluge < 0.0) {
290 298 rho_kluge = 0.0;
291 299 }
... ... @@ -483,7 +491,7 @@ double cta_npred_radial_kern_rho::eval(const double&amp; rho)
483 491  
484 492 // Reduce rho by an infinite amount to avoid rounding errors
485 493 // at the boundary of a sharp edged model
486   - double rho_kluge = rho - 1.0e-12;
  494 + double rho_kluge = rho - g_kulge_radius;
487 495 if (rho_kluge < 0.0) {
488 496 rho_kluge = 0.0;
489 497 }
... ... @@ -663,7 +671,7 @@ double cta_irf_elliptical_kern_rho::eval(const double&amp; rho)
663 671 // Reduce rho by an infinite amount to avoid rounding errors
664 672 // at the boundary of a sharp edged model (e.g. an elliptical
665 673 // disk model)
666   - double rho_kluge = rho - 1.0e-12;
  674 + double rho_kluge = rho - g_ellipse_kulge_radius;
667 675 if (rho_kluge < 0.0) {
668 676 rho_kluge = 0.0;
669 677 }
... ... @@ -960,7 +968,7 @@ double cta_npred_elliptical_kern_rho::eval(const double&amp; rho)
960 968 // Reduce rho by an infinite amount to avoid rounding errors
961 969 // at the boundary of a sharp edged model (e.g. an elliptical
962 970 // disk model)
963   - double rho_kluge = rho - 1.0e-12;
  971 + double rho_kluge = rho - g_ellipse_kulge_radius;
964 972 if (rho_kluge < 0.0) {
965 973 rho_kluge = 0.0;
966 974 }
... ... @@ -1566,7 +1574,7 @@ double cta_psf_radial_kern_rho::eval(const double&amp; rho)
1566 1574  
1567 1575 // Reduce rho by an infinite amount to avoid rounding errors
1568 1576 // at the boundary of a sharp edged model
1569   - double rho_kluge = rho - 1.0e-12;
  1577 + double rho_kluge = rho - g_kulge_radius;
1570 1578 if (rho_kluge < 0.0) {
1571 1579 rho_kluge = 0.0;
1572 1580 }
... ... @@ -1913,7 +1921,7 @@ double cta_psf_elliptical_kern_rho::eval(const double&amp; rho)
1913 1921 // Reduce rho by an infinite amount to avoid rounding errors
1914 1922 // at the boundary of a sharp edged model (e.g. an elliptical
1915 1923 // disk model)
1916   - double rho_kluge = rho - 1.0e-12;
  1924 + double rho_kluge = rho - g_ellipse_kulge_radius;
1917 1925 if (rho_kluge < 0.0) {
1918 1926 rho_kluge = 0.0;
1919 1927 }
... ...