diff --git a/ChangeLog b/ChangeLog index da859cd..f49a95c 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,9 @@ -2019-07-10 +2019-07-23 * Version 1.7.0 released ======================== + Remove response cache before source testing in cttsmap (#2973) Enabling running of example scripts from objects in memory (#2925) diff --git a/NEWS b/NEWS index 8458df6..390139f 100755 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ New Features and Important Changes in ctools 1.7.0 -10 July 2019 +23 July 2019 Introduction @@ -123,7 +123,7 @@ writing a FITS file (#2925). cttsmap - Generation of Test Statistic map ------------------------------------------ -None +Remove response cache for test source before fitting the source (#2973). ctulimit - Compute upper limit diff --git a/doc/source/admin/release_history/1.7.rst b/doc/source/admin/release_history/1.7.rst index e297e08..6dc8363 100644 --- a/doc/source/admin/release_history/1.7.rst +++ b/doc/source/admin/release_history/1.7.rst @@ -22,6 +22,8 @@ Bug fixes Improvements ------------ +* [`2973 `_] - + Remove response cache before source testing in cttsmap * [`2925 `_] - Enabling running of example scripts from objects in memory diff --git a/src/cttsmap/cttsmap.cpp b/src/cttsmap/cttsmap.cpp index 85783fa..467c312 100755 --- a/src/cttsmap/cttsmap.cpp +++ b/src/cttsmap/cttsmap.cpp @@ -274,19 +274,17 @@ void cttsmap::run(void) log_header2(EXPLICIT, "Computing TS for bin number "+gammalib::str(i)+ " at "+bincentre.print()); - // Sets unique test source name. This avoids caching of response - // values - std::string srcname = m_srcname + "_" + gammalib::str(i); - // Add test source at current bin position (*m_testsource)["RA"].value(bincentre.ra_deg()); (*m_testsource)["DEC"].value(bincentre.dec_deg()); - m_testsource->name(srcname); models.append(*m_testsource); // Assign models to observations m_obs.models(models); + // Make sure that no values are cached for test source + m_obs.remove_response_cache(m_srcname); + // Optimize observation container m_obs.optimize(m_opt); @@ -315,7 +313,7 @@ void cttsmap::run(void) // Get test source model instance GModels best_fit_model = m_obs.models(); - GModel* testsource = best_fit_model[srcname]; + GModel* testsource = best_fit_model[m_srcname]; // Assign values to the maps m_tsmap(i) = ts; @@ -345,7 +343,7 @@ void cttsmap::run(void) m_statusmap(i) = status; // Remove model from container - models.remove(srcname); + models.remove(m_srcname); } // endfor: looped over grid positions