ctools 2.1.0.dev
Loading...
Searching...
No Matches
cttsmap.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * cttsmap - TS map calculation tool *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2014-2022 by Michael Mayer *
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 cttsmap.hpp
23 * @brief TS map calculation tool interface definition
24 * @author Michael Mayer
25 */
26
27#ifndef CTTSMAP_HPP
28#define CTTSMAP_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include "ctlikelihood.hpp"
32
33/* __Definitions _________________________________________________________ */
34#define CTTSMAP_NAME "cttsmap"
35
36
37/***********************************************************************//**
38 * @class cttsmap
39 *
40 * @brief TS map calculation tool
41 *
42 * This class computes a set of maps from any kind of observations:
43 *
44 * - TS map
45 * - Flux map
46 * - Map of spectral index
47 *
48 * The class operates on predefined observation containers, an individual
49 * event list or an observation definition XML file.
50 *
51 * During the computation a putative point-like source is moved along a
52 * grid of coordinates. The best fit results (TS, flux, index) are stored in
53 * maps which are saved in the output FITS files.
54 ***************************************************************************/
55class cttsmap : public ctlikelihood {
56
57public:
58 // Constructors and destructors
59 cttsmap(void);
60 explicit cttsmap(const GObservations& obs);
61 cttsmap(int argc, char *argv[]);
62 cttsmap(const cttsmap& app);
63 virtual ~cttsmap(void);
64
65 // Operators
66 cttsmap& operator=(const cttsmap& app);
67
68 // Methods
69 void clear(void);
70 void process(void);
71 void save(void);
72 void publish(const std::string& name = "");
73 const GSkyMap& tsmap(void) const;
74
75protected:
76 // Protected methods
77 void init_members(void);
78 void copy_members(const cttsmap& app);
79 void free_members(void);
80 void get_parameters(void);
81 void init_maps(const GSkyMap& map);
82
83 // User parameters
84 std::string m_srcname; //!< Name of source which is moved around
85 GFilename m_outmap; //!< Output TS map file name
86 bool m_apply_edisp; //!< Apply energy dispersion?
87 bool m_publish; //!< Publish TS map?
88 bool m_errors; //!< Compute and store parameter errors?
89
90 // Parameters to control speed and job splitting
91 int m_binmin; //!< Map bin number from which computation should start
92 int m_binmax; //!< Map bin number where map computation should end
93 double m_logL0; //!< Likelihood value of null hypothesis
94
95 // Protected members
96 GSkyMap m_tsmap; //!< TS map
97 GSkyMap m_statusmap; //!< Map of optimizer fit status
98 std::vector<std::string> m_mapnames; //!< Names of free parameters
99 std::vector<GSkyMap> m_maps; //!< Sky maps for each free parameter
100 GModel* m_testsource; //!< Pointer to test source for TS computation
101};
102
103
104/***********************************************************************//**
105 * @brief Return TS skymap
106 *
107 * @return Reference to TS skymap
108 ***************************************************************************/
109inline
110const GSkyMap& cttsmap::tsmap(void) const
111{
112 return m_tsmap;
113}
114
115#endif /* CTTSMAP_HPP */
Base class for likelihood tools.
const GObservations & obs(void) const
Return observation container.
TS map calculation tool.
Definition cttsmap.hpp:55
std::string m_srcname
Name of source which is moved around.
Definition cttsmap.hpp:84
int m_binmax
Map bin number where map computation should end.
Definition cttsmap.hpp:92
cttsmap & operator=(const cttsmap &app)
Assignment operator.
Definition cttsmap.cpp:145
void save(void)
Save maps.
Definition cttsmap.cpp:396
void free_members(void)
Delete class members.
Definition cttsmap.cpp:540
void clear(void)
Clear instance.
Definition cttsmap.cpp:178
GSkyMap m_statusmap
Map of optimizer fit status.
Definition cttsmap.hpp:97
bool m_errors
Compute and store parameter errors?
Definition cttsmap.hpp:88
void copy_members(const cttsmap &app)
Copy class members.
Definition cttsmap.cpp:510
int m_binmin
Map bin number from which computation should start.
Definition cttsmap.hpp:91
std::vector< std::string > m_mapnames
Names of free parameters.
Definition cttsmap.hpp:98
bool m_apply_edisp
Apply energy dispersion?
Definition cttsmap.hpp:86
GSkyMap m_tsmap
TS map.
Definition cttsmap.hpp:96
void init_members(void)
Initialise class members.
Definition cttsmap.cpp:481
bool m_publish
Publish TS map?
Definition cttsmap.hpp:87
cttsmap(void)
Void constructor.
Definition cttsmap.cpp:54
double m_logL0
Likelihood value of null hypothesis.
Definition cttsmap.hpp:93
const GSkyMap & tsmap(void) const
Return TS skymap.
Definition cttsmap.hpp:110
std::vector< GSkyMap > m_maps
Sky maps for each free parameter.
Definition cttsmap.hpp:99
void publish(const std::string &name="")
Publish TS map.
Definition cttsmap.cpp:450
GFilename m_outmap
Output TS map file name.
Definition cttsmap.hpp:85
virtual ~cttsmap(void)
Destructor.
Definition cttsmap.cpp:123
GModel * m_testsource
Pointer to test source for TS computation.
Definition cttsmap.hpp:100
void init_maps(const GSkyMap &map)
Initialise skymaps.
Definition cttsmap.cpp:633
void get_parameters(void)
Get application parameters.
Definition cttsmap.cpp:561
void process(void)
Computes the TS maps.
Definition cttsmap.cpp:207
Likelihood tool base class interface definition.