diff --git a/src/ctfindvar/ctfindvar.cpp b/src/ctfindvar/ctfindvar.cpp index 03ebdcb..dbb97ca 100644 --- a/src/ctfindvar/ctfindvar.cpp +++ b/src/ctfindvar/ctfindvar.cpp @@ -312,51 +312,6 @@ void ctfindvar::save(void) } -/***********************************************************************//** - * @brief Get the map index associated with a given time - * - * @param[in] time Time - * @return Index of map in counts cube - ***************************************************************************/ -int ctfindvar::time2inx(const GTime& time) -{ - // Set default return value - int map_index = -1; - - // Loop over all GTIs - for (int i = 0; i < m_gti.size(); ++i) { - - // If interval contains the time then break - if (m_gti[i].contains(time)) { - map_index = i; - break; - } - - } - - // Return map index - return map_index; -} - - -/***********************************************************************//** - * @brief Return Good Time Interval for index - * - * @param[in] index Index - * @return Good Time Interval - ***************************************************************************/ -GGti ctfindvar::inx2gti(const int& index) -{ - // Throw an exception if index is invalid - if ((index < 0) || (index >= m_gti.size())) { - throw GException::out_of_range(G_INX2GTI, "Time index", index, m_gti.size()); - } - - // Return Good Time Interval - return m_gti[index]; -} - - /*========================================================================== = = = Private methods = @@ -1428,3 +1383,30 @@ void ctfindvar::write_source_histograms(GFits& fits) // Return return; } + + +/***********************************************************************//** + * @brief Get the map index associated with a given time + * + * @param[in] time Time + * @return Index of map in counts cube + ***************************************************************************/ +int ctfindvar::time2inx(const GTime& time) const +{ + // Set default return value + int map_index = -1; + + // Loop over all GTIs + for (int i = 0; i < m_gti.size(); ++i) { + + // If interval contains the time then break + if (m_gti[i].contains(time)) { + map_index = i; + break; + } + + } + + // Return map index + return map_index; +} diff --git a/src/ctfindvar/ctfindvar.hpp b/src/ctfindvar/ctfindvar.hpp index 08c18ab..6e4ffff 100644 --- a/src/ctfindvar/ctfindvar.hpp +++ b/src/ctfindvar/ctfindvar.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctfindvar - Time variability search tool * * ----------------------------------------------------------------------- * - * copyright (C) 2018 by Simon Bonnefoy * + * copyright (C) 2018-2019 by Simon Bonnefoy * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -61,11 +61,6 @@ public: void run(void); void save(void); - // Get the information on the time interval from - int time2inx(const GTime& time); - GGti inx2gti(const int& indx); - const GSkyMap& counts(void); - protected: // Protected methods void init_members(void); @@ -84,6 +79,7 @@ protected: GTime get_tstop(void); GModelSky sky_model(const GSkyDir& dir) const; void write_source_histograms(GFits& fits); + int time2inx(const GTime& time) const; // Protected members GSkyMap m_counts; //!< Counts for each time interval @@ -103,17 +99,4 @@ protected: }; - -/***********************************************************************//** - * @brief Return reference to significance cube object - * - * @return Reference to counts cube - ***************************************************************************/ -inline -const GSkyMap& ctfindvar::counts(void) -{ - return m_counts; -} - - #endif /* CTFINDVAR_HPP */