Commit 6fa49912b1afe8c91d6eceb2062b574af863ac14

Authored by Jürgen Knödlseder
2 parents 51d7deec e13c97b5

Merge branch 'bugfix-1.3.1' into integration

# Conflicts:
#	ChangeLog
#	NEWS
#	README.md
#	configure.ac
#	doc/Doxyfile
#	doc/source/conf.py
#	gammalib.pc.in
#	sonar-project.properties
ChangeLog
@@ -6,6 +6,15 @@ @@ -6,6 +6,15 @@
6 Add GSkyRegions::overlaps() and GSkyMap::overlaps() classes (#1980) 6 Add GSkyRegions::overlaps() and GSkyMap::overlaps() classes (#1980)
7 7
8 8
  9 +2017-07-06
  10 +
  11 + * Bug fix version 1.3.1 released
  12 + ================================
  13 +
  14 + Improve caching in GSkyDir (#2148)
  15 + Make GCTAPsfKing save against invalid values (#2133)
  16 +
  17 +
9 2017-06-06 18 2017-06-06
10 19
11 * Version 1.3.0 released 20 * Version 1.3.0 released
doc/source/admin/download.rst
@@ -17,6 +17,9 @@ The latest GammaLib release is @@ -17,6 +17,9 @@ The latest GammaLib release is
17 `gammalib-1.3.0 <http://cta.irap.omp.eu/ctools/releases/gammalib/gammalib-1.3.0.tar.gz>`_ 17 `gammalib-1.3.0 <http://cta.irap.omp.eu/ctools/releases/gammalib/gammalib-1.3.0.tar.gz>`_
18 (7 Juin 2017). 18 (7 Juin 2017).
19 19
  20 +Below a table of older GammaLib releases. Please read the :ref:`sec_release` to
  21 +learn more about new features and corrected bugs in a given release.
  22 +
20 To download an older release, click on the corresponding release number: 23 To download an older release, click on the corresponding release number:
21 `1.2.0 <http://cta.irap.omp.eu/ctools/releases/gammalib/gammalib-1.2.0.tar.gz>`_ 24 `1.2.0 <http://cta.irap.omp.eu/ctools/releases/gammalib/gammalib-1.2.0.tar.gz>`_
22 `1.1.0 <http://cta.irap.omp.eu/ctools/releases/gammalib/gammalib-1.1.0.tar.gz>`_ 25 `1.1.0 <http://cta.irap.omp.eu/ctools/releases/gammalib/gammalib-1.1.0.tar.gz>`_
doc/source/admin/release_history/1.3.1.rst 0 → 100644
  1 +.. _1.3.1:
  2 +
  3 +GammaLib 1.3.1 release
  4 +======================
  5 +
  6 +Overview
  7 +--------
  8 +
  9 +GammaLib 1.3.1 is a bug fix for GammaLib release 1.3.
  10 +
  11 +The following bugs have been fixed:
  12 +
  13 +* [`2133 <https://cta-redmine.irap.omp.eu/issues/2133>`_] -
  14 + Make GCTAPsfKing save against invalid values
  15 +
  16 +
  17 +The following improvements have been made:
  18 +
  19 +* [`2148 <https://cta-redmine.irap.omp.eu/issues/2148>`_] -
  20 + Improve caching in GSkyDir
doc/source/admin/release_history/index.rst
1 -.. _release: 1 +.. _sec_release:
2 2
3 Release History 3 Release History
4 =============== 4 ===============
@@ -19,6 +19,7 @@ Bug fix releases: @@ -19,6 +19,7 @@ Bug fix releases:
19 .. toctree:: 19 .. toctree::
20 :maxdepth: 1 20 :maxdepth: 1
21 21
  22 + GammaLib 1.3.1 <1.3.1>
22 GammaLib 1.0.1 <1.0.1> 23 GammaLib 1.0.1 <1.0.1>
23 24
24 For older GammaLib versions see 25 For older GammaLib versions see
doc/source/develop/index.rst
1 -.. _develop: 1 +.. _sec_develop:
2 2
3 Developer documentation 3 Developer documentation
4 ======================= 4 =======================
doc/source/help/index.rst
1 -.. _help: 1 +.. _sec_help:
2 2
3 Getting Help 3 Getting Help
4 ============ 4 ============
include/GSkyDir.hpp
1 /*************************************************************************** 1 /***************************************************************************
2 * GSkyDir.hpp - Sky direction class * 2 * GSkyDir.hpp - Sky direction class *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2008-2014 by Juergen Knoedlseder * 4 + * copyright (C) 2008-2017 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -101,12 +101,12 @@ private: @@ -101,12 +101,12 @@ private:
101 double* xout, double *yout) const; 101 double* xout, double *yout) const;
102 102
103 // Private members 103 // Private members
104 - bool m_has_lb; //!< Has galactic coordinates  
105 - bool m_has_radec; //!< Has equatorial coordinates  
106 - double m_l; //!< Galactic longitude in radians  
107 - double m_b; //!< Galactic latitude in radians  
108 - double m_ra; //!< Right Ascension in radians  
109 - double m_dec; //!< Declination in radians 104 + mutable bool m_has_lb; //!< Has galactic coordinates
  105 + mutable bool m_has_radec; //!< Has equatorial coordinates
  106 + double m_l; //!< Galactic longitude in radians
  107 + double m_b; //!< Galactic latitude in radians
  108 + double m_ra; //!< Right Ascension in radians
  109 + double m_dec; //!< Declination in radians
110 110
111 // Sincos cache 111 // Sincos cache
112 #if defined(G_SINCOS_CACHE) 112 #if defined(G_SINCOS_CACHE)
inst/cta/src/GCTAPsfKing.cpp
@@ -518,7 +518,7 @@ double GCTAPsfKing::delta_max(const double&amp; logE, @@ -518,7 +518,7 @@ double GCTAPsfKing::delta_max(const double&amp; logE,
518 if (m_par_norm > 0.0) { 518 if (m_par_norm > 0.0) {
519 radius = r_max(logE, theta); 519 radius = r_max(logE, theta);
520 } 520 }
521 - 521 +
522 // Return maximum PSF radius 522 // Return maximum PSF radius
523 return radius; 523 return radius;
524 } 524 }
@@ -760,6 +760,12 @@ void GCTAPsfKing::update(const double&amp; logE, const double&amp; theta) const @@ -760,6 +760,12 @@ void GCTAPsfKing::update(const double&amp; logE, const double&amp; theta) const
760 760
761 } // endif: restricted PSF radius 761 } // endif: restricted PSF radius
762 762
  763 + // If maximum PSF radius is zero then also set the normalization
  764 + // to zero
  765 + else if (m_par_rmax == 0.0) {
  766 + m_par_norm = 0.0;
  767 + }
  768 +
763 } // endif: King profile parameters were valid 769 } // endif: King profile parameters were valid
764 770
765 } // endif: PSF parameters have changed 771 } // endif: PSF parameters have changed
@@ -780,7 +786,8 @@ void GCTAPsfKing::update(const double&amp; logE, const double&amp; theta) const @@ -780,7 +786,8 @@ void GCTAPsfKing::update(const double&amp; logE, const double&amp; theta) const
780 * is set by this method to where the containment fraction become 99.9%. 786 * is set by this method to where the containment fraction become 99.9%.
781 * 787 *
782 * This method requires the m_par_gamma and m_par_sigma to be set to valid 788 * This method requires the m_par_gamma and m_par_sigma to be set to valid
783 - * values. 789 + * values. In case that the parameters lead to an infinite result the method
  790 + * will return a maximum size of zero.
784 ***************************************************************************/ 791 ***************************************************************************/
785 double GCTAPsfKing::r_max(const double& logE, 792 double GCTAPsfKing::r_max(const double& logE,
786 const double& theta) const 793 const double& theta) const
@@ -791,7 +798,8 @@ double GCTAPsfKing::r_max(const double&amp; logE, @@ -791,7 +798,8 @@ double GCTAPsfKing::r_max(const double&amp; logE,
791 // Compute maximum PSF radius for containment fraction 798 // Compute maximum PSF radius for containment fraction
792 double u_max = (std::pow((1.0 - F), (1.0/(1.0-m_par_gamma))) - 1.0) * 799 double u_max = (std::pow((1.0 - F), (1.0/(1.0-m_par_gamma))) - 1.0) *
793 m_par_gamma; 800 m_par_gamma;
794 - double radius = m_par_sigma * std::sqrt(2.0 * u_max); 801 + double radius = (gammalib::is_infinite(u_max)) ? 0.0 :
  802 + m_par_sigma * std::sqrt(2.0 * u_max);
795 803
796 // Return maximum PSF radius 804 // Return maximum PSF radius
797 return radius; 805 return radius;
inst/cta/src/GCTAResponseIrf.cpp
@@ -2075,10 +2075,11 @@ double GCTAResponseIrf::npsf(const GSkyDir&amp; srcDir, @@ -2075,10 +2075,11 @@ double GCTAResponseIrf::npsf(const GSkyDir&amp; srcDir,
2075 std::cout << "*** ERROR: GCTAResponseIrf::npsf:"; 2075 std::cout << "*** ERROR: GCTAResponseIrf::npsf:";
2076 std::cout << " NaN/Inf encountered"; 2076 std::cout << " NaN/Inf encountered";
2077 std::cout << " (value=" << value; 2077 std::cout << " (value=" << value;
2078 - std::cout << ", roi_radius=" << roi_radius;  
2079 - std::cout << ", roi_psf_distance=" << roi_psf_distance;  
2080 - //std::cout << ", sigma=" << sigma;  
2081 - std::cout << ", r=[" << rmin << "," << rmax << "])"; 2078 + std::cout << ", roi_radius=" << roi_radius * gammalib::rad2deg;
  2079 + std::cout << ", roi_psf_distance=";
  2080 + std::cout << roi_psf_distance * gammalib::rad2deg;
  2081 + std::cout << ", r=[" << rmin * gammalib::rad2deg;
  2082 + std::cout << "," << rmax * gammalib::rad2deg << "])";
2082 std::cout << std::endl; 2083 std::cout << std::endl;
2083 } 2084 }
2084 #endif 2085 #endif
src/sky/GSkyDir.cpp
1 /*************************************************************************** 1 /***************************************************************************
2 * GSkyDir.cpp - Sky direction class * 2 * GSkyDir.cpp - Sky direction class *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2008-2013 by Juergen Knoedlseder * 4 + * copyright (C) 2008-2017 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -811,6 +811,9 @@ void GSkyDir::equ2gal(void) const @@ -811,6 +811,9 @@ void GSkyDir::equ2gal(void) const
811 // Convert from equatorial to galactic 811 // Convert from equatorial to galactic
812 euler(0, m_ra, m_dec, l, b); 812 euler(0, m_ra, m_dec, l, b);
813 813
  814 + // Signal that galactic coordinates are available
  815 + m_has_lb = true;
  816 +
814 // Return 817 // Return
815 return; 818 return;
816 } 819 }
@@ -830,6 +833,9 @@ void GSkyDir::gal2equ(void) const @@ -830,6 +833,9 @@ void GSkyDir::gal2equ(void) const
830 // Convert from galactic to equatorial 833 // Convert from galactic to equatorial
831 euler(1, m_l, m_b, ra, dec); 834 euler(1, m_l, m_b, ra, dec);
832 835
  836 + // Signal that equatorial coordinates are available
  837 + m_has_radec = true;
  838 +
833 // Return 839 // Return
834 return; 840 return;
835 } 841 }