GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCOMBvc.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GCOMBvc.hpp - COMPTEL Solar System Barycentre Data class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2022 by Juergen Knodlseder *
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 GCOMBvc.hpp
23  * @brief COMPTEL Solar System Barycentre Data class definition
24  * @author Juergen Knodlseder
25  */
26 
27 #ifndef GCOMBVC_HPP
28 #define GCOMBVC_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include "GBase.hpp"
33 #include "GTime.hpp"
34 #include "GVector.hpp"
35 #include "GSkyDir.hpp"
36 
37 /* __ Forward declarations _______________________________________________ */
38 
39 /* __ Constants __________________________________________________________ */
40 
41 
42 /***********************************************************************//**
43  * @class GCOMBvc
44  *
45  * @brief COMPTEL Solar System Barycentre Data class
46  *
47  * The class holds one record of a COMPTEL Solar System Barycentre Data file.
48  ***************************************************************************/
49 class GCOMBvc : public GBase {
50 
51 public:
52  // Constructors and destructors
53  GCOMBvc(void);
54  GCOMBvc(const GCOMBvc& bvc);
55  virtual ~GCOMBvc(void);
56 
57  // Operators
58  GCOMBvc& operator=(const GCOMBvc& bvc);
59 
60  // Implemented pure virtual base class methods
61  virtual void clear(void);
62  virtual GCOMBvc* clone(void) const;
63  virtual std::string classname(void) const;
64  virtual std::string print(const GChatter& chatter = NORMAL) const;
65 
66  // Other methods
67  const GTime& time(void) const;
68  void time(const GTime& time);
69  const int& tjd(void) const;
70  void tjd(const int& tjd);
71  const int& tics(void) const;
72  void tics(const int& tics);
73  const GVector& ssb(void) const;
74  void ssb(const GVector& ssb);
75  const double& tdelta(void) const;
76  void tdelta(const double& tdelta);
77  double tdelta(const GSkyDir& dir) const;
78 
79 protected:
80  // Protected methods
81  void init_members(void);
82  void copy_members(const GCOMBvc& bvc);
83  void free_members(void);
84 
85  // Protected members
86  GTime m_time; //!< Time for Solar System Barycentre Data
87  int m_tjd; //!< TJD of Solar System Barycentre Data
88  int m_tics; //!< Tics of Solar System Barycentre Data
89  GVector m_ssb; //!< Solar System Barycentre vector in celestial system (micro seconds)
90  double m_tdelta; //!< Time difference TDB-UTC (sec)
91 };
92 
93 
94 /***********************************************************************//**
95  * @brief Return class name
96  *
97  * @return String containing the class name ("GCOMBvc").
98  ***************************************************************************/
99 inline
100 std::string GCOMBvc::classname(void) const
101 {
102  return ("GCOMBvc");
103 }
104 
105 
106 /***********************************************************************//**
107  * @brief Return time of Solar System Barycentre Data
108  *
109  * @return Time of Solar System Barycentre Data.
110  *
111  * Returns the time of the Solar System Barycentre Data. The time is defined
112  * as the mid-point of the corresponding superpacket.
113  ***************************************************************************/
114 inline
115 const GTime& GCOMBvc::time(void) const
116 {
117  return (m_time);
118 }
119 
120 
121 /***********************************************************************//**
122  * @brief Set time of Solar System Barycentre Data
123  *
124  * @param[in] time Time of Solar System Barycentre Data.
125  *
126  * Set the time of the Solar System Barycentre Data. The time is defined as
127  * the mid-point of the corresponding superpacket.
128  ***************************************************************************/
129 inline
130 void GCOMBvc::time(const GTime& time)
131 {
132  m_time = time;
133  return;
134 }
135 
136 
137 /***********************************************************************//**
138  * @brief Return Truncated Julian Days of Solar System Barycentre Data
139  *
140  * @return Truncated Julian Days of Solar System Barycentre Data.
141  *
142  * Returns the Truncated Julian Days of Solar System Barycentre Data.
143  ***************************************************************************/
144 inline
145 const int& GCOMBvc::tjd(void) const
146 {
147  return (m_tjd);
148 }
149 
150 
151 /***********************************************************************//**
152  * @brief Set Truncated Julian Days of Solar System Barycentre Data
153  *
154  * @param[in] tjd Truncated Julian Days of Solar System Barycentre Data.
155  *
156  * Set the Truncated Julian Days of the Solar System Barycentre Data.
157  ***************************************************************************/
158 inline
159 void GCOMBvc::tjd(const int& tjd)
160 {
161  m_tjd = tjd;
162  return;
163 }
164 
165 
166 /***********************************************************************//**
167  * @brief Return tics of Solar System Barycentre Data
168  *
169  * @return Tics of Solar System Barycentre Data.
170  *
171  * Returns the tics of the Solar System Barycentre Data.
172  ***************************************************************************/
173 inline
174 const int& GCOMBvc::tics(void) const
175 {
176  return (m_tics);
177 }
178 
179 
180 /***********************************************************************//**
181  * @brief Set tics of Solar System Barycentre Data
182  *
183  * @param[in] tics Tics of Solar System Barycentre Data.
184  *
185  * Set the tics of the Solar System Barycentre Data.
186  ***************************************************************************/
187 inline
188 void GCOMBvc::tics(const int& tics)
189 {
190  m_tics = tics;
191  return;
192 }
193 
194 
195 /***********************************************************************//**
196  * @brief Return Solar System Barycentre vector
197  *
198  * @return Solar System Barycentre vector (micro seconds).
199  *
200  * Returns the Solar System Barycentre vector in micro seconds. The vector
201  * is given in the celestial system. It's length specifies the light travel
202  * time in micro seconds.
203  ***************************************************************************/
204 inline
205 const GVector& GCOMBvc::ssb(void) const
206 {
207  return (m_ssb);
208 }
209 
210 
211 /***********************************************************************//**
212  * @brief Set Solar System Barycentre vector
213  *
214  * @param[in] ssb Solar System Barycentre vector (micro seconds).
215  *
216  * Set the Solar System Barycentre vector in micro seconds. The vector is
217  * defined in the celestial system. It's length specifies the light travel
218  * time in micro seconds.
219  ***************************************************************************/
220 inline
221 void GCOMBvc::ssb(const GVector& ssb)
222 {
223  m_ssb = ssb;
224  return;
225 }
226 
227 
228 /***********************************************************************//**
229  * @brief Return TDB-UTC time difference
230  *
231  * @return TDB-UTC time difference (s).
232  *
233  * Returns the TDB-UTC time difference in seconds.
234  ***************************************************************************/
235 inline
236 const double& GCOMBvc::tdelta(void) const
237 {
238  return (m_tdelta);
239 }
240 
241 
242 /***********************************************************************//**
243  * @brief Set TDB-UTC time difference
244  *
245  * @param[in] tdelta TDB-UTC time difference (s).
246  *
247  * Set the TDB-UTC time difference.
248  ***************************************************************************/
249 inline
250 void GCOMBvc::tdelta(const double& tdelta)
251 {
252  m_tdelta = tdelta;
253  return;
254 }
255 
256 #endif /* GCOMBVC_HPP */
virtual ~GCOMBvc(void)
Destructor.
Definition: GCOMBvc.cpp:84
GTime m_time
Time for Solar System Barycentre Data.
Definition: GCOMBvc.hpp:86
void init_members(void)
Initialise class members.
Definition: GCOMBvc.cpp:276
Sky direction class interface definition.
COMPTEL Solar System Barycentre Data class.
Definition: GCOMBvc.hpp:49
Definition of interface for all GammaLib classes.
void copy_members(const GCOMBvc &bvc)
Copy class members.
Definition: GCOMBvc.cpp:295
Time class.
Definition: GTime.hpp:55
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Solar System Barycentre Data.
Definition: GCOMBvc.cpp:238
double m_tdelta
Time difference TDB-UTC (sec)
Definition: GCOMBvc.hpp:90
int m_tjd
TJD of Solar System Barycentre Data.
Definition: GCOMBvc.hpp:87
virtual void clear(void)
Clear COMPTEL Solar System Barycentre Data.
Definition: GCOMBvc.cpp:136
GCOMBvc(void)
Void constructor.
Definition: GCOMBvc.cpp:53
Interface class for all GammaLib classes.
Definition: GBase.hpp:52
virtual GCOMBvc * clone(void) const
Clone COMPTEL Solar System Barycentre Data.
Definition: GCOMBvc.cpp:154
GChatter
Definition: GTypemaps.hpp:33
GVector m_ssb
Solar System Barycentre vector in celestial system (micro seconds)
Definition: GCOMBvc.hpp:89
Vector class interface definition.
const GVector & ssb(void) const
Return Solar System Barycentre vector.
Definition: GCOMBvc.hpp:205
const GTime & time(void) const
Return time of Solar System Barycentre Data.
Definition: GCOMBvc.hpp:115
const int & tjd(void) const
Return Truncated Julian Days of Solar System Barycentre Data.
Definition: GCOMBvc.hpp:145
Vector class.
Definition: GVector.hpp:46
virtual std::string classname(void) const
Return class name.
Definition: GCOMBvc.hpp:100
const double & tdelta(void) const
Return TDB-UTC time difference.
Definition: GCOMBvc.hpp:236
int m_tics
Tics of Solar System Barycentre Data.
Definition: GCOMBvc.hpp:88
Sky direction class.
Definition: GSkyDir.hpp:62
Time class interface definition.
void free_members(void)
Delete class members.
Definition: GCOMBvc.cpp:312
GCOMBvc & operator=(const GCOMBvc &bvc)
Assignment operator.
Definition: GCOMBvc.cpp:106
const int & tics(void) const
Return tics of Solar System Barycentre Data.
Definition: GCOMBvc.hpp:174