GammaLib  2.1.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-2020 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 double theta_min(void) const;
65  virtual double theta_max(void) const;
66  virtual void read(const GXmlElement& xml);
67  virtual void write(GXmlElement& xml) const;
68  virtual std::string print(const GChatter& chatter = NORMAL) const;
69 
70  // Other methods
71  double sigma(void) const;
72  void sigma(const double& sigma);
73 
74 protected:
75  // Protected methods
76  void init_members(void);
78  void free_members(void);
79  virtual double profile_value(const double& theta) const;
80 
81  // Protected members
82  GModelPar m_sigma; //!< Gaussian width (deg)
83 };
84 
85 
86 /***********************************************************************//**
87  * @brief Return class name
88  *
89  * @return String containing the class name ("GModelSpatialRadialProfileGauss").
90  ***************************************************************************/
91 inline
93 {
94  return ("GModelSpatialRadialProfileGauss");
95 }
96 
97 
98 /***********************************************************************//**
99  * @brief Return Gaussian sigma
100  *
101  * @return Gaussian sigma (degrees).
102  *
103  * Returns the Gaussian sigma in degrees.
104  ***************************************************************************/
105 inline
107 {
108  return (m_sigma.value());
109 }
110 
111 
112 /***********************************************************************//**
113  * @brief Set Gaussian sigma
114  *
115  * @param[in] sigma Gaussian sigma (degrees).
116  *
117  * Sets the Gaussian sigma in degrees.
118  ***************************************************************************/
119 inline
120 void GModelSpatialRadialProfileGauss::sigma(const double& sigma)
121 {
122  m_sigma.value(sigma);
123  return;
124 }
125 
126 
127 #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:48
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
const GSkyDir & dir(void) const
Return position of radial spatial model.
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.
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 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.