ctools  2.0.0
 All Classes Namespaces Files Functions Variables Macros Pages
ctmapcube.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * ctmapcube - Map cube generation tool *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2016-2022 by Juergen Knoedlseder *
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 ctmapcube.hpp
23  * @brief Map cube generation tool definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef CTMAPCUBE_HPP
28 #define CTMAPCUBE_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include "GammaLib.hpp"
32 #include "GCTALib.hpp"
33 #include "ctool.hpp"
34 
35 /* __Definitions _________________________________________________________ */
36 #define CTMAPCUBE_NAME "ctmapcube"
37 
38 
39 /***********************************************************************//**
40  * @class ctmapcube
41  *
42  * @brief Map cube generation tool
43  ***************************************************************************/
44 class ctmapcube : public ctool {
45 
46 public:
47  // Constructors and destructors
48  ctmapcube(void);
49  ctmapcube(int argc, char *argv[]);
50  ctmapcube(const ctmapcube& app);
51  virtual ~ctmapcube(void);
52 
53  // Operators
54  ctmapcube& operator=(const ctmapcube& app);
55 
56  // Methods
57  void clear(void);
58  void process(void);
59  void save(void);
60  void publish(const std::string& name = "");
61  const GModelSpatialDiffuseCube& mapcube(void) const;
62  void models(const GModels& models);
63 
64 protected:
65  // Protected methods
66  void init_members(void);
67  void copy_members(const ctmapcube& app);
68  void free_members(void);
69  void get_parameters(void);
70  void create_cube(void);
71  void add_model(GModelSky* model);
72  void add_ptsrc_model(GModelSky* model);
73  void get_bounding_circle(GModelSky* model,
74  GSkyDir* dir,
75  double* radius) const;
76 
77  // User parameters
78  GFilename m_outcube; //!< Output map cube filename
79  double m_ptsrcsig; //!< Point source sigma (arcmin)
80  bool m_publish; //!< Publish map cube?
81  GChatter m_chatter; //!< Chattiness
82 
83  // Protected members
84  GModels m_models; //!< Model container
85  GModelSpatialDiffuseCube m_cube; //!< Map cube
86 };
87 
88 
89 /***********************************************************************//**
90  * @brief Return map cube
91  *
92  * @return Map cube
93  ***************************************************************************/
94 inline
95 const GModelSpatialDiffuseCube& ctmapcube::mapcube(void) const
96 {
97  return (m_cube);
98 }
99 
100 
101 /***********************************************************************//**
102  * @brief Set models
103  *
104  * @param[in] models Model container.
105  *
106  * Set model container to be used for map cube generation.
107  ***************************************************************************/
108 inline
109 void ctmapcube::models(const GModels& models)
110 {
111  m_models = models;
112  return;
113 }
114 
115 #endif /* CTMAPCUBE_HPP */
void clear(void)
Clear ctmapcube tool.
Definition: ctmapcube.cpp:158
void free_members(void)
Delete class members.
Definition: ctmapcube.cpp:325
void init_members(void)
Initialise class members.
Definition: ctmapcube.cpp:283
void save(void)
Save map cube.
Definition: ctmapcube.cpp:215
virtual ~ctmapcube(void)
Destructor.
Definition: ctmapcube.cpp:101
void get_bounding_circle(GModelSky *model, GSkyDir *dir, double *radius) const
Get bounding circle for a sky model.
Definition: ctmapcube.cpp:583
void publish(const std::string &name="")
Publish map cube.
Definition: ctmapcube.cpp:252
void process(void)
Generate map cube.
Definition: ctmapcube.cpp:185
ctmapcube(void)
Void constructor.
Definition: ctmapcube.cpp:53
Base class for ctools.
Definition: ctool.hpp:50
GModels m_models
Model container.
Definition: ctmapcube.hpp:84
GFilename m_outcube
Output map cube filename.
Definition: ctmapcube.hpp:78
void copy_members(const ctmapcube &app)
Copy class members.
Definition: ctmapcube.cpp:305
const GModelSpatialDiffuseCube & mapcube(void) const
Return map cube.
Definition: ctmapcube.hpp:95
GChatter m_chatter
Chattiness.
Definition: ctmapcube.hpp:81
ctool base class implementation
ctmapcube & operator=(const ctmapcube &app)
Assignment operator.
Definition: ctmapcube.cpp:123
GModelSpatialDiffuseCube m_cube
Map cube.
Definition: ctmapcube.hpp:85
Map cube generation tool.
Definition: ctmapcube.hpp:44
void add_model(GModelSky *model)
Add one model to map cube.
Definition: ctmapcube.cpp:440
double m_ptsrcsig
Point source sigma (arcmin)
Definition: ctmapcube.hpp:79
void create_cube(void)
Generate map cube.
Definition: ctmapcube.cpp:393
void models(const GModels &models)
Set models.
Definition: ctmapcube.hpp:109
void add_ptsrc_model(GModelSky *model)
Add one point source model to map cube.
Definition: ctmapcube.cpp:492
bool m_publish
Publish map cube?
Definition: ctmapcube.hpp:80
void get_parameters(void)
Get application parameters.
Definition: ctmapcube.cpp:338