diff --git a/ChangeLog b/ChangeLog index 0565fb6..f3aff0b 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,9 @@ -2018-09-19 +2018-09-21 * Version 1.6.0 released ======================== + Add ctbkgcube::cntcube() method (#2685) Avoid ctselect error in case that RoI radius is unchanged (#2682) Add "use_irf_bkg" parameter to cslightcrv Add "like_accuracy" parameter to likelihood tools and scripts (#2662) diff --git a/NEWS b/NEWS index c3cf327..857e0d6 100755 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ New Features and Important Changes in ctools 1.6.0 -19 September 2018 +21 September 2018 Introduction @@ -56,7 +56,10 @@ Copy the time reference from the first input observation (#2054). ctbkgcube - CTA background cube generation ------------------------------------------ -None +Add ctbkgcube::cntcube() method so that a counts cube be specified as +instance before running the tool. This avoids storing the counts cube on +disk if the couts cube definition should be used to generate a background +cube (#2685). ctbutterfly - Generate butterfly diagrams diff --git a/doc/source/admin/release_history/1.6.rst b/doc/source/admin/release_history/1.6.rst index 9599542..fc7df6f 100644 --- a/doc/source/admin/release_history/1.6.rst +++ b/doc/source/admin/release_history/1.6.rst @@ -34,6 +34,8 @@ Bug fixes Improvements ------------ +* [`2685 `_] - + Add ``ctbkgcube::cntcube()`` method * Add ``use_irf_bkg`` parameter to :ref:`cslightcrv` * [`2671 `_] - Do not skip bins with zero counts in :ref:`csspec` diff --git a/pyext/ctbkgcube.i b/pyext/ctbkgcube.i index ca6b16f..7a431cd 100755 --- a/pyext/ctbkgcube.i +++ b/pyext/ctbkgcube.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctbkgcube - Background cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2016 by Chia-Chun Lu * + * copyright (C) 2014-2018 by Chia-Chun Lu * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -48,6 +48,7 @@ public: void run(void); void save(void); void publish(const std::string& name = ""); + void cntcube(const GCTAEventCube& cntcube); const GCTACubeBackground& bkgcube(void) const; const GModels& models(void) const; }; diff --git a/src/ctbkgcube/ctbkgcube.hpp b/src/ctbkgcube/ctbkgcube.hpp index bda9778..d8fa505 100755 --- a/src/ctbkgcube/ctbkgcube.hpp +++ b/src/ctbkgcube/ctbkgcube.hpp @@ -59,6 +59,7 @@ public: void run(void); void save(void); void publish(const std::string& name = ""); + void cntcube(const GCTAEventCube& cntcube); const GCTACubeBackground& bkgcube(void) const; const GModels& models(void) const; @@ -78,12 +79,29 @@ protected: // Protected members GCTACubeBackground m_background; //!< Background cube + GCTAEventCube m_cube; //!< Event cube GModels m_bkgmdl; //!< CTA background models GModels m_outmdl; //!< Output models }; /***********************************************************************//** + * @brief Set event cube + * + * @param[in] Event cube. + ***************************************************************************/ +inline +void ctbkgcube::cntcube(const GCTAEventCube& cntcube) +{ + // Set counts cube + m_cube = cntcube; + + // Return + return; +} + + +/***********************************************************************//** * @brief Return background response cube containing background rate * * @return Background response cube. @@ -96,7 +114,6 @@ const GCTACubeBackground& ctbkgcube::bkgcube(void) const } - /***********************************************************************//** * @brief Return background model container *