From 39a150566af715082adfe5cb8d23fb9198929e4a Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Thu, 27 Jul 2017 18:16:07 +0200 Subject: [PATCH] Fix ctmodel bug for stacked analysis with diffuse maps or cubes (#2171) --- ChangeLog | 3 ++- NEWS | 7 +++++-- doc/source/admin/release_history/1.4.rst | 2 ++ src/ctmodel/ctmodel.cpp | 6 ++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a19e68..640b2b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,9 @@ -2017-07-03 +2017-07-27 * Version 1.4.0 released ======================== + Fix ctmodel bug for stacked analysis with diffuse maps or cubes (#2171) Install ctools header files (#2145) diff --git a/NEWS b/NEWS index a2e9114..2ebf871 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ New Features and Important Changes in ctools 1.4.0 -3 July 2017 +27 July 2017 Introduction @@ -57,7 +57,10 @@ None ctmodel - CTA counts cube modelling ----------------------------------- -None +The diffuse response computation for a stacked analysis require the ipix() and iend() +attributes set in order to properly cache the response values, yet the ctmodel +modifications introduced in version 1.3.1 did not properly set these attributes. +This has been corrected (#2171). ctexpcube - CTA exposure cube generation diff --git a/doc/source/admin/release_history/1.4.rst b/doc/source/admin/release_history/1.4.rst index f2200f3..9963bda 100644 --- a/doc/source/admin/release_history/1.4.rst +++ b/doc/source/admin/release_history/1.4.rst @@ -21,6 +21,8 @@ Bug fixes Improvements ------------ +* [`2171 `_] - + Fix ctmodel bug for stacked analysis with diffuse maps or cubes * [`2145 `_] - Install C++ header files diff --git a/src/ctmodel/ctmodel.cpp b/src/ctmodel/ctmodel.cpp index 09db4f1..332e0a0 100644 --- a/src/ctmodel/ctmodel.cpp +++ b/src/ctmodel/ctmodel.cpp @@ -842,9 +842,10 @@ void ctmodel::fill_cube(const GCTAObservation* obs) continue; } - // Set instrument direction and solid angle of bin + // Set instrument direction, solid angle and pixel index of bin bin.dir(m_dir[i]); bin.solidangle(m_solidangle[i]); + bin.ipix(i); // Loop over all of the energy bins of the cube for (int iebin = 0, ibin = i; iebin < nebins; ++iebin, ibin += npix) { @@ -857,9 +858,10 @@ void ctmodel::fill_cube(const GCTAObservation* obs) continue; } - // Set energy and energy width of bin + // Set energy, energy width and energy index of bin bin.energy(m_energy[iebin]); bin.ewidth(m_ewidth[iebin]); + bin.ieng(iebin); // Compute model value for cube bin double model = models.eval(bin, *obs) * bin.size(); -- libgit2 0.21.4