Commit b8d08ecf3e16b9a2825ed9caad068052656dbb9a
1 parent
dce5f4de
Modified ontime value in ctmodel (#2147)
Changed the on time for a given bin to be set from the observation being filled into the cube rather than the cube itself. Reformat code (#2147)
Showing
2 changed files
with
3 additions
and
7 deletions
src/ctmodel/ctmodel.cpp
| @@ -405,7 +405,6 @@ void ctmodel::init_members(void) | @@ -405,7 +405,6 @@ void ctmodel::init_members(void) | ||
| 405 | m_energy.clear(); | 405 | m_energy.clear(); |
| 406 | m_ewidth.clear(); | 406 | m_ewidth.clear(); |
| 407 | m_time.clear(); | 407 | m_time.clear(); |
| 408 | - m_ontime = 0.0; | ||
| 409 | 408 | ||
| 410 | // Return | 409 | // Return |
| 411 | return; | 410 | return; |
| @@ -436,7 +435,6 @@ void ctmodel::copy_members(const ctmodel& app) | @@ -436,7 +435,6 @@ void ctmodel::copy_members(const ctmodel& app) | ||
| 436 | m_energy = app.m_energy; | 435 | m_energy = app.m_energy; |
| 437 | m_ewidth = app.m_ewidth; | 436 | m_ewidth = app.m_ewidth; |
| 438 | m_time = app.m_time; | 437 | m_time = app.m_time; |
| 439 | - m_ontime = app.m_ontime; | ||
| 440 | 438 | ||
| 441 | // Return | 439 | // Return |
| 442 | return; | 440 | return; |
| @@ -773,9 +771,8 @@ void ctmodel::extract_cube_properties(void) | @@ -773,9 +771,8 @@ void ctmodel::extract_cube_properties(void) | ||
| 773 | 771 | ||
| 774 | } // endfor: looped over spectral bins | 772 | } // endfor: looped over spectral bins |
| 775 | 773 | ||
| 776 | - // Set time and ontime | ||
| 777 | - m_time = m_cube[0]->time(); | ||
| 778 | - m_ontime = m_cube[0]->ontime(); | 774 | + // Set time |
| 775 | + m_time = m_cube[0]->time(); | ||
| 779 | 776 | ||
| 780 | // Return | 777 | // Return |
| 781 | return; | 778 | return; |
| @@ -832,7 +829,7 @@ void ctmodel::fill_cube(const GCTAObservation* obs) | @@ -832,7 +829,7 @@ void ctmodel::fill_cube(const GCTAObservation* obs) | ||
| 832 | 829 | ||
| 833 | // Set event bin attributes that are constant for a counts cube | 830 | // Set event bin attributes that are constant for a counts cube |
| 834 | bin.time(m_time); | 831 | bin.time(m_time); |
| 835 | - bin.ontime(m_ontime); | 832 | + bin.ontime(obs->ontime()); |
| 836 | bin.weight(1.0); | 833 | bin.weight(1.0); |
| 837 | 834 | ||
| 838 | // Loop over all the spatial bins | 835 | // Loop over all the spatial bins |
src/ctmodel/ctmodel.hpp
| @@ -100,7 +100,6 @@ protected: | @@ -100,7 +100,6 @@ protected: | ||
| 100 | std::vector<GEnergy> m_energy; //!< Cube energies | 100 | std::vector<GEnergy> m_energy; //!< Cube energies |
| 101 | std::vector<GEnergy> m_ewidth; //!< Cube energy widths | 101 | std::vector<GEnergy> m_ewidth; //!< Cube energy widths |
| 102 | GTime m_time; //!< Cube time | 102 | GTime m_time; //!< Cube time |
| 103 | - double m_ontime; //!< Cube ontime | ||
| 104 | }; | 103 | }; |
| 105 | 104 | ||
| 106 | 105 |