Commit 974973c02bfcb535a1d74717c7ad92185ba2e1f5

Authored by knodlseder
1 parent b4f2d809

add FITS file logging

Showing 1 changed file with 20 additions and 2 deletions
src/ctselect/ctselect.cpp
... ... @@ -210,10 +210,17 @@ void ctselect::select(void)
210 210 expression += "[EVENTS]["+selection+"]";
211 211 if (logTerse())
212 212 log << " FITS filename .............: " << expression << std::endl;
213   -
  213 +
214 214 // Open FITS file
215 215 GFits file(expression);
216 216  
  217 + // Log selected FITS file
  218 + if (logExplicit()) {
  219 + log << std::endl;
  220 + log.header1("FITS file content after selection");
  221 + log << file << std::endl;
  222 + }
  223 +
217 224 // Save output FITS file
218 225 file.saveto(m_outfile, clobber());
219 226  
... ... @@ -240,9 +247,20 @@ void ctselect::append_gti(void)
240 247 tstop.met(m_tmax);
241 248 gti.add(tstart, tstop);
242 249  
243   - // Save GTI
  250 + // Re-open FITS file
244 251 GFits file(m_outfile);
  252 +
  253 + // Write GTI
245 254 gti.write(&file);
  255 +
  256 + // Log final FITS file
  257 + if (logExplicit()) {
  258 + log << std::endl;
  259 + log.header1("Final FITS file content");
  260 + log << file << std::endl;
  261 + }
  262 +
  263 + // Save and close file
246 264 file.save();
247 265 file.close();
248 266  
... ...