GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GModelSpatialRadialProfileGauss.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GModelSpatialRadialProfileGauss.hpp - Gaussian radial profile class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2016-2018 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 GModelSpatialRadialProfileGauss.hpp
23  * @brief Radial Gaussian profile model class interface definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GMODELSPATIALRADIALPROFILEGAUSS_HPP
28 #define GMODELSPATIALRADIALPROFILEGAUSS_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
33 #include "GModelPar.hpp"
34 
35 /* __ Forward declaration ________________________________________________ */
36 class GXmlElement;
37 
38 
39 /**************************************************************************
40  * @class GModelSpatialRadialProfileGauss
41  *
42  * @brief Radial Gaussian profile source model class
43  *
44  * This class implements the spatial component of the factorised source
45  * model for a Gaussian radial profile.
46  ***************************************************************************/
48 
49 public:
50  // Constructors and destructors
52  explicit GModelSpatialRadialProfileGauss(const GXmlElement& xml);
53  GModelSpatialRadialProfileGauss(const GSkyDir& dir, const double& sigma);
56 
57  // Operators
59 
60  // Implemented pure virtual base class methods
61  virtual void clear(void);
62  virtual GModelSpatialRadialProfileGauss* clone(void) const;
63  virtual std::string classname(void) const;
64  virtual std::string type(void) const;
65  virtual double theta_min(void) const;
66  virtual double theta_max(void) const;
67  virtual void read(const GXmlElement& xml);
68  virtual void write(GXmlElement& xml) const;
69  virtual std::string print(const GChatter& chatter = NORMAL) const;
70 
71  // Other methods
72  double sigma(void) const;
73  void sigma(const double& sigma);
74 
75 protected:
76  // Protected methods
77  void init_members(void);
79  void free_members(void);
80  virtual double profile_value(const double& theta) const;
81 
82  // Protected members
83  GModelPar m_sigma; //!< Gaussian width (deg)
84 };
85 
86 
87 /***********************************************************************//**
88  * @brief Return class name
89  *
90  * @return String containing the class name ("GModelSpatialRadialProfileGauss").
91  ***************************************************************************/
92 inline
94 {
95  return ("GModelSpatialRadialProfileGauss");
96 }
97 
98 
99 /***********************************************************************//**
100  * @brief Return model type
101  *
102  * @return "GaussianProfile".
103  *
104  * Returns the type of the radial profile model.
105  ***************************************************************************/
106 inline
108 {
109  return "GaussianProfile";
110 }
111 
112 
113 /***********************************************************************//**
114  * @brief Return Gaussian sigma
115  *
116  * @return Gaussian sigma (degrees).
117  *
118  * Returns the Gaussian sigma in degrees.
119  ***************************************************************************/
120 inline
122 {
123  return (m_sigma.value());
124 }
125 
126 
127 /***********************************************************************//**
128  * @brief Set Gaussian sigma
129  *
130  * @param[in] sigma Gaussian sigma (degrees).
131  *
132  * Sets the Gaussian sigma in degrees.
133  ***************************************************************************/
134 inline
135 void GModelSpatialRadialProfileGauss::sigma(const double& sigma)
136 {
137  m_sigma.value(sigma);
138  return;
139 }
140 
141 
142 #endif /* GMODELSPATIALRADIALPROFILEGAUSS_HPP */
virtual GModelSpatialRadialProfileGauss & operator=(const GModelSpatialRadialProfileGauss &model)
Assignment operator.
void free_members(void)
Delete class members.
virtual void write(GXmlElement &xml) const
Write model into XML element.
XML element node class.
Definition: GXmlElement.hpp:47
virtual double theta_min(void) const
Return maximum model radius (in radians)
Radial profile model class interface definition.
virtual double theta_max(void) const
Return maximum model radius (in radians)
Model parameter class interface definition.
Model parameter class.
Definition: GModelPar.hpp:87
GChatter
Definition: GTypemaps.hpp:33
void init_members(void)
Initialise class members.
virtual void clear(void)
Clear radial Gaussian profile model.
virtual ~GModelSpatialRadialProfileGauss(void)
Destructor.
double sigma(void) const
Return Gaussian sigma.
GSkyDir dir(void) const
Return position of radial spatial model.
virtual std::string classname(void) const
Return class name.
virtual GModelSpatialRadialProfileGauss * clone(void) const
Clone radial Gaussian profile model.
double value(void) const
Return parameter value.
virtual std::string type(void) const
Return model type.
virtual double profile_value(const double &theta) const
Radial profile.
void copy_members(const GModelSpatialRadialProfileGauss &model)
Copy class members.
Sky direction class.
Definition: GSkyDir.hpp:62
virtual void read(const GXmlElement &xml)
Read model from XML element.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print information.