Commit 66892c1a454f4cc1bb9710e693c0d78e11dbfe16

Authored by Jürgen Knödlseder
1 parent 378c62cb

ctcubemask now derives from ctool base class.

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