Commit 530bfccccff67eea66da4356996b93790129e93b

Authored by Jürgen Knödlseder
1 parent 5a6fea13

ctskymap now derives from ctool base class.

pyext/ctskymap.i
1 /*************************************************************************** 1 /***************************************************************************
2 - * ctskymap - CTA sky mapping tool * 2 + * ctskymap - Sky mapping tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2012-2014 by Juergen Knoedlseder * 4 * copyright (C) 2012-2014 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
@@ -20,22 +20,21 @@ @@ -20,22 +20,21 @@
20 ***************************************************************************/ 20 ***************************************************************************/
21 /** 21 /**
22 * @file ctskymap.i 22 * @file ctskymap.i
23 - * @brief CTA sky mapping tool definition 23 + * @brief Sky mapping tool definition
24 * @author Juergen Knoedlseder 24 * @author Juergen Knoedlseder
25 */ 25 */
26 %{ 26 %{
27 /* Put headers and other declarations here that are needed for compilation */ 27 /* Put headers and other declarations here that are needed for compilation */
28 #include "ctskymap.hpp" 28 #include "ctskymap.hpp"
29 -#include "GTools.hpp"  
30 %} 29 %}
31 30
32 31
33 /***********************************************************************//** 32 /***********************************************************************//**
34 * @class ctskymap 33 * @class ctskymap
35 * 34 *
36 - * @brief CTA sky mapping tool interface defintion 35 + * @brief Sky mapping tool
37 ***************************************************************************/ 36 ***************************************************************************/
38 -class ctskymap : public GApplication { 37 +class ctskymap : public ctool {
39 public: 38 public:
40 // Constructors and destructors 39 // Constructors and destructors
41 ctskymap(void); 40 ctskymap(void);
@@ -54,7 +53,7 @@ public: @@ -54,7 +53,7 @@ public:
54 53
55 54
56 /***********************************************************************//** 55 /***********************************************************************//**
57 - * @brief CTA sky mapping tool Python extension 56 + * @brief Sky mapping tool Python extension
58 ***************************************************************************/ 57 ***************************************************************************/
59 %extend ctskymap { 58 %extend ctskymap {
60 ctskymap copy() { 59 ctskymap copy() {
src/ctselect/ctselect.cpp
@@ -761,11 +761,6 @@ void ctselect::copy_members(const ctselect& app) @@ -761,11 +761,6 @@ void ctselect::copy_members(const ctselect& app)
761 ***************************************************************************/ 761 ***************************************************************************/
762 void ctselect::free_members(void) 762 void ctselect::free_members(void)
763 { 763 {
764 - // Write separator into logger  
765 - if (logTerse()) {  
766 - log << std::endl;  
767 - }  
768 -  
769 // Return 764 // Return
770 return; 765 return;
771 } 766 }
src/ctskymap/Makefile.am
1 ## Process this file with automake to produce Makefile.in 1 ## Process this file with automake to produce Makefile.in
2 2
  3 +# Set include directories
  4 +INCLUDES = -I$(top_srcdir)/src/support
  5 +
3 # Program name 6 # Program name
4 bin_PROGRAMS = ctskymap 7 bin_PROGRAMS = ctskymap
5 8
@@ -14,7 +17,7 @@ libctskymap_la_SOURCES = $(sources) @@ -14,7 +17,7 @@ libctskymap_la_SOURCES = $(sources)
14 ctskymap_SOURCES = main.cpp 17 ctskymap_SOURCES = main.cpp
15 ctskymap_LDFLAGS = $(LIB_LINK_OPTION) @LDFLAGS@ 18 ctskymap_LDFLAGS = $(LIB_LINK_OPTION) @LDFLAGS@
16 ctskymap_CPPFLAGS = @CPPFLAGS@ 19 ctskymap_CPPFLAGS = @CPPFLAGS@
17 -ctskymap_LDADD = libctskymap.la 20 +ctskymap_LDADD = libctskymap.la $(top_srcdir)/src/support/libsupport.la
18 21
19 # Parameter files 22 # Parameter files
20 pfilesdir = $(prefix)/syspfiles 23 pfilesdir = $(prefix)/syspfiles
src/ctskymap/ctskymap.cpp
1 /*************************************************************************** 1 /***************************************************************************
2 - * ctskymap - CTA sky mapping tool * 2 + * ctskymap - Sky mapping tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2011-2014 by Juergen Knoedlseder * 4 * copyright (C) 2011-2014 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 ***************************************************************************/ 20 ***************************************************************************/
21 /** 21 /**
22 * @file ctskymap.cpp 22 * @file ctskymap.cpp
23 - * @brief CTA sky mapping tool implementation 23 + * @brief Sky mapping tool implementation
24 * @author Juergen Knoedlseder 24 * @author Juergen Knoedlseder
25 */ 25 */
26 26
@@ -50,14 +50,11 @@ @@ -50,14 +50,11 @@
50 /***********************************************************************//** 50 /***********************************************************************//**
51 * @brief Void constructor 51 * @brief Void constructor
52 ***************************************************************************/ 52 ***************************************************************************/
53 -ctskymap::ctskymap(void) : GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION) 53 +ctskymap::ctskymap(void) : ctool(CTSKYMAP_NAME, CTSKYMAP_VERSION)
54 { 54 {
55 // Initialise members 55 // Initialise members
56 init_members(); 56 init_members();
57 57
58 - // Write header into logger  
59 - log_header();  
60 -  
61 // Return 58 // Return
62 return; 59 return;
63 } 60 }
@@ -72,7 +69,7 @@ ctskymap::ctskymap(void) : GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION) @@ -72,7 +69,7 @@ ctskymap::ctskymap(void) : GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION)
72 * observations container. 69 * observations container.
73 ***************************************************************************/ 70 ***************************************************************************/
74 ctskymap::ctskymap(const GObservations& obs) : 71 ctskymap::ctskymap(const GObservations& obs) :
75 - GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION) 72 + ctool(CTSKYMAP_NAME, CTSKYMAP_VERSION)
76 { 73 {
77 // Initialise members 74 // Initialise members
78 init_members(); 75 init_members();
@@ -80,9 +77,6 @@ ctskymap::ctskymap(const GObservations&amp; obs) : @@ -80,9 +77,6 @@ ctskymap::ctskymap(const GObservations&amp; obs) :
80 // Set observations 77 // Set observations
81 m_obs = obs; 78 m_obs = obs;
82 79
83 - // Write header into logger  
84 - log_header();  
85 -  
86 // Return 80 // Return
87 return; 81 return;
88 } 82 }
@@ -96,14 +90,11 @@ ctskymap::ctskymap(const GObservations&amp; obs) : @@ -96,14 +90,11 @@ ctskymap::ctskymap(const GObservations&amp; obs) :
96 * @param[in] argv Array of command line arguments. 90 * @param[in] argv Array of command line arguments.
97 ***************************************************************************/ 91 ***************************************************************************/
98 ctskymap::ctskymap(int argc, char *argv[]) : 92 ctskymap::ctskymap(int argc, char *argv[]) :
99 - GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION, argc, argv) 93 + ctool(CTSKYMAP_NAME, CTSKYMAP_VERSION, argc, argv)
100 { 94 {
101 // Initialise members 95 // Initialise members
102 init_members(); 96 init_members();
103 97
104 - // Write header into logger  
105 - log_header();  
106 -  
107 // Return 98 // Return
108 return; 99 return;
109 } 100 }
@@ -114,7 +105,7 @@ ctskymap::ctskymap(int argc, char *argv[]) : @@ -114,7 +105,7 @@ ctskymap::ctskymap(int argc, char *argv[]) :
114 * 105 *
115 * @param[in] app Application. 106 * @param[in] app Application.
116 ***************************************************************************/ 107 ***************************************************************************/
117 -ctskymap::ctskymap(const ctskymap& app) : GApplication(app) 108 +ctskymap::ctskymap(const ctskymap& app) : ctool(app)
118 { 109 {
119 // Initialise members 110 // Initialise members
120 init_members(); 111 init_members();
@@ -151,13 +142,13 @@ ctskymap::~ctskymap(void) @@ -151,13 +142,13 @@ ctskymap::~ctskymap(void)
151 * 142 *
152 * @param[in] app Application. 143 * @param[in] app Application.
153 ***************************************************************************/ 144 ***************************************************************************/
154 -ctskymap& ctskymap::operator= (const ctskymap& app) 145 +ctskymap& ctskymap::operator=(const ctskymap& app)
155 { 146 {
156 // Execute only if object is not identical 147 // Execute only if object is not identical
157 if (this != &app) { 148 if (this != &app) {
158 149
159 // Copy base class members 150 // Copy base class members
160 - this->GApplication::operator=(app); 151 + this->ctool::operator=(app);
161 152
162 // Free members 153 // Free members
163 free_members(); 154 free_members();
@@ -188,10 +179,12 @@ void ctskymap::clear(void) @@ -188,10 +179,12 @@ void ctskymap::clear(void)
188 { 179 {
189 // Free members 180 // Free members
190 free_members(); 181 free_members();
  182 + this->ctool::free_members();
191 this->GApplication::free_members(); 183 this->GApplication::free_members();
192 184
193 // Initialise members 185 // Initialise members
194 this->GApplication::init_members(); 186 this->GApplication::init_members();
  187 + this->ctool::init_members();
195 init_members(); 188 init_members();
196 189
197 // Return 190 // Return
@@ -602,10 +595,6 @@ void ctskymap::copy_members(const ctskymap&amp; app) @@ -602,10 +595,6 @@ void ctskymap::copy_members(const ctskymap&amp; app)
602 ***************************************************************************/ 595 ***************************************************************************/
603 void ctskymap::free_members(void) 596 void ctskymap::free_members(void)
604 { 597 {
605 - // Write separator into logger  
606 - if (logTerse())  
607 - log << std::endl;  
608 -  
609 // Return 598 // Return
610 return; 599 return;
611 } 600 }
src/ctskymap/ctskymap.hpp
1 /*************************************************************************** 1 /***************************************************************************
2 - * ctskymap - CTA sky mapping tool * 2 + * ctskymap - Sky mapping tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2010-2014 by Juergen Knoedlseder * 4 * copyright (C) 2010-2014 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 ***************************************************************************/ 20 ***************************************************************************/
21 /** 21 /**
22 * @file ctskymap.hpp 22 * @file ctskymap.hpp
23 - * @brief CTA sky mapping tool definition 23 + * @brief Sky mapping tool definition
24 * @author Juergen Knoedlseder 24 * @author Juergen Knoedlseder
25 */ 25 */
26 26
@@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
30 /* __ Includes ___________________________________________________________ */ 30 /* __ Includes ___________________________________________________________ */
31 #include "GammaLib.hpp" 31 #include "GammaLib.hpp"
32 #include "GCTALib.hpp" 32 #include "GCTALib.hpp"
  33 +#include "ctool.hpp"
33 34
34 /* __Definitions _________________________________________________________ */ 35 /* __Definitions _________________________________________________________ */
35 #define CTSKYMAP_NAME "ctskymap" 36 #define CTSKYMAP_NAME "ctskymap"
@@ -39,11 +40,12 @@ @@ -39,11 +40,12 @@
39 /***********************************************************************//** 40 /***********************************************************************//**
40 * @class ctskymap 41 * @class ctskymap
41 * 42 *
42 - * @brief CTA sky mapping tool interface defintion 43 + * @brief Sky mapping tool
43 * 44 *
44 * This class creates a sky map from a CTA event list. 45 * This class creates a sky map from a CTA event list.
45 ***************************************************************************/ 46 ***************************************************************************/
46 -class ctskymap : public GApplication { 47 +class ctskymap : public ctool {
  48 +
47 public: 49 public:
48 // Constructors and destructors 50 // Constructors and destructors
49 ctskymap(void); 51 ctskymap(void);