Commit 0e71f297f3c2fe0ed7cffb654b21150d483c6e1c

Authored by Jürgen Knödlseder
1 parent 82b798be

Integrate code.

inst/cta/include/GCTAAeff2D.hpp
@@ -76,7 +76,7 @@ public: @@ -76,7 +76,7 @@ public:
76 const GCTAResponseTable& table(void) const; 76 const GCTAResponseTable& table(void) const;
77 void table(const GCTAResponseTable& table); 77 void table(const GCTAResponseTable& table);
78 void read(const GFitsTable& table); 78 void read(const GFitsTable& table);
79 - void write(GFitsBinTable& hdu) const; 79 + void write(GFitsBinTable& table) const;
80 void save(const std::string& filename, 80 void save(const std::string& filename,
81 const bool& clobber = false) const; 81 const bool& clobber = false) const;
82 82
inst/cta/include/GCTAAeffArf.hpp
@@ -85,7 +85,7 @@ public: @@ -85,7 +85,7 @@ public:
85 const double& thetacut(void) const; 85 const double& thetacut(void) const;
86 void scale(const double& scale); 86 void scale(const double& scale);
87 const double& scale(void) const; 87 const double& scale(void) const;
88 - void read(const GFitsTable& hdu); 88 + void read(const GFitsTable& table);
89 void remove_thetacut(const GCTAResponseIrf& rsp); 89 void remove_thetacut(const GCTAResponseIrf& rsp);
90 90
91 private: 91 private:
inst/cta/include/GCTABackground3D.hpp
@@ -76,7 +76,7 @@ public: @@ -76,7 +76,7 @@ public:
76 const GCTAResponseTable& table(void) const; 76 const GCTAResponseTable& table(void) const;
77 void table(const GCTAResponseTable& table); 77 void table(const GCTAResponseTable& table);
78 void read(const GFitsTable& table); 78 void read(const GFitsTable& table);
79 - void write(GFitsBinTable& hdu) const; 79 + void write(GFitsBinTable& table) const;
80 void save(const std::string& filename, 80 void save(const std::string& filename,
81 const bool& clobber = false) const; 81 const bool& clobber = false) const;
82 82
inst/cta/include/GCTAEdisp2D.hpp
@@ -92,7 +92,7 @@ public: @@ -92,7 +92,7 @@ public:
92 const GCTAResponseTable& table(void) const; 92 const GCTAResponseTable& table(void) const;
93 void table(const GCTAResponseTable& table); 93 void table(const GCTAResponseTable& table);
94 void read(const GFitsTable& table); 94 void read(const GFitsTable& table);
95 - void write(GFitsBinTable& hdu) const; 95 + void write(GFitsBinTable& table) const;
96 void save(const std::string& filename, 96 void save(const std::string& filename,
97 const bool& clobber = false) const; 97 const bool& clobber = false) const;
98 private: 98 private:
inst/cta/include/GCTAPsf2D.hpp
@@ -97,7 +97,7 @@ public: @@ -97,7 +97,7 @@ public:
97 const GCTAResponseTable& table(void) const; 97 const GCTAResponseTable& table(void) const;
98 void table(const GCTAResponseTable& table); 98 void table(const GCTAResponseTable& table);
99 void read(const GFitsTable& table); 99 void read(const GFitsTable& table);
100 - void write(GFitsBinTable& hdu) const; 100 + void write(GFitsBinTable& table) const;
101 void save(const std::string& filename, 101 void save(const std::string& filename,
102 const bool& clobber = false) const; 102 const bool& clobber = false) const;
103 103
inst/cta/include/GCTAPsfKing.hpp
@@ -95,7 +95,7 @@ public: @@ -95,7 +95,7 @@ public:
95 const GCTAResponseTable& table(void) const; 95 const GCTAResponseTable& table(void) const;
96 void table(const GCTAResponseTable& table); 96 void table(const GCTAResponseTable& table);
97 void read(const GFitsTable& table); 97 void read(const GFitsTable& table);
98 - void write(GFitsBinTable& hdu) const; 98 + void write(GFitsBinTable& table) const;
99 void save(const std::string& filename, 99 void save(const std::string& filename,
100 const bool& clobber = false) const; 100 const bool& clobber = false) const;
101 101
inst/cta/pyext/GCTAAeff2D.i
@@ -67,7 +67,7 @@ public: @@ -67,7 +67,7 @@ public:
67 const GCTAResponseTable& table(void) const; 67 const GCTAResponseTable& table(void) const;
68 void table(const GCTAResponseTable& table); 68 void table(const GCTAResponseTable& table);
69 void read(const GFitsTable& table); 69 void read(const GFitsTable& table);
70 - void write(GFitsBinTable& hdu) const; 70 + void write(GFitsBinTable& table) const;
71 void save(const std::string& filename, 71 void save(const std::string& filename,
72 const bool& clobber = false) const; 72 const bool& clobber = false) const;
73 }; 73 };
inst/cta/pyext/GCTAAeffArf.i
@@ -71,7 +71,7 @@ public: @@ -71,7 +71,7 @@ public:
71 const double& thetacut(void) const; 71 const double& thetacut(void) const;
72 void scale(const double& scale); 72 void scale(const double& scale);
73 const double& scale(void) const; 73 const double& scale(void) const;
74 - void read(const GFitsTable& hdu); 74 + void read(const GFitsTable& table);
75 void remove_thetacut(const GCTAResponseIrf& rsp); 75 void remove_thetacut(const GCTAResponseIrf& rsp);
76 }; 76 };
77 77
inst/cta/pyext/GCTABackground3D.i
@@ -64,7 +64,7 @@ public: @@ -64,7 +64,7 @@ public:
64 const GCTAResponseTable& table(void) const; 64 const GCTAResponseTable& table(void) const;
65 void table(const GCTAResponseTable& table); 65 void table(const GCTAResponseTable& table);
66 void read(const GFitsTable& table); 66 void read(const GFitsTable& table);
67 - void write(GFitsBinTable& hdu) const; 67 + void write(GFitsBinTable& table) const;
68 void save(const std::string& filename, 68 void save(const std::string& filename,
69 const bool& clobber = false) const; 69 const bool& clobber = false) const;
70 }; 70 };
inst/cta/pyext/GCTAEdisp2D.i
@@ -78,7 +78,7 @@ public: @@ -78,7 +78,7 @@ public:
78 const GCTAResponseTable& table(void) const; 78 const GCTAResponseTable& table(void) const;
79 void table(const GCTAResponseTable& table); 79 void table(const GCTAResponseTable& table);
80 void read(const GFitsTable& table); 80 void read(const GFitsTable& table);
81 - void write(GFitsBinTable& hdu) const; 81 + void write(GFitsBinTable& table) const;
82 void save(const std::string& filename, 82 void save(const std::string& filename,
83 const bool& clobber = false) const; 83 const bool& clobber = false) const;
84 }; 84 };
inst/cta/pyext/GCTAPsf2D.i
@@ -83,7 +83,7 @@ public: @@ -83,7 +83,7 @@ public:
83 const GCTAResponseTable& table(void) const; 83 const GCTAResponseTable& table(void) const;
84 void table(const GCTAResponseTable& table); 84 void table(const GCTAResponseTable& table);
85 void read(const GFitsTable& table); 85 void read(const GFitsTable& table);
86 - void write(GFitsBinTable& hdu) const; 86 + void write(GFitsBinTable& table) const;
87 void save(const std::string& filename, 87 void save(const std::string& filename,
88 const bool& clobber = false) const; 88 const bool& clobber = false) const;
89 89
inst/cta/pyext/GCTAPsfKing.i
@@ -85,7 +85,7 @@ public: @@ -85,7 +85,7 @@ public:
85 const GCTAResponseTable& table(void) const; 85 const GCTAResponseTable& table(void) const;
86 void table(const GCTAResponseTable& table); 86 void table(const GCTAResponseTable& table);
87 void read(const GFitsTable& table); 87 void read(const GFitsTable& table);
88 - void write(GFitsBinTable& hdu) const; 88 + void write(GFitsBinTable& table) const;
89 void save(const std::string& filename, 89 void save(const std::string& filename,
90 const bool& clobber = false) const; 90 const bool& clobber = false) const;
91 }; 91 };
inst/cta/src/GCTAAeff2D.cpp
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 #include "GCTAAeff2D.hpp" 37 #include "GCTAAeff2D.hpp"
38 38
39 /* __ Method name definitions ____________________________________________ */ 39 /* __ Method name definitions ____________________________________________ */
40 -#define G_READ "GCTAAeff2D::read(GFitsTable&)" 40 +#define G_READ "GCTAAeff2D::read(GFitsTable&)"
41 41
42 /* __ Macros _____________________________________________________________ */ 42 /* __ Macros _____________________________________________________________ */
43 43
@@ -72,8 +72,7 @@ GCTAAeff2D::GCTAAeff2D(void) : GCTAAeff() @@ -72,8 +72,7 @@ GCTAAeff2D::GCTAAeff2D(void) : GCTAAeff()
72 * 72 *
73 * @param[in] filename FITS file name. 73 * @param[in] filename FITS file name.
74 * 74 *
75 - * Construct instance by loading the effective area information from a FITS  
76 - * file. 75 + * Constructs effective area from a FITS file.
77 ***************************************************************************/ 76 ***************************************************************************/
78 GCTAAeff2D::GCTAAeff2D(const std::string& filename) : GCTAAeff() 77 GCTAAeff2D::GCTAAeff2D(const std::string& filename) : GCTAAeff()
79 { 78 {
@@ -238,12 +237,13 @@ GCTAAeff2D* GCTAAeff2D::clone(void) const @@ -238,12 +237,13 @@ GCTAAeff2D* GCTAAeff2D::clone(void) const
238 /***********************************************************************//** 237 /***********************************************************************//**
239 * @brief Read effective area from FITS table 238 * @brief Read effective area from FITS table
240 * 239 *
241 - * @param[in] table FITS table pointer. 240 + * @param[in] table FITS table.
242 * 241 *
243 * @exception GException::invalid_value 242 * @exception GException::invalid_value
244 * FITS file format differs from expectation. 243 * FITS file format differs from expectation.
245 * 244 *
246 - * Reads the effective area form the FITS table. 245 + * Reads the effective area form the FITS @p table.
  246 + *
247 * The data are stored in m_aeff which is of type GCTAResponseTable. The 247 * The data are stored in m_aeff which is of type GCTAResponseTable. The
248 * energy axis will be set to log10, the offset angle axis to radians. 248 * energy axis will be set to log10, the offset angle axis to radians.
249 ***************************************************************************/ 249 ***************************************************************************/
@@ -287,23 +287,25 @@ void GCTAAeff2D::read(const GFitsTable& table) @@ -287,23 +287,25 @@ void GCTAAeff2D::read(const GFitsTable& table)
287 287
288 288
289 /***********************************************************************//** 289 /***********************************************************************//**
290 - * @brief Write CTA effective area table into FITS binary table object. 290 + * @brief Write effective area into FITS binary table
  291 + *
  292 + * @param[in] table FITS binary table.
291 * 293 *
292 - * @param[in] hdu FITS binary table. 294 + * Writes effective area into the FITS binary @p table.
293 * 295 *
294 - * @todo Add necessary keywords. 296 + * @todo Add keywords.
295 ***************************************************************************/ 297 ***************************************************************************/
296 -void GCTAAeff2D::write(GFitsBinTable& hdu) const 298 +void GCTAAeff2D::write(GFitsBinTable& table) const
297 { 299 {
298 // Create a copy of the response table 300 // Create a copy of the response table
299 - GCTAResponseTable table(m_aeff); 301 + GCTAResponseTable aeff(m_aeff);
300 302
301 // Convert area from cm2 to m2 303 // Convert area from cm2 to m2
302 - table.scale(0, 1.0e-4);  
303 - table.scale(1, 1.0e-4); 304 + aeff.scale(0, 1.0e-4);
  305 + aeff.scale(1, 1.0e-4);
304 306
305 // Write response table 307 // Write response table
306 - table.write(hdu); 308 + aeff.write(table);
307 309
308 // Return 310 // Return
309 return; 311 return;
@@ -313,9 +315,12 @@ void GCTAAeff2D::write(GFitsBinTable& hdu) const @@ -313,9 +315,12 @@ void GCTAAeff2D::write(GFitsBinTable& hdu) const
313 /***********************************************************************//** 315 /***********************************************************************//**
314 * @brief Load effective area from FITS file 316 * @brief Load effective area from FITS file
315 * 317 *
316 - * @param[in] filename FITS file. 318 + * @param[in] filename FITS file name.
  319 + *
  320 + * Loads the effective area from a FITS file.
317 * 321 *
318 - * This method loads the effective area information from a FITS file. 322 + * If no extension name is provided, the effective area will be loaded from
  323 + * the "EFFECTIVE AREA" extension.
319 ***************************************************************************/ 324 ***************************************************************************/
320 void GCTAAeff2D::load(const std::string& filename) 325 void GCTAAeff2D::load(const std::string& filename)
321 { 326 {
@@ -343,12 +348,15 @@ void GCTAAeff2D::load(const std::string& filename) @@ -343,12 +348,15 @@ void GCTAAeff2D::load(const std::string& filename)
343 348
344 349
345 /***********************************************************************//** 350 /***********************************************************************//**
346 - * @brief Save effectiva area table into FITS file 351 + * @brief Save effectiva area into FITS file
  352 + *
  353 + * @param[in] filename FITS file name.
  354 + * @param[in] clobber Overwrite existing file? (default: false)
347 * 355 *
348 - * @param[in] filename Effective area table FITS file name.  
349 - * @param[in] clobber Overwrite existing file? (true=yes) 356 + * Save the effectiva area into a FITS file.
350 * 357 *
351 - * Save the effectiva area table into a FITS file. 358 + * If no extension name is provided, the effective area will be saved into
  359 + * the "EFFECTIVE AREA" extension.
352 ***************************************************************************/ 360 ***************************************************************************/
353 void GCTAAeff2D::save(const std::string& filename, const bool& clobber) const 361 void GCTAAeff2D::save(const std::string& filename, const bool& clobber) const
354 { 362 {
inst/cta/src/GCTAAeffArf.cpp
@@ -75,8 +75,7 @@ GCTAAeffArf::GCTAAeffArf(void) : GCTAAeff() @@ -75,8 +75,7 @@ GCTAAeffArf::GCTAAeffArf(void) : GCTAAeff()
75 * 75 *
76 * @param[in] filename ARF FITS file name. 76 * @param[in] filename ARF FITS file name.
77 * 77 *
78 - * Construct instance by loading the effective area information from an  
79 - * ARF FITS file. 78 + * Constructs effective area from an ARF FITS file.
80 ***************************************************************************/ 79 ***************************************************************************/
81 GCTAAeffArf::GCTAAeffArf(const std::string& filename) : GCTAAeff() 80 GCTAAeffArf::GCTAAeffArf(const std::string& filename) : GCTAAeff()
82 { 81 {
@@ -239,12 +238,14 @@ GCTAAeffArf* GCTAAeffArf::clone(void) const @@ -239,12 +238,14 @@ GCTAAeffArf* GCTAAeffArf::clone(void) const
239 238
240 239
241 /***********************************************************************//** 240 /***********************************************************************//**
242 - * @brief Load effective area from performance table 241 + * @brief Load effective area from ARF FITS file
243 * 242 *
244 - * @param[in] filename Performance table file name. 243 + * @param[in] filename ARF FITS file name.
  244 + *
  245 + * Loads the effective area from an ARF FITS file.
245 * 246 *
246 - * This method loads the effective area information from an ASCII  
247 - * performance table. 247 + * If no extension name is provided, the effective area will be loaded from
  248 + * the "SPECRESP" extension.
248 ***************************************************************************/ 249 ***************************************************************************/
249 void GCTAAeffArf::load(const std::string& filename) 250 void GCTAAeffArf::load(const std::string& filename)
250 { 251 {
@@ -274,11 +275,12 @@ void GCTAAeffArf::load(const std::string& filename) @@ -274,11 +275,12 @@ void GCTAAeffArf::load(const std::string& filename)
274 /***********************************************************************//** 275 /***********************************************************************//**
275 * @brief Read CTA ARF vector 276 * @brief Read CTA ARF vector
276 * 277 *
277 - * @param[in] hdu FITS table. 278 + * @param[in] table FITS table.
  279 + *
  280 + * Reads a CTA ARF vector from the FITS @p table.
278 * 281 *
279 - * This method reads a CTA ARF vector from the FITS HDU. Note that the  
280 - * energies are converted to TeV and the effective area is converted to cm2.  
281 - * Conversion is done based on the units provided for the energy and 282 + * The energies are converted to TeV and the effective area is converted to
  283 + * cm2. Conversion is done based on the units provided for the energy and
282 * effective area columns. Units that are recognized are 'keV', 'MeV', 'GeV', 284 * effective area columns. Units that are recognized are 'keV', 'MeV', 'GeV',
283 * 'TeV', 'm^2', 'm2', 'cm^2' and 'cm^2' (case independent). 285 * 'TeV', 'm^2', 'm2', 'cm^2' and 'cm^2' (case independent).
284 * 286 *
@@ -286,16 +288,16 @@ void GCTAAeffArf::load(const std::string& filename) @@ -286,16 +288,16 @@ void GCTAAeffArf::load(const std::string& filename)
286 * For appropriate theta angle assignment, we would need this 288 * For appropriate theta angle assignment, we would need this
287 * information in the response header. 289 * information in the response header.
288 ***************************************************************************/ 290 ***************************************************************************/
289 -void GCTAAeffArf::read(const GFitsTable& hdu) 291 +void GCTAAeffArf::read(const GFitsTable& table)
290 { 292 {
291 // Clear arrays 293 // Clear arrays
292 m_logE.clear(); 294 m_logE.clear();
293 m_aeff.clear(); 295 m_aeff.clear();
294 296
295 // Get pointers to table columns 297 // Get pointers to table columns
296 - const GFitsTableCol* energy_lo = hdu["ENERG_LO"];  
297 - const GFitsTableCol* energy_hi = hdu["ENERG_HI"];  
298 - const GFitsTableCol* specresp = hdu["SPECRESP"]; 298 + const GFitsTableCol* energy_lo = table["ENERG_LO"];
  299 + const GFitsTableCol* energy_hi = table["ENERG_HI"];
  300 + const GFitsTableCol* specresp = table["SPECRESP"];
299 301
300 // Determine unit conversion factors (default: TeV and cm^2) 302 // Determine unit conversion factors (default: TeV and cm^2)
301 std::string u_energy_lo = gammalib::tolower(gammalib::strip_whitespace(energy_lo->unit())); 303 std::string u_energy_lo = gammalib::tolower(gammalib::strip_whitespace(energy_lo->unit()));
inst/cta/src/GCTABackground3D.cpp
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 #include "GCTABackground3D.hpp" 37 #include "GCTABackground3D.hpp"
38 38
39 /* __ Method name definitions ____________________________________________ */ 39 /* __ Method name definitions ____________________________________________ */
40 -#define G_READ "GCTABackground3D::read(GFitsTable& table)" 40 +#define G_READ "GCTABackground3D::read(GFitsTable&)"
41 #define G_MC "GCTABackground3D::mc(GEnergy&, GTime&, GRan&)" 41 #define G_MC "GCTABackground3D::mc(GEnergy&, GTime&, GRan&)"
42 #define G_INIT_MC_CACHE "GCTABackground3D::init_mc_cache()" 42 #define G_INIT_MC_CACHE "GCTABackground3D::init_mc_cache()"
43 43
@@ -77,7 +77,7 @@ GCTABackground3D::GCTABackground3D(void) : GCTABackground() @@ -77,7 +77,7 @@ GCTABackground3D::GCTABackground3D(void) : GCTABackground()
77 * 77 *
78 * @param[in] filename FITS file name. 78 * @param[in] filename FITS file name.
79 * 79 *
80 - * Construct instance by loading the background information from a FITS file. 80 + * Constructs background from a FITS file.
81 ***************************************************************************/ 81 ***************************************************************************/
82 GCTABackground3D::GCTABackground3D(const std::string& filename) : 82 GCTABackground3D::GCTABackground3D(const std::string& filename) :
83 GCTABackground() 83 GCTABackground()
@@ -304,17 +304,18 @@ GCTABackground3D* GCTABackground3D::clone(void) const @@ -304,17 +304,18 @@ GCTABackground3D* GCTABackground3D::clone(void) const
304 304
305 305
306 /***********************************************************************//** 306 /***********************************************************************//**
307 - * @brief Read background from FITS file 307 + * @brief Read background from FITS table
308 * 308 *
309 * @param[in] table FITS table. 309 * @param[in] table FITS table.
310 * 310 *
311 * @exception GException::invalid_value 311 * @exception GException::invalid_value
312 * FITS file format differs from expectation. 312 * FITS file format differs from expectation.
313 * 313 *
314 - * Reads the background from the FITS table. The data  
315 - * are stored in m_background which is of type GCTAResponseTable. The DETX  
316 - * and DETY axes will be set to radians, the energy axis will be set to  
317 - * log10. 314 + * Reads the background from the FITS @p table.
  315 + *
  316 + * The data are stored in m_background which is of type GCTAResponseTable.
  317 + * The DETX and DETY axes will be set to radians, the energy axis will be set
  318 + * to log10.
318 ***************************************************************************/ 319 ***************************************************************************/
319 void GCTABackground3D::read(const GFitsTable& table) 320 void GCTABackground3D::read(const GFitsTable& table)
320 { 321 {
@@ -359,16 +360,18 @@ void GCTABackground3D::read(const GFitsTable& table) @@ -359,16 +360,18 @@ void GCTABackground3D::read(const GFitsTable& table)
359 } 360 }
360 361
361 /***********************************************************************//** 362 /***********************************************************************//**
362 - * @brief Write CTA background table into FITS binary table object. 363 + * @brief Write background into FITS table
  364 + *
  365 + * @param[in] table FITS binary table.
363 * 366 *
364 - * @param[in] hdu FITS binary table. 367 + * Writes background into a FITS binary @p table.
365 * 368 *
366 * @todo Add necessary keywords. 369 * @todo Add necessary keywords.
367 ***************************************************************************/ 370 ***************************************************************************/
368 -void GCTABackground3D::write(GFitsBinTable& hdu) const 371 +void GCTABackground3D::write(GFitsBinTable& table) const
369 { 372 {
370 // Write background table 373 // Write background table
371 - m_background.write(hdu); 374 + m_background.write(table);
372 375
373 // Return 376 // Return
374 return; 377 return;
@@ -378,9 +381,12 @@ void GCTABackground3D::write(GFitsBinTable& hdu) const @@ -378,9 +381,12 @@ void GCTABackground3D::write(GFitsBinTable& hdu) const
378 /***********************************************************************//** 381 /***********************************************************************//**
379 * @brief Load background from FITS file 382 * @brief Load background from FITS file
380 * 383 *
381 - * @param[in] filename FITS file. 384 + * @param[in] filename FITS file name.
382 * 385 *
383 - * This method loads the background information from a FITS file. 386 + * Loads the background from a FITS file.
  387 + *
  388 + * If no extension name is provided, the background will be loaded from the
  389 + * "BACKGROUND" extension.
384 ***************************************************************************/ 390 ***************************************************************************/
385 void GCTABackground3D::load(const std::string& filename) 391 void GCTABackground3D::load(const std::string& filename)
386 { 392 {
@@ -408,12 +414,15 @@ void GCTABackground3D::load(const std::string& filename) @@ -408,12 +414,15 @@ void GCTABackground3D::load(const std::string& filename)
408 414
409 415
410 /***********************************************************************//** 416 /***********************************************************************//**
411 - * @brief Save background table into FITS file 417 + * @brief Save background into FITS file
412 * 418 *
413 * @param[in] filename background table FITS file name. 419 * @param[in] filename background table FITS file name.
414 - * @param[in] clobber Overwrite existing file? (true=yes) 420 + * @param[in] clobber Overwrite existing file? (default: false)
  421 + *
  422 + * Save the background into a FITS file.
415 * 423 *
416 - * Save the background table into a FITS file. 424 + * If no extension name is provided, the background will be saved into the
  425 + * "BACKGROUND" extension.
417 ***************************************************************************/ 426 ***************************************************************************/
418 void GCTABackground3D::save(const std::string& filename, const bool& clobber) const 427 void GCTABackground3D::save(const std::string& filename, const bool& clobber) const
419 { 428 {
inst/cta/src/GCTAEdisp2D.cpp
@@ -74,8 +74,7 @@ GCTAEdisp2D::GCTAEdisp2D(void) : GCTAEdisp() @@ -74,8 +74,7 @@ GCTAEdisp2D::GCTAEdisp2D(void) : GCTAEdisp()
74 * 74 *
75 * @param[in] filename FITS file name. 75 * @param[in] filename FITS file name.
76 * 76 *
77 - * Construct instance by loading the energy dispersion information from a  
78 - * FITS file. 77 + * Constructs energy dispersion from a FITS file.
79 ***************************************************************************/ 78 ***************************************************************************/
80 GCTAEdisp2D::GCTAEdisp2D(const std::string& filename) : GCTAEdisp() 79 GCTAEdisp2D::GCTAEdisp2D(const std::string& filename) : GCTAEdisp()
81 { 80 {
@@ -233,9 +232,12 @@ GCTAEdisp2D* GCTAEdisp2D::clone(void) const @@ -233,9 +232,12 @@ GCTAEdisp2D* GCTAEdisp2D::clone(void) const
233 /***********************************************************************//** 232 /***********************************************************************//**
234 * @brief Load energy dispersion from FITS file 233 * @brief Load energy dispersion from FITS file
235 * 234 *
236 - * @param[in] filename FITS file. 235 + * @param[in] filename FITS file name.
  236 + *
  237 + * Loads the energy dispersion from a FITS file.
237 * 238 *
238 - * This method loads the energy dispersion information from a FITS file. 239 + * If no extension name is provided, the energy dispersion will be loaded
  240 + * from the "ENERGY DISPERSION" extension.
239 ***************************************************************************/ 241 ***************************************************************************/
240 void GCTAEdisp2D::load(const std::string& filename) 242 void GCTAEdisp2D::load(const std::string& filename)
241 { 243 {
@@ -263,17 +265,16 @@ void GCTAEdisp2D::load(const std::string& filename) @@ -263,17 +265,16 @@ void GCTAEdisp2D::load(const std::string& filename)
263 265
264 266
265 /***********************************************************************//** 267 /***********************************************************************//**
266 - * @brief Read energy dispersion from FITS file 268 + * @brief Read energy dispersion from FITS table
  269 + *
  270 + * @param[in] fits FITS table.
267 * 271 *
268 - * @param[in] fits FITS file pointer. 272 + * Reads the energy dispersion form the FITS @p table.
269 * 273 *
270 - * Reads the energy dispersion form the FITS file extension  
271 - * "ENERGY DISPERSION". The data are stored in m_edisp which is of type  
272 - * GCTAResponseTable. The energy axis will be set to log10, the offset  
273 - * angle axis to radians. 274 + * The data are stored in m_edisp which is of type GCTAResponseTable. The
  275 + * energy axis will be set to log10, the offset angle axis to radians.
274 * 276 *
275 - * The method assures that the energy dispersion information is properly  
276 - * normalised. 277 + * The method assures that the energy dispersion is properly normalised.
277 ***************************************************************************/ 278 ***************************************************************************/
278 void GCTAEdisp2D::read(const GFitsTable& table) 279 void GCTAEdisp2D::read(const GFitsTable& table)
279 { 280 {
@@ -377,16 +378,18 @@ void GCTAEdisp2D::read(const GFitsTable& table) @@ -377,16 +378,18 @@ void GCTAEdisp2D::read(const GFitsTable& table)
377 378
378 379
379 /***********************************************************************//** 380 /***********************************************************************//**
380 - * @brief Write CTA energy dispersion table into FITS binary table object. 381 + * @brief Write energy dispersion into FITS binary table
381 * 382 *
382 - * @param[in] hdu FITS binary table. 383 + * @param[in] table FITS binary table.
383 * 384 *
384 - * @todo Add necessary keywords. 385 + * Writes the energy dispersion into the FITS binary @p table.
  386 + *
  387 + * @todo Add keywords.
385 ***************************************************************************/ 388 ***************************************************************************/
386 -void GCTAEdisp2D::write(GFitsBinTable& hdu) const 389 +void GCTAEdisp2D::write(GFitsBinTable& table) const
387 { 390 {
388 // Write background table 391 // Write background table
389 - m_edisp.write(hdu); 392 + m_edisp.write(table);
390 393
391 // Return 394 // Return
392 return; 395 return;
@@ -396,10 +399,13 @@ void GCTAEdisp2D::write(GFitsBinTable& hdu) const @@ -396,10 +399,13 @@ void GCTAEdisp2D::write(GFitsBinTable& hdu) const
396 /***********************************************************************//** 399 /***********************************************************************//**
397 * @brief Save energy dispersion table into FITS file 400 * @brief Save energy dispersion table into FITS file
398 * 401 *
399 - * @param[in] filename Energy dispersion table FITS file name.  
400 - * @param[in] clobber Overwrite existing file? (true=yes) 402 + * @param[in] filename FITS file name.
  403 + * @param[in] clobber Overwrite existing file? (default: false)
  404 + *
  405 + * Save the energy dispersion table into FITS file.
401 * 406 *
402 - * Save the energy dispersion table into a FITS file. 407 + * If no extension name is provided, the energy dispersion will be saved into
  408 + * the "ENERGY DISPERSION" extension.
403 ***************************************************************************/ 409 ***************************************************************************/
404 void GCTAEdisp2D::save(const std::string& filename, const bool& clobber) const 410 void GCTAEdisp2D::save(const std::string& filename, const bool& clobber) const
405 { 411 {
@@ -408,7 +414,7 @@ void GCTAEdisp2D::save(const std::string& filename, const bool& clobber) const @@ -408,7 +414,7 @@ void GCTAEdisp2D::save(const std::string& filename, const bool& clobber) const
408 414
409 // Create binary table 415 // Create binary table
410 GFitsBinTable table; 416 GFitsBinTable table;
411 - table.extname(fname.extname("ENERGY DISPERSON")); 417 + table.extname(fname.extname("ENERGY DISPERSION"));
412 418
413 // Write the energy dispersion table 419 // Write the energy dispersion table
414 write(table); 420 write(table);
inst/cta/src/GCTAPsf2D.cpp
@@ -39,8 +39,7 @@ @@ -39,8 +39,7 @@
39 #include "GCTAException.hpp" 39 #include "GCTAException.hpp"
40 40
41 /* __ Method name definitions ____________________________________________ */ 41 /* __ Method name definitions ____________________________________________ */
42 -#define G_READ "GCTAPsf2D::read(GFitsTable& table)"  
43 -#define G_LOAD "GCTAPsf2D::load(std::string&)" 42 +#define G_READ "GCTAPsf2D::read(GFitsTable&)"
44 #define G_CONTAINMENT_RADIUS "GCTAPsf2D::containment_radius(double&,"\ 43 #define G_CONTAINMENT_RADIUS "GCTAPsf2D::containment_radius(double&,"\
45 " double&, double&, double&, double&, double&, bool&)" 44 " double&, double&, double&, double&, double&, bool&)"
46 45
@@ -76,10 +75,9 @@ GCTAPsf2D::GCTAPsf2D(void) : GCTAPsf() @@ -76,10 +75,9 @@ GCTAPsf2D::GCTAPsf2D(void) : GCTAPsf()
76 /***********************************************************************//** 75 /***********************************************************************//**
77 * @brief File constructor 76 * @brief File constructor
78 * 77 *
79 - * @param[in] filename PSF FITS file name. 78 + * @param[in] filename FITS file name.
80 * 79 *
81 - * Construct instance by loading the point spread function information from  
82 - * a PSF response table. 80 + * Constructs point spread function from a FITS file.
83 ***************************************************************************/ 81 ***************************************************************************/
84 GCTAPsf2D::GCTAPsf2D(const std::string& filename) : GCTAPsf() 82 GCTAPsf2D::GCTAPsf2D(const std::string& filename) : GCTAPsf()
85 { 83 {
@@ -275,17 +273,18 @@ GCTAPsf2D* GCTAPsf2D::clone(void) const @@ -275,17 +273,18 @@ GCTAPsf2D* GCTAPsf2D::clone(void) const
275 273
276 274
277 /***********************************************************************//** 275 /***********************************************************************//**
278 - * @brief Read PSF from FITS file 276 + * @brief Read point spread function from FITS table
279 * 277 *
280 * @param[in] table FITS table. 278 * @param[in] table FITS table.
281 * 279 *
282 * @exception GException::invalid_value 280 * @exception GException::invalid_value
283 * FITS file format differs from expectation. 281 * FITS file format differs from expectation.
284 * 282 *
285 - * Reads the PSF from the FITS table. The data  
286 - * are stored in m_psf which is of type GCTAResponseTable.  
287 - * The energy axis will be set to log10. The offset angle axis and  
288 - * sigma parameter columns will be set to radians. 283 + * Reads point spread function from the FITS @p table.
  284 + *
  285 + * The data are stored in m_psf which is of type GCTAResponseTable. The
  286 + * energy axis will be set to log10. The offset angle axis and sigma
  287 + * parameter columns will be set to radians.
289 ***************************************************************************/ 288 ***************************************************************************/
290 void GCTAPsf2D::read(const GFitsTable& table) 289 void GCTAPsf2D::read(const GFitsTable& table)
291 { 290 {
@@ -328,24 +327,26 @@ void GCTAPsf2D::read(const GFitsTable& table) @@ -328,24 +327,26 @@ void GCTAPsf2D::read(const GFitsTable& table)
328 327
329 328
330 /***********************************************************************//** 329 /***********************************************************************//**
331 - * @brief Write CTA PSF table into FITS binary table object. 330 + * @brief Write point spread function into FITS binary table
  331 + *
  332 + * @param[in] table FITS binary table.
332 * 333 *
333 - * @param[in] hdu FITS binary table. 334 + * Writes point spread function into FITS binary @p table.
334 * 335 *
335 * @todo Add necessary keywords. 336 * @todo Add necessary keywords.
336 ***************************************************************************/ 337 ***************************************************************************/
337 -void GCTAPsf2D::write(GFitsBinTable& hdu) const 338 +void GCTAPsf2D::write(GFitsBinTable& table) const
338 { 339 {
339 // Create a copy of the response table 340 // Create a copy of the response table
340 - GCTAResponseTable table(m_psf); 341 + GCTAResponseTable psf(m_psf);
341 342
342 // Convert sigma parameters back to degrees 343 // Convert sigma parameters back to degrees
343 - table.scale(1, gammalib::rad2deg);  
344 - table.scale(3, gammalib::rad2deg);  
345 - table.scale(5, gammalib::rad2deg); 344 + psf.scale(1, gammalib::rad2deg);
  345 + psf.scale(3, gammalib::rad2deg);
  346 + psf.scale(5, gammalib::rad2deg);
346 347
347 // Write background table 348 // Write background table
348 - table.write(hdu); 349 + psf.write(table);
349 350
350 // Return 351 // Return
351 return; 352 return;
@@ -353,15 +354,14 @@ void GCTAPsf2D::write(GFitsBinTable& hdu) const @@ -353,15 +354,14 @@ void GCTAPsf2D::write(GFitsBinTable& hdu) const
353 354
354 355
355 /***********************************************************************//** 356 /***********************************************************************//**
356 - * @brief Load point spread function from performance table 357 + * @brief Load point spread function from FITS file
357 * 358 *
358 - * @param[in] filename Performance table file name. 359 + * @param[in] filename FITS file name.
359 * 360 *
360 - * @exception GCTAExceptionHandler::file_open_error  
361 - * File could not be opened for read access. 361 + * Loads the point spread function from a FITS file.
362 * 362 *
363 - * This method loads the point spread function information from a PSF  
364 - * response table. 363 + * If no extension name is provided, the point spread function will be loaded
  364 + * from the "POINT SPREAD FUNCTION" extension.
365 ***************************************************************************/ 365 ***************************************************************************/
366 void GCTAPsf2D::load(const std::string& filename) 366 void GCTAPsf2D::load(const std::string& filename)
367 { 367 {
@@ -389,12 +389,15 @@ void GCTAPsf2D::load(const std::string& filename) @@ -389,12 +389,15 @@ void GCTAPsf2D::load(const std::string& filename)
389 389
390 390
391 /***********************************************************************//** 391 /***********************************************************************//**
392 - * @brief Save PSF table into FITS file 392 + * @brief Save point spread function table into FITS file
  393 + *
  394 + * @param[in] filename FITS file name.
  395 + * @param[in] clobber Overwrite existing file? (default: false)
393 * 396 *
394 - * @param[in] filename PSF table FITS file name.  
395 - * @param[in] clobber Overwrite existing file? (true=yes) 397 + * Save the point spread function into a FITS file.
396 * 398 *
397 - * Save the PSF table into a FITS file. 399 + * If no extension name is provided, the point spread function will be saved
  400 + * into the "POINT SPREAD FUNCTION" extension.
398 ***************************************************************************/ 401 ***************************************************************************/
399 void GCTAPsf2D::save(const std::string& filename, const bool& clobber) const 402 void GCTAPsf2D::save(const std::string& filename, const bool& clobber) const
400 { 403 {
inst/cta/src/GCTAPsfKing.cpp
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 #include "GCTAException.hpp" 39 #include "GCTAException.hpp"
40 40
41 /* __ Method name definitions ____________________________________________ */ 41 /* __ Method name definitions ____________________________________________ */
42 -#define G_READ "GCTAPsfKing::read(GFitsTable& table)" 42 +#define G_READ "GCTAPsfKing::read(GFitsTable&)"
43 #define G_CONTAINMENT_RADIUS "GCTAPsfKing::containment_radius(double&,"\ 43 #define G_CONTAINMENT_RADIUS "GCTAPsfKing::containment_radius(double&,"\
44 " double&, double&, double&, double&, double&, bool&)" 44 " double&, double&, double&, double&, double&, bool&)"
45 #define G_UPDATE "GCTAPsfKing::update(double&, double&)" 45 #define G_UPDATE "GCTAPsfKing::update(double&, double&)"
@@ -81,8 +81,7 @@ GCTAPsfKing::GCTAPsfKing(void) : GCTAPsf() @@ -81,8 +81,7 @@ GCTAPsfKing::GCTAPsfKing(void) : GCTAPsf()
81 * 81 *
82 * @param[in] filename PSF FITS file. 82 * @param[in] filename PSF FITS file.
83 * 83 *
84 - * Construct instance by loading the point spread function information from  
85 - * a FITS file that contains the PSF information in form of a column. 84 + * Constructs point spread function from a FITS file.
86 ***************************************************************************/ 85 ***************************************************************************/
87 GCTAPsfKing::GCTAPsfKing(const std::string& filename) : GCTAPsf() 86 GCTAPsfKing::GCTAPsfKing(const std::string& filename) : GCTAPsf()
88 { 87 {
@@ -276,17 +275,18 @@ GCTAPsfKing* GCTAPsfKing::clone(void) const @@ -276,17 +275,18 @@ GCTAPsfKing* GCTAPsfKing::clone(void) const
276 275
277 276
278 /***********************************************************************//** 277 /***********************************************************************//**
279 - * @brief Read PSF from FITS file 278 + * @brief Read point spread function from FITS table
280 * 279 *
281 * @param[in] table FITS table. 280 * @param[in] table FITS table.
282 * 281 *
283 * @exception GException::invalid_value 282 * @exception GException::invalid_value
284 * FITS file format differs from expectation. 283 * FITS file format differs from expectation.
285 * 284 *
286 - * Reads the PSF from the FITS table. The  
287 - * data are stored in m_psf which is of type GCTAResponseTable.  
288 - * The energy axis will be set to log10. The offset angle axis and  
289 - * sigma parameter columns will be set to radians. 285 + * Reads the point spread function from the FITS @p table.
  286 + *
  287 + * The data are stored in m_psf which is of type GCTAResponseTable. The
  288 + * energy axis will be set to log10. The offset angle axis and sigma
  289 + * parameter columns will be set to radians.
290 ***************************************************************************/ 290 ***************************************************************************/
291 void GCTAPsfKing::read(const GFitsTable& table) 291 void GCTAPsfKing::read(const GFitsTable& table)
292 { 292 {
@@ -327,16 +327,18 @@ void GCTAPsfKing::read(const GFitsTable& table) @@ -327,16 +327,18 @@ void GCTAPsfKing::read(const GFitsTable& table)
327 327
328 328
329 /***********************************************************************//** 329 /***********************************************************************//**
330 - * @brief Write CTA PSF table into FITS binary table object. 330 + * @brief Write point spread function into FITS table
  331 + *
  332 + * @param[in] table FITS binary table.
331 * 333 *
332 - * @param[in] hdu FITS binary table. 334 + * Writes point spread function into a FITS binary @p table.
333 * 335 *
334 - * @todo Add necessary keywords. 336 + * @todo Add keywords.
335 ***************************************************************************/ 337 ***************************************************************************/
336 -void GCTAPsfKing::write(GFitsBinTable& hdu) const 338 +void GCTAPsfKing::write(GFitsBinTable& table) const
337 { 339 {
338 // Write background table 340 // Write background table
339 - m_psf.write(hdu); 341 + m_psf.write(table);
340 342
341 // Return 343 // Return
342 return; 344 return;
@@ -344,15 +346,14 @@ void GCTAPsfKing::write(GFitsBinTable& hdu) const @@ -344,15 +346,14 @@ void GCTAPsfKing::write(GFitsBinTable& hdu) const
344 346
345 347
346 /***********************************************************************//** 348 /***********************************************************************//**
347 - * @brief Load point spread function from binary table 349 + * @brief Load point spread function from FITS file
348 * 350 *
349 - * @param[in] filename Performance table file name. 351 + * @param[in] filename FITS file name.
350 * 352 *
351 - * @exception GCTAExceptionHandler::file_open_error  
352 - * File could not be opened for read access. 353 + * Loads the point spread function from a FITS file.
353 * 354 *
354 - * This method loads the point spread function information from a PSF  
355 - * response table. 355 + * If no extension name is provided, the point spread function will be loaded
  356 + * from the "POINT SPREAD FUNCTION" extension.
356 ***************************************************************************/ 357 ***************************************************************************/
357 void GCTAPsfKing::load(const std::string& filename) 358 void GCTAPsfKing::load(const std::string& filename)
358 { 359 {
@@ -379,12 +380,15 @@ void GCTAPsfKing::load(const std::string& filename) @@ -379,12 +380,15 @@ void GCTAPsfKing::load(const std::string& filename)
379 } 380 }
380 381
381 /***********************************************************************//** 382 /***********************************************************************//**
382 - * @brief Save PSF table into FITS file 383 + * @brief Save point spread function table into FITS file
  384 + *
  385 + * @param[in] filename FITS file name.
  386 + * @param[in] clobber Overwrite existing file? (default: false)
383 * 387 *
384 - * @param[in] filename PSF table FITS file name.  
385 - * @param[in] clobber Overwrite existing file? (true=yes) 388 + * Save the point spread function into a FITS file.
386 * 389 *
387 - * Save the PSF table into a FITS file. 390 + * If no extension name is provided, the point spread function will be saved
  391 + * into the "POINT SPREAD FUNCTION" extension.
388 ***************************************************************************/ 392 ***************************************************************************/
389 void GCTAPsfKing::save(const std::string& filename, const bool& clobber) const 393 void GCTAPsfKing::save(const std::string& filename, const bool& clobber) const
390 { 394 {
inst/cta/src/GCTAPsfVector.cpp
@@ -75,8 +75,7 @@ GCTAPsfVector::GCTAPsfVector(void) : GCTAPsf() @@ -75,8 +75,7 @@ GCTAPsfVector::GCTAPsfVector(void) : GCTAPsf()
75 * 75 *
76 * @param[in] filename PSF FITS file. 76 * @param[in] filename PSF FITS file.
77 * 77 *
78 - * Construct instance by loading the point spread function information from  
79 - * a FITS file that contains the PSF information in form of a column. 78 + * Constructs point spread function vector from a FITS file.
80 ***************************************************************************/ 79 ***************************************************************************/
81 GCTAPsfVector::GCTAPsfVector(const std::string& filename) : GCTAPsf() 80 GCTAPsfVector::GCTAPsfVector(const std::string& filename) : GCTAPsf()
82 { 81 {
@@ -248,12 +247,14 @@ GCTAPsfVector* GCTAPsfVector::clone(void) const @@ -248,12 +247,14 @@ GCTAPsfVector* GCTAPsfVector::clone(void) const
248 247
249 248
250 /***********************************************************************//** 249 /***********************************************************************//**
251 - * @brief Load point spread function from performance table 250 + * @brief Load point spread function from FITS file
252 * 251 *
253 - * @param[in] filename Performance table file name. 252 + * @param[in] filename FITS file name.
254 * 253 *
255 - * This method loads the point spread function information from a FITS file  
256 - * that contains the PSF width in a single column. 254 + * Loads the point spread function from a FITS file.
  255 + *
  256 + * If no extension name is provided, the point spread function will be loaded
  257 + * from the "PSF" extension.
257 ***************************************************************************/ 258 ***************************************************************************/
258 void GCTAPsfVector::load(const std::string& filename) 259 void GCTAPsfVector::load(const std::string& filename)
259 { 260 {
@@ -281,12 +282,13 @@ void GCTAPsfVector::load(const std::string& filename) @@ -281,12 +282,13 @@ void GCTAPsfVector::load(const std::string& filename)
281 282
282 283
283 /***********************************************************************//** 284 /***********************************************************************//**
284 - * @brief Read CTA PSF vector 285 + * @brief Read point spread function vector from FITS table
285 * 286 *
286 * @param[in] table FITS table. 287 * @param[in] table FITS table.
287 * 288 *
288 - * This method reads a CTA PSF vector from the FITS HDU. Note that the  
289 - * energies are converted to TeV. Conversion is done based on the units 289 + * Reads a point spread function vector from the FITS @p table.
  290 + *
  291 + * The energies are converted to TeV. Conversion is done based on the units
290 * provided for the energy columns. Units that are recognized are 'keV', 292 * provided for the energy columns. Units that are recognized are 'keV',
291 * 'MeV', 'GeV', and 'TeV' (case independent). 293 * 'MeV', 'GeV', and 'TeV' (case independent).
292 * 294 *