diff --git a/ChangeLog b/ChangeLog index 56d408b..bba5e54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ Load CTA GTI extension from the HDU name provided by the DSS keyword (#1598) -2016-01-13 Juergen Knoedlseder +2016-01-22 Juergen Knoedlseder * Bug fix version 1.0.1 released ================================ @@ -15,6 +15,7 @@ Add units to CTA event list columns (#1616) Allow usage of numbers in FITS extension names (#1611) Solve compatibility issues with Anaconda on Mac OS X (#1607) + Correct diffuse map MC normalisation (#1584) 2015-12-18 Juergen Knoedlseder diff --git a/src/model/GModelSpatialDiffuseMap.cpp b/src/model/GModelSpatialDiffuseMap.cpp index 2c31ad3..0b385cb 100644 --- a/src/model/GModelSpatialDiffuseMap.cpp +++ b/src/model/GModelSpatialDiffuseMap.cpp @@ -719,11 +719,18 @@ void GModelSpatialDiffuseMap::set_mc_cone(const GSkyDir& centre, // Make sure that last pixel in the cache is >1 m_mc_cache[npix] = 1.0001; - // Set the normalization factor for the MC simulations as the - // fraction of the flux that is comprised within the simulation - // cone + // Set the normalization factor for the MC simulations. In case + // that the map is normalized, this is the fraction of the flux + // that is comprised within the simulation cone. For non-normalized + // maps, this is simply the flux comprised within the simulation + // cone. if (sum_map > 0.0) { - m_mc_norm = sum / sum_map; + if (m_normalize) { + m_mc_norm = sum / sum_map; + } + else { + m_mc_norm = sum; + } } // Do we have a HealPix map?