From 4b010e1f74cba16404bdd8bb1729f658a0edc18d Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 11 Sep 2018 22:40:05 +0200 Subject: [PATCH] Correct DEFAULT energy threshold handling in ctselect --- src/ctselect/ctselect.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ctselect/ctselect.cpp b/src/ctselect/ctselect.cpp index 408df14..a5a690b 100755 --- a/src/ctselect/ctselect.cpp +++ b/src/ctselect/ctselect.cpp @@ -561,11 +561,15 @@ void ctselect::get_parameters(void) get_gti(GTimeReference()); // Get energy selection parameters + m_usethres = (*this)["usethres"].string(); if ((*this)["emin"].is_valid() && (*this)["emax"].is_valid()) { m_emin = (*this)["emin"].real(); m_emax = (*this)["emax"].real(); m_select_energy = true; } + else if ((m_usethres == "DEFAULT") || (m_usethres == "USER")) { + m_select_energy = true; + } // Get phase selection string std::string phase_expr = gammalib::strip_whitespace(gammalib::tolower( @@ -645,9 +649,8 @@ void ctselect::get_parameters(void) } // endif: phase selection parameters were valid // Get other User parameters - m_expr = (*this)["expr"].string(); - m_usethres = (*this)["usethres"].string(); - m_chatter = static_cast((*this)["chatter"].integer()); + m_expr = (*this)["expr"].string(); + m_chatter = static_cast((*this)["chatter"].integer()); // If needed later, query output filename and prefix now if (read_ahead()) { @@ -1081,11 +1084,6 @@ void ctselect::select_events(GCTAObservation* obs, list->ebounds(ebounds); } - // ... otherwise set new boundaries - else if (ebounds.size() > 0) { - list->ebounds(ebounds); - } - // ... otherwise restore old Ebounds if they existed else if (old_ebounds.size() > 0) { list->ebounds(old_ebounds); -- libgit2 0.21.4