ctools  2.0.0
 All Classes Namespaces Files Functions Variables Macros Pages
ctool_obs.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * ctool_obs - [WHAT] tool *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) [YEAR] by [AUTHOR] *
5  * ----------------------------------------------------------------------- *
6  * *
7  * This program is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  * *
20  ***************************************************************************/
21 /**
22  * @file ctool_obs.cpp
23  * @brief [WHAT] tool implementation
24  * @author [AUTHOR]
25  */
26 
27 /* __ Includes ___________________________________________________________ */
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 #include "ctool_obs.hpp"
32 #include "GammaLib.hpp"
33 #include "GCTALib.hpp"
34 
35 /* __ OpenMP section _____________________________________________________ */
36 //#ifdef _OPENMP
37 //#include <omp.h>
38 //#endif
39 
40 /* __ Method name definitions ____________________________________________ */
41 
42 /* __ Debug definitions __________________________________________________ */
43 
44 /* __ Coding definitions _________________________________________________ */
45 
46 /* __ Constants __________________________________________________________ */
47 
48 
49 /*==========================================================================
50  = =
51  = Constructors/destructors =
52  = =
53  ==========================================================================*/
54 
55 /***********************************************************************//**
56  * @brief Void constructor
57  *
58  * Constructs empty [what] tool.
59  ***************************************************************************/
61 {
62  // Initialise members
63  init_members();
64 
65  // Return
66  return;
67 }
68 
69 
70 /***********************************************************************//**
71  * @brief Observations constructor
72  *
73  * param[in] obs Observation container.
74  *
75  * Constructs [what] tool from an observation container.
76  ***************************************************************************/
77 ctool_obs::ctool_obs(const GObservations& obs) : ctobservation(CTOOL_OBS_NAME, VERSION, obs)
78 {
79  // Initialise members
80  init_members();
81 
82  // Return
83  return;
84 }
85 
86 
87 /***********************************************************************//**
88  * @brief Command line constructor
89  *
90  * @param[in] argc Number of arguments in command line.
91  * @param[in] argv Array of command line arguments.
92  *
93  * Constructs [what] tool using command line arguments for user
94  * parameter setting.
95  ***************************************************************************/
96 ctool_obs::ctool_obs(int argc, char *argv[]) : ctobservation(CTOOL_OBS_NAME, VERSION, argc, argv)
97 {
98  // Initialise members
99  init_members();
100 
101  // Return
102  return;
103 }
104 
105 
106 /***********************************************************************//**
107  * @brief Copy constructor
108  *
109  * @param[in] app [WHAT] tool.
110  *
111  * Constructs [what] tool from another [what] tool.
112  ***************************************************************************/
114 {
115  // Initialise members
116  init_members();
117 
118  // Copy members
119  copy_members(app);
120 
121  // Return
122  return;
123 }
124 
125 
126 /***********************************************************************//**
127  * @brief Destructor
128  *
129  * Destructs [what] tool.
130  ***************************************************************************/
132 {
133  // Free members
134  free_members();
135 
136  // Return
137  return;
138 }
139 
140 
141 /*==========================================================================
142  = =
143  = Operators =
144  = =
145  ==========================================================================*/
146 
147 /***********************************************************************//**
148  * @brief Assignment operator
149  *
150  * @param[in] app [WHAT] tool.
151  * @return [WHAT] tool.
152  *
153  * Assigns [what] tool.
154  ***************************************************************************/
156 {
157  // Execute only if object is not identical
158  if (this != &app) {
159 
160  // Copy base class members
161  this->ctobservation::operator=(app);
162 
163  // Free members
164  free_members();
165 
166  // Initialise members
167  init_members();
168 
169  // Copy members
170  copy_members(app);
171 
172  } // endif: object was not identical
173 
174  // Return this object
175  return *this;
176 }
177 
178 
179 /*==========================================================================
180  = =
181  = Public methods =
182  = =
183  ==========================================================================*/
184 
185 /***********************************************************************//**
186  * @brief Clear [WHAT] tool
187  *
188  * Clears [what] tool.
189  ***************************************************************************/
191 {
192  // Free members
193  free_members();
195  this->ctool::free_members();
196 
197  // Clear base class (needed to conserve tool name and version)
198  this->GApplication::clear();
199 
200  // Initialise members
201  this->ctool::init_members();
203  init_members();
204 
205  // Write header into logger
206  log_header();
207 
208  // Return
209  return;
210 }
211 
212 
213 /***********************************************************************//**
214  * @brief Process [what] tool
215  ***************************************************************************/
217 {
218  // Get task parameters
219  get_parameters();
220 
221  // Write input observation container into logger
222  log_observations(NORMAL, m_obs, "Input observation");
223 
224  // TODO: Your code goes here
225 
226  // Return
227  return;
228 }
229 
230 
231 /***********************************************************************//**
232  * @brief Save something
233  *
234  * Saves something.
235  ***************************************************************************/
236 void ctool_obs::save(void)
237 {
238  // Write header
239  log_header1(TERSE, "Save something");
240 
241  // TODO: Your code goes here
242 
243  // Return
244  return;
245 }
246 
247 
248 /*==========================================================================
249  = =
250  = Private methods =
251  = =
252  ==========================================================================*/
253 
254 /***********************************************************************//**
255  * @brief Initialise class members
256  ***************************************************************************/
258 {
259  // Initialise members
260  // TODO: Your code goes here
261 
262  // Return
263  return;
264 }
265 
266 
267 /***********************************************************************//**
268  * @brief Copy class members
269  *
270  * @param[in] app [WHAT] tool.
271  ***************************************************************************/
273 {
274  // Copy attributes
275  // TODO: Your code goes here
276 
277  // Return
278  return;
279 }
280 
281 
282 /***********************************************************************//**
283  * @brief Delete class members
284  ***************************************************************************/
286 {
287  // Return
288  return;
289 }
290 
291 
292 /***********************************************************************//**
293  * @brief Get application parameters
294  *
295  * @todo Implement method
296  ***************************************************************************/
298 {
299  // TODO: Your code goes here
300 
301  // Write parameters into logger
302  log_parameters(TERSE);
303 
304  // Return
305  return;
306 }
ctool_obs & operator=(const ctool_obs &app)
Assignment operator.
Definition: ctool_obs.cpp:155
void init_members(void)
Initialise class members.
Definition: ctool.cpp:321
[WHAT] tool definition
void get_parameters(void)
Get application parameters.
Definition: ctool_obs.cpp:297
virtual ~ctool_obs(void)
Destructor.
Definition: ctool_obs.cpp:131
void copy_members(const ctool_obs &app)
Copy class members.
Definition: ctool_obs.cpp:272
void init_members(void)
Initialise class members.
Definition: ctool_obs.cpp:257
[WHAT] tool
Definition: ctool_obs.hpp:44
void log_parameters(const GChatter &chatter)
Log application parameters.
Definition: ctool.cpp:1208
void free_members(void)
Delete class members.
Definition: ctool_obs.cpp:285
Base class for observation tools.
void clear(void)
Clear [WHAT] tool.
Definition: ctool_obs.cpp:190
void free_members(void)
Delete class members.
void free_members(void)
Delete class members.
Definition: ctool.cpp:357
void init_members(void)
Initialise class members.
void save(void)
Save something.
Definition: ctool_obs.cpp:236
ctobservation & operator=(const ctobservation &app)
Assignment operator.
#define CTOOL_OBS_NAME
Definition: ctool_obs.hpp:34
void log_observations(const GChatter &chatter, const GObservations &obs, const std::string &what="Observation")
Log observation container.
Definition: ctool.cpp:1251
GObservations m_obs
Observation container.
ctool_obs(void)
Void constructor.
Definition: ctool_obs.cpp:60
void process(void)
Process [what] tool.
Definition: ctool_obs.cpp:216