diff --git a/src/ctbin/ctbin.cpp b/src/ctbin/ctbin.cpp index b25cbbf..3de0bd9 100644 --- a/src/ctbin/ctbin.cpp +++ b/src/ctbin/ctbin.cpp @@ -101,6 +101,10 @@ ctbin::~ctbin(void) ***************************************************************************/ void ctbin::run(void) { + // Switch screen logging on in debug mode + if (logDebug()) + log.cout(true); + // Get parameters get_parameters(); diff --git a/src/ctbin/ctbin.hpp b/src/ctbin/ctbin.hpp index 12a631a..71c4ffd 100644 --- a/src/ctbin/ctbin.hpp +++ b/src/ctbin/ctbin.hpp @@ -25,7 +25,7 @@ /* __Definitions _________________________________________________________ */ #define CTBIN_NAME "ctbin" -#define CTBIN_VERSION "v1r0p0" +#define CTBIN_VERSION "00-01-00" /***********************************************************************//** diff --git a/src/ctlike/ctlike.cpp b/src/ctlike/ctlike.cpp index 338cde0..2c2e9b4 100644 --- a/src/ctlike/ctlike.cpp +++ b/src/ctlike/ctlike.cpp @@ -104,7 +104,10 @@ ctlike::~ctlike(void) ***************************************************************************/ void ctlike::run(void) { - log.cout(true); + // Switch screen logging on in debug mode + if (logDebug()) + log.cout(true); + // Get parameters get_parameters(); @@ -304,7 +307,7 @@ void ctlike::init_members(void) m_outmdl.clear(); m_models.clear(); m_obs.clear(); - m_max_iter = 1000; + m_max_iter = 100; m_logL = 0.0; m_opt = NULL; diff --git a/src/ctlike/ctlike.hpp b/src/ctlike/ctlike.hpp index 098529c..99834ed 100644 --- a/src/ctlike/ctlike.hpp +++ b/src/ctlike/ctlike.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctlike - CTA maximum likelihood tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010 by Jurgen Knodlseder * + * copyright (C) 2010-2011 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software; you can redistribute it and/or modify * @@ -26,7 +26,7 @@ /* __Definitions _________________________________________________________ */ #define CTLIKE_NAME "ctlike" -#define CTLIKE_VERSION "v1r0p0" +#define CTLIKE_VERSION "00-01-00" /***********************************************************************//** diff --git a/src/ctobssim/ctobssim.cpp b/src/ctobssim/ctobssim.cpp index b7573a0..c45c1f7 100644 --- a/src/ctobssim/ctobssim.cpp +++ b/src/ctobssim/ctobssim.cpp @@ -101,6 +101,10 @@ ctobssim::~ctobssim(void) ***************************************************************************/ void ctobssim::run(void) { + // Switch screen logging on in debug mode + if (logDebug()) + log.cout(true); + // Get parameters get_parameters(); diff --git a/src/ctobssim/ctobssim.hpp b/src/ctobssim/ctobssim.hpp index 37f0d93..31b26e0 100644 --- a/src/ctobssim/ctobssim.hpp +++ b/src/ctobssim/ctobssim.hpp @@ -25,7 +25,7 @@ /* __Definitions _________________________________________________________ */ #define CTOBSSIM_NAME "ctobssim" -#define CTOBSSIM_VERSION "v1r0p0" +#define CTOBSSIM_VERSION "00-01-00" /***********************************************************************//** diff --git a/src/ctselect/ctselect.cpp b/src/ctselect/ctselect.cpp index be3a4a8..ab0ae7d 100644 --- a/src/ctselect/ctselect.cpp +++ b/src/ctselect/ctselect.cpp @@ -109,6 +109,10 @@ ctselect::~ctselect(void) ***************************************************************************/ void ctselect::run(void) { + // Switch screen logging on in debug mode + if (logDebug()) + log.cout(true); + // Get parameters get_parameters(); @@ -237,21 +241,48 @@ void ctselect::select(void) /***********************************************************************//** * @brief Append GTI to FITS file + * + * @todo We implement here a dummy method that overwrites an existing GTI + * entry but that only works if a single time interval exists. This + * is not clean, but since we have no method so far that allows + * deleting a HDU from a FITS file we have no other choice. Ideally, + * we would like to first delete an existing HDU and then append + * a new one. If this is not possible, we would like to delete the + * rows from an existing GTI and then fill it up anew. But in any + * case, the actual data selection method does not check the + * existing GTI, which we have to do to merge any subselection + * information in. In fact, we need a GTI merge method as well ... ***************************************************************************/ void ctselect::append_gti(void) { - // Allocate Gti - GGti gti; - - // Setup single GTI covering the selected time range + // Setup selected time range GTime tstart; GTime tstop; tstart.met(m_tmin); tstop.met(m_tmax); - gti.add(tstart, tstop); - // Write GTI - gti.write(&m_file); + // Initialise empty GTI table HDU + GFitsTable* hdu = NULL; + + // Write selected time interval, either in an existing GTI or in a new + // GTI that is appended to the FITS file + try { + hdu = m_file.table("GTI"); + GFitsTableDoubleCol* start = (GFitsTableDoubleCol*)hdu->column("START"); + GFitsTableDoubleCol* stop = (GFitsTableDoubleCol*)hdu->column("STOP"); + (*start)(0) = tstart.met(); + (*stop)(0) = tstop.met(); + } + catch (GException::fits_hdu_not_found) { + // Allocate Gti + GGti gti; + + // Setup single GTI covering the selected time range + gti.add(tstart, tstop); + + // Write GTI + gti.write(&m_file); + } // Log final FITS file if (logExplicit()) { diff --git a/src/ctselect/ctselect.hpp b/src/ctselect/ctselect.hpp index 2b3687f..04f4235 100644 --- a/src/ctselect/ctselect.hpp +++ b/src/ctselect/ctselect.hpp @@ -24,7 +24,7 @@ /* __Definitions _________________________________________________________ */ #define CTSELECT_NAME "ctselect" -#define CTSELECT_VERSION "v1r0p0" +#define CTSELECT_VERSION "00-01-00" /***********************************************************************//**