Commit 5a6fea13ba492d3f855d832af7969d9cc6f2ea21

Authored by Jürgen Knödlseder
1 parent 3b9e0e5f

ctselect now derives from ctool base class.

pyext/ctselect.i
1 /*************************************************************************** 1 /***************************************************************************
2 - * ctselect - CTA data selection tool * 2 + * ctselect - Data selection tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2010-2014 by Jurgen Knodlseder * 4 * copyright (C) 2010-2014 by Jurgen Knodlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
@@ -20,22 +20,21 @@ @@ -20,22 +20,21 @@
20 ***************************************************************************/ 20 ***************************************************************************/
21 /** 21 /**
22 * @file ctselect.i 22 * @file ctselect.i
23 - * @brief CTA data selection tool Python interface definition 23 + * @brief Data selection 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 "ctselect.hpp" 28 #include "ctselect.hpp"
29 -#include "GTools.hpp"  
30 %} 29 %}
31 30
32 31
33 /***********************************************************************//** 32 /***********************************************************************//**
34 * @class ctselect 33 * @class ctselect
35 * 34 *
36 - * @brief CTA data selection tool Python interface 35 + * @brief Data selection tool
37 ***************************************************************************/ 36 ***************************************************************************/
38 -class ctselect : public GApplication { 37 +class ctselect : public ctool {
39 public: 38 public:
40 // Constructors and destructors 39 // Constructors and destructors
41 ctselect(void); 40 ctselect(void);
@@ -55,7 +54,7 @@ public: @@ -55,7 +54,7 @@ public:
55 54
56 55
57 /***********************************************************************//** 56 /***********************************************************************//**
58 - * @brief CTA data selection tool Python extension 57 + * @brief Data selection tool Python extension
59 ***************************************************************************/ 58 ***************************************************************************/
60 %extend ctselect { 59 %extend ctselect {
61 ctselect copy() { 60 ctselect copy() {
src/ctselect/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 = ctselect 7 bin_PROGRAMS = ctselect
5 8
@@ -14,7 +17,7 @@ libctselect_la_SOURCES = $(sources) @@ -14,7 +17,7 @@ libctselect_la_SOURCES = $(sources)
14 ctselect_SOURCES = main.cpp 17 ctselect_SOURCES = main.cpp
15 ctselect_LDFLAGS = $(LIB_LINK_OPTION) @LDFLAGS@ 18 ctselect_LDFLAGS = $(LIB_LINK_OPTION) @LDFLAGS@
16 ctselect_CPPFLAGS = @CPPFLAGS@ 19 ctselect_CPPFLAGS = @CPPFLAGS@
17 -ctselect_LDADD = libctselect.la 20 +ctselect_LDADD = libctselect.la $(top_srcdir)/src/support/libsupport.la
18 21
19 # Parameter files 22 # Parameter files
20 pfilesdir = $(prefix)/syspfiles 23 pfilesdir = $(prefix)/syspfiles
src/ctselect/ctselect.cpp
1 /*************************************************************************** 1 /***************************************************************************
2 - * ctselect - CTA data selection tool * 2 + * ctselect - Data selection 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 ctselect.cpp 22 * @file ctselect.cpp
23 - * @brief CTA data selection tool implementation 23 + * @brief Data selection tool definition
24 * @author Juergen Knoedlseder 24 * @author Juergen Knoedlseder
25 */ 25 */
26 26
@@ -52,14 +52,11 @@ @@ -52,14 +52,11 @@
52 /***********************************************************************//** 52 /***********************************************************************//**
53 * @brief Void constructor 53 * @brief Void constructor
54 ***************************************************************************/ 54 ***************************************************************************/
55 -ctselect::ctselect(void) : GApplication(CTSELECT_NAME, CTSELECT_VERSION) 55 +ctselect::ctselect(void) : ctool(CTSELECT_NAME, CTSELECT_VERSION)
56 { 56 {
57 // Initialise members 57 // Initialise members
58 init_members(); 58 init_members();
59 59
60 - // Write header into logger  
61 - log_header();  
62 -  
63 // Return 60 // Return
64 return; 61 return;
65 } 62 }
@@ -74,7 +71,7 @@ ctselect::ctselect(void) : GApplication(CTSELECT_NAME, CTSELECT_VERSION) @@ -74,7 +71,7 @@ ctselect::ctselect(void) : GApplication(CTSELECT_NAME, CTSELECT_VERSION)
74 * an observation container. 71 * an observation container.
75 ***************************************************************************/ 72 ***************************************************************************/
76 ctselect::ctselect(const GObservations& obs) : 73 ctselect::ctselect(const GObservations& obs) :
77 - GApplication(CTSELECT_NAME, CTSELECT_VERSION) 74 + ctool(CTSELECT_NAME, CTSELECT_VERSION)
78 { 75 {
79 // Initialise members 76 // Initialise members
80 init_members(); 77 init_members();
@@ -82,9 +79,6 @@ ctselect::ctselect(const GObservations& obs) : @@ -82,9 +79,6 @@ ctselect::ctselect(const GObservations& obs) :
82 // Set observations 79 // Set observations
83 m_obs = obs; 80 m_obs = obs;
84 81
85 - // Write header into logger  
86 - log_header();  
87 -  
88 // Return 82 // Return
89 return; 83 return;
90 } 84 }
@@ -99,14 +93,11 @@ ctselect::ctselect(const GObservations& obs) : @@ -99,14 +93,11 @@ ctselect::ctselect(const GObservations& obs) :
99 * @param[in] argv Array of command line arguments. 93 * @param[in] argv Array of command line arguments.
100 ***************************************************************************/ 94 ***************************************************************************/
101 ctselect::ctselect(int argc, char *argv[]) : 95 ctselect::ctselect(int argc, char *argv[]) :
102 - GApplication(CTSELECT_NAME, CTSELECT_VERSION, argc, argv) 96 + ctool(CTSELECT_NAME, CTSELECT_VERSION, argc, argv)
103 { 97 {
104 // Initialise members 98 // Initialise members
105 init_members(); 99 init_members();
106 100
107 - // Write header into logger  
108 - log_header();  
109 -  
110 // Return 101 // Return
111 return; 102 return;
112 } 103 }
@@ -117,7 +108,7 @@ ctselect::ctselect(int argc, char *argv[]) : @@ -117,7 +108,7 @@ ctselect::ctselect(int argc, char *argv[]) :
117 * 108 *
118 * @param[in] app Application. 109 * @param[in] app Application.
119 ***************************************************************************/ 110 ***************************************************************************/
120 -ctselect::ctselect(const ctselect& app) : GApplication(app) 111 +ctselect::ctselect(const ctselect& app) : ctool(app)
121 { 112 {
122 // Initialise members 113 // Initialise members
123 init_members(); 114 init_members();
@@ -154,13 +145,13 @@ ctselect::~ctselect(void) @@ -154,13 +145,13 @@ ctselect::~ctselect(void)
154 * 145 *
155 * @param[in] app Application. 146 * @param[in] app Application.
156 ***************************************************************************/ 147 ***************************************************************************/
157 -ctselect& ctselect::operator= (const ctselect& app) 148 +ctselect& ctselect::operator=(const ctselect& app)
158 { 149 {
159 // Execute only if object is not identical 150 // Execute only if object is not identical
160 if (this != &app) { 151 if (this != &app) {
161 152
162 // Copy base class members 153 // Copy base class members
163 - this->GApplication::operator=(app); 154 + this->ctool::operator=(app);
164 155
165 // Free members 156 // Free members
166 free_members(); 157 free_members();
@@ -191,10 +182,12 @@ void ctselect::clear(void) @@ -191,10 +182,12 @@ void ctselect::clear(void)
191 { 182 {
192 // Free members 183 // Free members
193 free_members(); 184 free_members();
  185 + this->ctool::free_members();
194 this->GApplication::free_members(); 186 this->GApplication::free_members();
195 187
196 // Initialise members 188 // Initialise members
197 this->GApplication::init_members(); 189 this->GApplication::init_members();
  190 + this->ctool::init_members();
198 init_members(); 191 init_members();
199 192
200 // Return 193 // Return
src/ctselect/ctselect.hpp
1 /*************************************************************************** 1 /***************************************************************************
2 - * ctselect - CTA data selection tool * 2 + * ctselect - Data selection 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 ctselect.hpp 22 * @file ctselect.hpp
23 - * @brief CTA data selection tool definition 23 + * @brief Data selection tool definition
24 * @author Juergen Knoedlseder 24 * @author Juergen Knoedlseder
25 */ 25 */
26 26
@@ -32,6 +32,7 @@ @@ -32,6 +32,7 @@
32 #include <string> 32 #include <string>
33 #include "GammaLib.hpp" 33 #include "GammaLib.hpp"
34 #include "GCTALib.hpp" 34 #include "GCTALib.hpp"
  35 +#include "ctool.hpp"
35 36
36 /* __Definitions _________________________________________________________ */ 37 /* __Definitions _________________________________________________________ */
37 #define CTSELECT_NAME "ctselect" 38 #define CTSELECT_NAME "ctselect"
@@ -41,9 +42,10 @@ @@ -41,9 +42,10 @@
41 /***********************************************************************//** 42 /***********************************************************************//**
42 * @class ctselect 43 * @class ctselect
43 * 44 *
44 - * @brief CTA data selection tool interface defintion. 45 + * @brief Data selection tool
45 ***************************************************************************/ 46 ***************************************************************************/
46 -class ctselect : public GApplication { 47 +class ctselect : public ctool {
  48 +
47 public: 49 public:
48 // Constructors and destructors 50 // Constructors and destructors
49 ctselect(void); 51 ctselect(void);