GammaLib 2.0.0
Loading...
Searching...
No Matches
GMWLObservation.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GMWLObservation.hpp - Multi-wavelength observation class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2010-2016 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 GMWLObservation.hpp
23 * @brief Multi-wavelength observation class interface definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GMWLOBSERVATION_HPP
28#define GMWLOBSERVATION_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include "GTime.hpp"
33#include "GFilename.hpp"
34#include "GObservation.hpp"
35#include "GMWLResponse.hpp"
36
37/* __ Forward declarations _______________________________________________ */
38class GResponse;
39class GXmlElement;
40
41
42/***********************************************************************//**
43 * @class GMWLObservation
44 *
45 * @brief Interface class for multi-wavelength observations
46 *
47 * This class implements a multi-wavelength observation. A multi-wavelength
48 * observation contains spectral points obtained with an unspecified
49 * instrument. The spectral points are given in physical units.
50 ***************************************************************************/
52
53public:
54 // Constructors and destructors
55 GMWLObservation(void);
56 explicit GMWLObservation(const GFilename& filename);
58 virtual ~GMWLObservation(void);
59
60 // Operators
61 virtual GMWLObservation& operator= (const GMWLObservation& obs);
62
63 // Implement pure virtual methods
64 virtual void clear(void);
65 virtual GMWLObservation* clone(void) const;
66 virtual std::string classname(void) const;
67 virtual void response(const GResponse& rsp);
68 virtual const GMWLResponse* response(void) const;
69 virtual std::string instrument(void) const;
70 virtual double ontime(void) const;
71 virtual double livetime(void) const;
72 virtual double deadc(const GTime& time = GTime()) const;
73 virtual void read(const GXmlElement& xml);
74 virtual void write(GXmlElement& xml) const;
75 virtual std::string print(const GChatter& chatter = NORMAL) const;
76
77 // Other methods
78 void load(const GFilename& filename);
79 const GFilename& filename(void) const;
80 void filename(const GFilename& filename);
81
82protected:
83 // Protected methods
84 void init_members(void);
85 void copy_members(const GMWLObservation& obs);
86 void free_members(void);
87
88 // Protected members
89 std::string m_instrument; //!< Instrument name
90 GFilename m_filename; //!< Filename
91 GMWLResponse m_response; //!< Response function
92};
93
94
95/***********************************************************************//**
96 * @brief Return class name
97 *
98 * @return String containing the class name ("GMWLObservation").
99 ***************************************************************************/
100inline
101std::string GMWLObservation::classname(void) const
102{
103 return ("GMWLObservation");
104}
105
106
107/***********************************************************************//**
108 * @brief Return response
109 *
110 * @return Response.
111 ***************************************************************************/
112inline
114{
115 return &m_response;
116}
117
118
119/***********************************************************************//**
120 * @brief Return instrument name
121 *
122 * @return Instrument name.
123 ***************************************************************************/
124inline
125std::string GMWLObservation::instrument(void) const
126{
127 return "MWL";
128}
129
130
131/***********************************************************************//**
132 * @brief Return ontime
133 *
134 * @return Ontime (always 1).
135 ***************************************************************************/
136inline
137double GMWLObservation::ontime(void) const
138{
139 return 1.0;
140}
141
142
143/***********************************************************************//**
144 * @brief Return livetime
145 *
146 * @return Livetime (always 1).
147 ***************************************************************************/
148inline
150{
151 return 1.0;
152}
153
154
155/***********************************************************************//**
156 * @brief Return deadtime correction factor
157 *
158 * @return Deadtime correction factor (always 1).
159 ***************************************************************************/
160inline
161double GMWLObservation::deadc(const GTime& time) const
162{
163 return 1.0;
164}
165
166
167/***********************************************************************//**
168 * @brief Return filename
169 *
170 * @return Filename.
171 ***************************************************************************/
172inline
174{
175 return (m_filename);
176}
177
178
179/***********************************************************************//**
180 * @brief Set filename
181 *
182 * @param[in] filename Filename.
183 ***************************************************************************/
184inline
186{
188 return;
189}
190
191#endif /* GMWLOBSERVATION_HPP */
Filename class interface definition.
Multi-wavelength response class interface definition.
Abstract observation base class interface definition.
Time class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
Filename class.
Definition GFilename.hpp:62
Interface class for multi-wavelength observations.
GMWLResponse m_response
Response function.
virtual std::string classname(void) const
Return class name.
virtual void clear(void)
Clear instance.
const GFilename & filename(void) const
Return filename.
virtual std::string instrument(void) const
Return instrument name.
virtual double ontime(void) const
Return ontime.
GFilename m_filename
Filename.
virtual double livetime(void) const
Return livetime.
void load(const GFilename &filename)
Load observation.
virtual GMWLObservation & operator=(const GMWLObservation &obs)
Assignment operator.
GMWLObservation(void)
Void constructor.
void free_members(void)
Delete class members.
virtual GMWLObservation * clone(void) const
Clone instance.
void init_members(void)
Initialise class members.
virtual const GMWLResponse * response(void) const
Return response.
virtual double deadc(const GTime &time=GTime()) const
Return deadtime correction factor.
void copy_members(const GMWLObservation &obs)
Copy class members.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print multi-wavelength information.
virtual void write(GXmlElement &xml) const
Write observation into XML element.
virtual ~GMWLObservation(void)
Destructor.
std::string m_instrument
Instrument name.
virtual void read(const GXmlElement &xml)
Read observation from XML element.
Multi-wavelength response class.
Abstract observation base class.
Abstract instrument response base class.
Definition GResponse.hpp:77
Time class.
Definition GTime.hpp:55
XML element node class.