Commit 39a150566af715082adfe5cb8d23fb9198929e4a

Authored by Jürgen Knödlseder
1 parent 408113a8

Fix ctmodel bug for stacked analysis with diffuse maps or cubes (#2171)

ChangeLog
1   -2017-07-03
  1 +2017-07-27
2 2  
3 3 * Version 1.4.0 released
4 4 ========================
5 5  
  6 + Fix ctmodel bug for stacked analysis with diffuse maps or cubes (#2171)
6 7 Install ctools header files (#2145)
7 8  
8 9  
... ...
1 1 New Features and Important Changes in ctools 1.4.0
2 2  
3   -3 July 2017
  3 +27 July 2017
4 4  
5 5  
6 6 Introduction
... ... @@ -57,7 +57,10 @@ None
57 57  
58 58 ctmodel - CTA counts cube modelling
59 59 -----------------------------------
60   -None
  60 +The diffuse response computation for a stacked analysis require the ipix() and iend()
  61 +attributes set in order to properly cache the response values, yet the ctmodel
  62 +modifications introduced in version 1.3.1 did not properly set these attributes.
  63 +This has been corrected (#2171).
61 64  
62 65  
63 66 ctexpcube - CTA exposure cube generation
... ...
doc/source/admin/release_history/1.4.rst
... ... @@ -21,6 +21,8 @@ Bug fixes
21 21 Improvements
22 22 ------------
23 23  
  24 +* [`2171 <https://cta-redmine.irap.omp.eu/issues/2171>`_] -
  25 + Fix ctmodel bug for stacked analysis with diffuse maps or cubes
24 26 * [`2145 <https://cta-redmine.irap.omp.eu/issues/2145>`_] -
25 27 Install C++ header files
26 28  
... ...
src/ctmodel/ctmodel.cpp
... ... @@ -842,9 +842,10 @@ void ctmodel::fill_cube(const GCTAObservation* obs)
842 842 continue;
843 843 }
844 844  
845   - // Set instrument direction and solid angle of bin
  845 + // Set instrument direction, solid angle and pixel index of bin
846 846 bin.dir(m_dir[i]);
847 847 bin.solidangle(m_solidangle[i]);
  848 + bin.ipix(i);
848 849  
849 850 // Loop over all of the energy bins of the cube
850 851 for (int iebin = 0, ibin = i; iebin < nebins; ++iebin, ibin += npix) {
... ... @@ -857,9 +858,10 @@ void ctmodel::fill_cube(const GCTAObservation* obs)
857 858 continue;
858 859 }
859 860  
860   - // Set energy and energy width of bin
  861 + // Set energy, energy width and energy index of bin
861 862 bin.energy(m_energy[iebin]);
862 863 bin.ewidth(m_ewidth[iebin]);
  864 + bin.ieng(iebin);
863 865  
864 866 // Compute model value for cube bin
865 867 double model = models.eval(bin, *obs) * bin.size();
... ...