GammaLib 2.0.0
Loading...
Searching...
No Matches
GCTAPointing.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCTAPointing.hpp - CTA pointing class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2010-2019 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 GCTAPointing.hpp
23 * @brief CTA pointing class interface definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GCTAPOINTING_HPP
28#define GCTAPOINTING_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include "GMatrix.hpp"
33#include "GNodeArray.hpp"
34#include "GSkyDir.hpp"
35
36/* __ Forward declarations _______________________________________________ */
37class GFilename;
38class GXmlElement;
39class GCTAInstDir;
40
41
42/***********************************************************************//**
43 * @class GCTAPointing
44 *
45 * @brief CTA pointing class.
46 *
47 * This class implements a CTA pointing. For the time being it is assumed
48 * that the pointing direction is time-independent.
49 *
50 * @todo No transformation from sky coordinates to geographic coordinates
51 * has so far been implemented. The azimuth and zenith angle are not
52 * meaningful.
53 ***************************************************************************/
54class GCTAPointing : public GBase {
55
56public:
57 // Constructors and destructors
58 GCTAPointing(void);
59 explicit GCTAPointing(const GSkyDir& dir);
60 explicit GCTAPointing(const GXmlElement& xml);
61 GCTAPointing(const GCTAPointing& pnt);
62 virtual ~GCTAPointing(void);
63
64 // Operators
65 virtual GCTAPointing& operator=(const GCTAPointing& pnt);
66
67 // Methods
68 void clear(void);
69 GCTAPointing* clone(void) const;
70 std::string classname(void) const;
71 const bool& is_valid(void) const;
72 const GSkyDir& dir(void) const;
73 void dir(const GSkyDir& dir);
74 GCTAInstDir instdir(const GSkyDir& skydir) const;
75 GSkyDir skydir(const GCTAInstDir& instdir) const;
76 const GMatrix& rot(void) const;
77 const double& zenith(void) const;
78 const double& azimuth(void) const;
79 void zenith(const double& zenith);
80 void azimuth(const double& azimuth);
81 void read(const GXmlElement& xml);
82 void write(GXmlElement& xml) const;
83 std::string print(const GChatter& chatter = NORMAL) const;
84
85protected:
86 // Protected methods
87 void init_members(void);
88 void copy_members(const GCTAPointing& pnt);
89 void free_members(void);
90 void update(void) const;
91
92 // Protected members
93 GSkyDir m_dir; //!< Pointing direction in sky coordinates
94 bool m_valid; //!< Validity flag
95 double m_zenith; //!< Pointing zenith angle (deg)
96 double m_azimuth; //!< Pointing azimuth angle (deg)
97
98 // Cached members
99 mutable bool m_has_cache; //!< Has transformation cache
100 mutable GMatrix m_Rback; //!< Rotation matrix
101};
102
103
104/***********************************************************************//**
105 * @brief Return class name
106 *
107 * @return String containing the class name ("GCTAPointing").
108 ***************************************************************************/
109inline
110std::string GCTAPointing::classname(void) const
111{
112 return ("GCTAPointing");
113}
114
115
116/***********************************************************************//**
117 * @brief Return pointing sky direction
118 *
119 * @return Pointing sky direction.
120 ***************************************************************************/
121inline
122const GSkyDir& GCTAPointing::dir(void) const
123{
124 return m_dir;
125}
126
127
128/***********************************************************************//**
129 * @brief Return pointing zenith angle
130 *
131 * @return Pointing zenith angle (deg).
132 ***************************************************************************/
133inline
134const double& GCTAPointing::zenith(void) const
135{
136 return m_zenith;
137}
138
139
140/***********************************************************************//**
141 * @brief Return pointing azimuth angle
142 *
143 * @return Pointing azimuth angle (deg).
144 ***************************************************************************/
145inline
146const double& GCTAPointing::azimuth(void) const
147{
148 return m_azimuth;
149}
150
151/***********************************************************************//**
152 * @brief assign zenith angle
153 *
154 * @param[in] zenith The zenith angle (deg).
155 ***************************************************************************/
156inline
157void GCTAPointing::zenith(const double& zenith)
158{
160}
161
162
163/***********************************************************************//**
164 * @brief assign azimuth angle
165 *
166 * @param[in] azimuth The azimuth angle (deg).
167 ***************************************************************************/
168inline
169void GCTAPointing::azimuth(const double& azimuth)
170{
172}
173
174
175/***********************************************************************//**
176 * @brief Checks if pointing is valid
177 *
178 * @return True if pointing information is valid.
179 ***************************************************************************/
180inline
181const bool& GCTAPointing::is_valid(void) const
182{
183 return m_valid;
184}
185
186#endif /* GCTAPOINTING_HPP */
Generic matrix class definition.
Node array class interface definition.
Sky direction class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
Interface class for all GammaLib classes.
Definition GBase.hpp:52
CTA instrument direction class.
CTA pointing class.
std::string classname(void) const
Return class name.
const double & zenith(void) const
Return pointing zenith angle.
virtual ~GCTAPointing(void)
Destructor.
void free_members(void)
Delete class members.
double m_zenith
Pointing zenith angle (deg)
GSkyDir m_dir
Pointing direction in sky coordinates.
std::string print(const GChatter &chatter=NORMAL) const
Print CTA pointing information.
const GMatrix & rot(void) const
Return rotation matrix.
void read(const GXmlElement &xml)
Read pointing from XML element.
GCTAInstDir instdir(const GSkyDir &skydir) const
Get instrument direction from sky direction.
bool m_has_cache
Has transformation cache.
double m_azimuth
Pointing azimuth angle (deg)
const GSkyDir & dir(void) const
Return pointing sky direction.
const bool & is_valid(void) const
Checks if pointing is valid.
void update(void) const
Update coordinate transformation cache.
GCTAPointing * clone(void) const
Clone CTA pointing.
GCTAPointing(void)
Void constructor.
bool m_valid
Validity flag.
virtual GCTAPointing & operator=(const GCTAPointing &pnt)
Assignment operator.
void copy_members(const GCTAPointing &pnt)
Copy class members.
const double & azimuth(void) const
Return pointing azimuth angle.
GSkyDir skydir(const GCTAInstDir &instdir) const
Get sky direction direction from instrument direction.
void clear(void)
Clear CTA pointing.
void init_members(void)
Initialise class members.
GMatrix m_Rback
Rotation matrix.
void write(GXmlElement &xml) const
Write pointing information into XML element.
Filename class.
Definition GFilename.hpp:62
Generic matrix class definition.
Definition GMatrix.hpp:79
Sky direction class.
Definition GSkyDir.hpp:62
XML element node class.