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