Commit d365e6559b1968bba469fe936e74f03eaedae1ea

Authored by Jürgen Knödlseder
1 parent de021e79

Correct Monte-Carlo map normalization in GModelSpatialDiffuseMap::set_mc_cone() …

…for the case that the input map is not normalized (fixes #1584).
ChangeLog
1   -2016-01-13 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
  1 +2016-01-22 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
2 2  
3 3 * Bug fix version 1.0.1 released
4 4 ================================
... ... @@ -6,6 +6,7 @@
6 6 Add units to CTA event list columns (#1616)
7 7 Allow usage of numbers in FITS extension names (#1611)
8 8 Solve compatibility issues with Anaconda on Mac OS X (#1607)
  9 + Correct diffuse map MC normalisation (#1584)
9 10  
10 11  
11 12 2015-12-18 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
... ...
... ... @@ -2,7 +2,7 @@ New Features and Important Changes in GammaLib 1.0.1
2 2  
3 3 Author(s) : Juergen Knoedlseder
4 4  
5   -13 January 2016
  5 +22 January 2016
6 6  
7 7  
8 8 1. Introduction
... ... @@ -47,7 +47,9 @@ None
47 47  
48 48 8. Model module
49 49 ---------------
50   -None
  50 +The diffuse map normalization for Monte Carlo simulations has been corrected in
  51 +GModelSpatialDiffuseMap::set_mc_cone() to properly account for the case that the
  52 +diffuse map has not been normalized. This fixes #1584.
51 53  
52 54  
53 55 9. Numerics module
... ...
1 1 GammaLib information
2 2 ====================
3   -Version: 1.0.1 (13 January 2016)
  3 +Version: 1.0.1 (22 January 2016)
4 4 Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu)
5 5  
6 6  
... ...
src/model/GModelSpatialDiffuseMap.cpp
... ... @@ -719,11 +719,18 @@ void GModelSpatialDiffuseMap::set_mc_cone(const GSkyDir&amp; centre,
719 719 // Make sure that last pixel in the cache is >1
720 720 m_mc_cache[npix] = 1.0001;
721 721  
722   - // Set the normalization factor for the MC simulations as the
723   - // fraction of the flux that is comprised within the simulation
724   - // cone
  722 + // Set the normalization factor for the MC simulations. In case
  723 + // that the map is normalized, this is the fraction of the flux
  724 + // that is comprised within the simulation cone. For non-normalized
  725 + // maps, this is simply the flux comprised within the simulation
  726 + // cone.
725 727 if (sum_map > 0.0) {
726   - m_mc_norm = sum / sum_map;
  728 + if (m_normalize) {
  729 + m_mc_norm = sum / sum_map;
  730 + }
  731 + else {
  732 + m_mc_norm = sum;
  733 + }
727 734 }
728 735  
729 736 // Do we have a HealPix map?
... ...