Commit f61a77788bc524b2ae5a37a3d933c65527a5db39
1 parent
0d714f30
Add ctbkgcube::cntcube() method (#2685)
Showing
5 changed files
with
29 additions
and
5 deletions
ChangeLog
| 1 | -2018-09-19 | |
| 1 | +2018-09-21 | |
| 2 | 2 | |
| 3 | 3 | * Version 1.6.0 released |
| 4 | 4 | ======================== |
| 5 | 5 | |
| 6 | + Add ctbkgcube::cntcube() method (#2685) | |
| 6 | 7 | Avoid ctselect error in case that RoI radius is unchanged (#2682) |
| 7 | 8 | Add "use_irf_bkg" parameter to cslightcrv |
| 8 | 9 | Add "like_accuracy" parameter to likelihood tools and scripts (#2662) | ... | ... |
NEWS
| 1 | 1 | New Features and Important Changes in ctools 1.6.0 |
| 2 | 2 | |
| 3 | -19 September 2018 | |
| 3 | +21 September 2018 | |
| 4 | 4 | |
| 5 | 5 | |
| 6 | 6 | Introduction |
| ... | ... | @@ -56,7 +56,10 @@ Copy the time reference from the first input observation (#2054). |
| 56 | 56 | |
| 57 | 57 | ctbkgcube - CTA background cube generation |
| 58 | 58 | ------------------------------------------ |
| 59 | -None | |
| 59 | +Add ctbkgcube::cntcube() method so that a counts cube be specified as | |
| 60 | +instance before running the tool. This avoids storing the counts cube on | |
| 61 | +disk if the couts cube definition should be used to generate a background | |
| 62 | +cube (#2685). | |
| 60 | 63 | |
| 61 | 64 | |
| 62 | 65 | ctbutterfly - Generate butterfly diagrams | ... | ... |
doc/source/admin/release_history/1.6.rst
| ... | ... | @@ -34,6 +34,8 @@ Bug fixes |
| 34 | 34 | Improvements |
| 35 | 35 | ------------ |
| 36 | 36 | |
| 37 | +* [`2685 <https://cta-redmine.irap.omp.eu/issues/2685>`_] - | |
| 38 | + Add ``ctbkgcube::cntcube()`` method | |
| 37 | 39 | * Add ``use_irf_bkg`` parameter to :ref:`cslightcrv` |
| 38 | 40 | * [`2671 <https://cta-redmine.irap.omp.eu/issues/2671>`_] - |
| 39 | 41 | Do not skip bins with zero counts in :ref:`csspec` | ... | ... |
pyext/ctbkgcube.i
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * ctbkgcube - Background cube generation tool * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2014-2016 by Chia-Chun Lu * | |
| 4 | + * copyright (C) 2014-2018 by Chia-Chun Lu * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -48,6 +48,7 @@ public: |
| 48 | 48 | void run(void); |
| 49 | 49 | void save(void); |
| 50 | 50 | void publish(const std::string& name = ""); |
| 51 | + void cntcube(const GCTAEventCube& cntcube); | |
| 51 | 52 | const GCTACubeBackground& bkgcube(void) const; |
| 52 | 53 | const GModels& models(void) const; |
| 53 | 54 | }; | ... | ... |
src/ctbkgcube/ctbkgcube.hpp
| ... | ... | @@ -59,6 +59,7 @@ public: |
| 59 | 59 | void run(void); |
| 60 | 60 | void save(void); |
| 61 | 61 | void publish(const std::string& name = ""); |
| 62 | + void cntcube(const GCTAEventCube& cntcube); | |
| 62 | 63 | const GCTACubeBackground& bkgcube(void) const; |
| 63 | 64 | const GModels& models(void) const; |
| 64 | 65 | |
| ... | ... | @@ -78,12 +79,29 @@ protected: |
| 78 | 79 | |
| 79 | 80 | // Protected members |
| 80 | 81 | GCTACubeBackground m_background; //!< Background cube |
| 82 | + GCTAEventCube m_cube; //!< Event cube | |
| 81 | 83 | GModels m_bkgmdl; //!< CTA background models |
| 82 | 84 | GModels m_outmdl; //!< Output models |
| 83 | 85 | }; |
| 84 | 86 | |
| 85 | 87 | |
| 86 | 88 | /***********************************************************************//** |
| 89 | + * @brief Set event cube | |
| 90 | + * | |
| 91 | + * @param[in] Event cube. | |
| 92 | + ***************************************************************************/ | |
| 93 | +inline | |
| 94 | +void ctbkgcube::cntcube(const GCTAEventCube& cntcube) | |
| 95 | +{ | |
| 96 | + // Set counts cube | |
| 97 | + m_cube = cntcube; | |
| 98 | + | |
| 99 | + // Return | |
| 100 | + return; | |
| 101 | +} | |
| 102 | + | |
| 103 | + | |
| 104 | +/***********************************************************************//** | |
| 87 | 105 | * @brief Return background response cube containing background rate |
| 88 | 106 | * |
| 89 | 107 | * @return Background response cube. |
| ... | ... | @@ -96,7 +114,6 @@ const GCTACubeBackground& ctbkgcube::bkgcube(void) const |
| 96 | 114 | } |
| 97 | 115 | |
| 98 | 116 | |
| 99 | - | |
| 100 | 117 | /***********************************************************************//** |
| 101 | 118 | * @brief Return background model container |
| 102 | 119 | * | ... | ... |