Commit 9607591fc0f7407264331f4696864b1c154d232c
1 parent
d532b581
Remove ctfindvar::inx2gti() and ctfindvar::counts() methods and declare ctfindva…
…r::time2inx2() private
Showing
2 changed files
with
29 additions
and
64 deletions
src/ctfindvar/ctfindvar.cpp
| @@ -312,51 +312,6 @@ void ctfindvar::save(void) | @@ -312,51 +312,6 @@ void ctfindvar::save(void) | ||
| 312 | } | 312 | } |
| 313 | 313 | ||
| 314 | 314 | ||
| 315 | -/***********************************************************************//** | ||
| 316 | - * @brief Get the map index associated with a given time | ||
| 317 | - * | ||
| 318 | - * @param[in] time Time | ||
| 319 | - * @return Index of map in counts cube | ||
| 320 | - ***************************************************************************/ | ||
| 321 | -int ctfindvar::time2inx(const GTime& time) | ||
| 322 | -{ | ||
| 323 | - // Set default return value | ||
| 324 | - int map_index = -1; | ||
| 325 | - | ||
| 326 | - // Loop over all GTIs | ||
| 327 | - for (int i = 0; i < m_gti.size(); ++i) { | ||
| 328 | - | ||
| 329 | - // If interval contains the time then break | ||
| 330 | - if (m_gti[i].contains(time)) { | ||
| 331 | - map_index = i; | ||
| 332 | - break; | ||
| 333 | - } | ||
| 334 | - | ||
| 335 | - } | ||
| 336 | - | ||
| 337 | - // Return map index | ||
| 338 | - return map_index; | ||
| 339 | -} | ||
| 340 | - | ||
| 341 | - | ||
| 342 | -/***********************************************************************//** | ||
| 343 | - * @brief Return Good Time Interval for index | ||
| 344 | - * | ||
| 345 | - * @param[in] index Index | ||
| 346 | - * @return Good Time Interval | ||
| 347 | - ***************************************************************************/ | ||
| 348 | -GGti ctfindvar::inx2gti(const int& index) | ||
| 349 | -{ | ||
| 350 | - // Throw an exception if index is invalid | ||
| 351 | - if ((index < 0) || (index >= m_gti.size())) { | ||
| 352 | - throw GException::out_of_range(G_INX2GTI, "Time index", index, m_gti.size()); | ||
| 353 | - } | ||
| 354 | - | ||
| 355 | - // Return Good Time Interval | ||
| 356 | - return m_gti[index]; | ||
| 357 | -} | ||
| 358 | - | ||
| 359 | - | ||
| 360 | /*========================================================================== | 315 | /*========================================================================== |
| 361 | = = | 316 | = = |
| 362 | = Private methods = | 317 | = Private methods = |
| @@ -1428,3 +1383,30 @@ void ctfindvar::write_source_histograms(GFits& fits) | @@ -1428,3 +1383,30 @@ void ctfindvar::write_source_histograms(GFits& fits) | ||
| 1428 | // Return | 1383 | // Return |
| 1429 | return; | 1384 | return; |
| 1430 | } | 1385 | } |
| 1386 | + | ||
| 1387 | + | ||
| 1388 | +/***********************************************************************//** | ||
| 1389 | + * @brief Get the map index associated with a given time | ||
| 1390 | + * | ||
| 1391 | + * @param[in] time Time | ||
| 1392 | + * @return Index of map in counts cube | ||
| 1393 | + ***************************************************************************/ | ||
| 1394 | +int ctfindvar::time2inx(const GTime& time) const | ||
| 1395 | +{ | ||
| 1396 | + // Set default return value | ||
| 1397 | + int map_index = -1; | ||
| 1398 | + | ||
| 1399 | + // Loop over all GTIs | ||
| 1400 | + for (int i = 0; i < m_gti.size(); ++i) { | ||
| 1401 | + | ||
| 1402 | + // If interval contains the time then break | ||
| 1403 | + if (m_gti[i].contains(time)) { | ||
| 1404 | + map_index = i; | ||
| 1405 | + break; | ||
| 1406 | + } | ||
| 1407 | + | ||
| 1408 | + } | ||
| 1409 | + | ||
| 1410 | + // Return map index | ||
| 1411 | + return map_index; | ||
| 1412 | +} |
src/ctfindvar/ctfindvar.hpp
| 1 | /*************************************************************************** | 1 | /*************************************************************************** |
| 2 | * ctfindvar - Time variability search tool * | 2 | * ctfindvar - Time variability search tool * |
| 3 | * ----------------------------------------------------------------------- * | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2018 by Simon Bonnefoy * | 4 | + * copyright (C) 2018-2019 by Simon Bonnefoy * |
| 5 | * ----------------------------------------------------------------------- * | 5 | * ----------------------------------------------------------------------- * |
| 6 | * * | 6 | * * |
| 7 | * This program is free software: you can redistribute it and/or modify * | 7 | * This program is free software: you can redistribute it and/or modify * |
| @@ -61,11 +61,6 @@ public: | @@ -61,11 +61,6 @@ public: | ||
| 61 | void run(void); | 61 | void run(void); |
| 62 | void save(void); | 62 | void save(void); |
| 63 | 63 | ||
| 64 | - // Get the information on the time interval from | ||
| 65 | - int time2inx(const GTime& time); | ||
| 66 | - GGti inx2gti(const int& indx); | ||
| 67 | - const GSkyMap& counts(void); | ||
| 68 | - | ||
| 69 | protected: | 64 | protected: |
| 70 | // Protected methods | 65 | // Protected methods |
| 71 | void init_members(void); | 66 | void init_members(void); |
| @@ -84,6 +79,7 @@ protected: | @@ -84,6 +79,7 @@ protected: | ||
| 84 | GTime get_tstop(void); | 79 | GTime get_tstop(void); |
| 85 | GModelSky sky_model(const GSkyDir& dir) const; | 80 | GModelSky sky_model(const GSkyDir& dir) const; |
| 86 | void write_source_histograms(GFits& fits); | 81 | void write_source_histograms(GFits& fits); |
| 82 | + int time2inx(const GTime& time) const; | ||
| 87 | 83 | ||
| 88 | // Protected members | 84 | // Protected members |
| 89 | GSkyMap m_counts; //!< Counts for each time interval | 85 | GSkyMap m_counts; //!< Counts for each time interval |
| @@ -103,17 +99,4 @@ protected: | @@ -103,17 +99,4 @@ protected: | ||
| 103 | 99 | ||
| 104 | }; | 100 | }; |
| 105 | 101 | ||
| 106 | - | ||
| 107 | -/***********************************************************************//** | ||
| 108 | - * @brief Return reference to significance cube object | ||
| 109 | - * | ||
| 110 | - * @return Reference to counts cube | ||
| 111 | - ***************************************************************************/ | ||
| 112 | -inline | ||
| 113 | -const GSkyMap& ctfindvar::counts(void) | ||
| 114 | -{ | ||
| 115 | - return m_counts; | ||
| 116 | -} | ||
| 117 | - | ||
| 118 | - | ||
| 119 | #endif /* CTFINDVAR_HPP */ | 102 | #endif /* CTFINDVAR_HPP */ |