Commit 8a9b5adc3c1cd1ca8b072e01555c4875ebfdd35b

Authored by Jürgen Knödlseder
1 parent ef5feabb

Rename Radial models to SpatialRadial.

include/GModelSpatialRadialDisk.hpp
1 1 /***************************************************************************
2   - * GModelRadialDisk.hpp - Radial disk source model class *
  2 + * GModelSpatialRadialDisk.hpp - Radial disk source model class *
3 3 * ----------------------------------------------------------------------- *
4 4 * copyright (C) 2011-2013 by Christoph Deil *
5 5 * ----------------------------------------------------------------------- *
... ... @@ -19,13 +19,13 @@
19 19 * *
20 20 ***************************************************************************/
21 21 /**
22   - * @file GModelRadialDisk.hpp
  22 + * @file GModelSpatialRadialDisk.hpp
23 23 * @brief Radial disk model class interface definition
24 24 * @author Christoph Deil
25 25 */
26 26  
27   -#ifndef GMODELRADIALDISK_HPP
28   -#define GMODELRADIALDISK_HPP
  27 +#ifndef GMODELSPATIALRADIALDISK_HPP
  28 +#define GMODELSPATIALRADIALDISK_HPP
29 29  
30 30 /* __ Includes ___________________________________________________________ */
31 31 #include <string>
... ... @@ -36,7 +36,7 @@
36 36  
37 37  
38 38 /**************************************************************************
39   - * @class GModelRadialDisk
  39 + * @class GModelSpatialRadialDisk
40 40 *
41 41 * @brief Disk source model class
42 42 *
... ... @@ -44,30 +44,30 @@
44 44 * model for a disk source, i.e. constant surface brightness within some
45 45 * radius and no emission outside.
46 46 ***************************************************************************/
47   -class GModelRadialDisk : public GModelSpatialRadial {
  47 +class GModelSpatialRadialDisk : public GModelSpatialRadial {
48 48  
49 49 public:
50 50 // Constructors and destructors
51   - GModelRadialDisk(void);
52   - explicit GModelRadialDisk(const GSkyDir& dir, const double& radius);
53   - explicit GModelRadialDisk(const GXmlElement& xml);
54   - GModelRadialDisk(const GModelRadialDisk& model);
55   - virtual ~GModelRadialDisk(void);
  51 + GModelSpatialRadialDisk(void);
  52 + explicit GModelSpatialRadialDisk(const GSkyDir& dir, const double& radius);
  53 + explicit GModelSpatialRadialDisk(const GXmlElement& xml);
  54 + GModelSpatialRadialDisk(const GModelSpatialRadialDisk& model);
  55 + virtual ~GModelSpatialRadialDisk(void);
56 56  
57 57 // Operators
58   - virtual GModelRadialDisk& operator=(const GModelRadialDisk& model);
  58 + virtual GModelSpatialRadialDisk& operator=(const GModelSpatialRadialDisk& model);
59 59  
60 60 // Implemented pure virtual methods
61   - virtual void clear(void);
62   - virtual GModelRadialDisk* clone(void) const;
63   - virtual std::string type(void) const { return "DiskFunction"; }
64   - virtual double eval(const double& theta) const;
65   - virtual double eval_gradients(const double& theta) const;
66   - virtual GSkyDir mc(GRan& ran) const;
67   - virtual double theta_max(void) const;
68   - virtual void read(const GXmlElement& xml);
69   - virtual void write(GXmlElement& xml) const;
70   - virtual std::string print(void) const;
  61 + virtual void clear(void);
  62 + virtual GModelSpatialRadialDisk* clone(void) const;
  63 + virtual std::string type(void) const { return "DiskFunction"; }
  64 + virtual double eval(const double& theta) const;
  65 + virtual double eval_gradients(const double& theta) const;
  66 + virtual GSkyDir mc(GRan& ran) const;
  67 + virtual double theta_max(void) const;
  68 + virtual void read(const GXmlElement& xml);
  69 + virtual void write(GXmlElement& xml) const;
  70 + virtual std::string print(void) const;
71 71  
72 72 // Other methods
73 73 double radius(void) const { return m_radius.real_value(); }
... ... @@ -76,7 +76,7 @@ public:
76 76 protected:
77 77 // Protected methods
78 78 void init_members(void);
79   - void copy_members(const GModelRadialDisk& model);
  79 + void copy_members(const GModelSpatialRadialDisk& model);
80 80 void free_members(void);
81 81 void update(void) const;
82 82  
... ... @@ -89,4 +89,4 @@ protected:
89 89 mutable double m_norm; //!< Normalization
90 90 };
91 91  
92   -#endif /* GMODELRADIALDISK_HPP */
  92 +#endif /* GMODELSPATIALRADIALDISK_HPP */
... ...
include/GModelSpatialRadialGauss.hpp
1 1 /***************************************************************************
2   - * GModelRadialGauss.hpp - Radial Gaussian source model class *
  2 + * GModelSpatialRadialGauss.hpp - Radial Gaussian source model class *
3 3 * ----------------------------------------------------------------------- *
4 4 * copyright (C) 2011-2013 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
... ... @@ -19,13 +19,13 @@
19 19 * *
20 20 ***************************************************************************/
21 21 /**
22   - * @file GModelRadialGauss.hpp
  22 + * @file GModelSpatialRadialGauss.hpp
23 23 * @brief Radial Gaussian model class interface definition
24 24 * @author Juergen Knoedlseder
25 25 */
26 26  
27   -#ifndef GMODELRADIALGAUSS_HPP
28   -#define GMODELRADIALGAUSS_HPP
  27 +#ifndef GMODELSPATIALRADIALGAUSS_HPP
  28 +#define GMODELSPATIALRADIALGAUSS_HPP
29 29  
30 30 /* __ Includes ___________________________________________________________ */
31 31 #include <string>
... ... @@ -36,37 +36,37 @@
36 36  
37 37  
38 38 /***********************************************************************//**
39   - * @class GModelRadialGauss
  39 + * @class GModelSpatialRadialGauss
40 40 *
41 41 * @brief Radial Gaussian model class
42 42 *
43 43 * This class implements the spatial component of the factorised source
44 44 * model for a Gaussian source.
45 45 ***************************************************************************/
46   -class GModelRadialGauss : public GModelSpatialRadial {
  46 +class GModelSpatialRadialGauss : public GModelSpatialRadial {
47 47  
48 48 public:
49 49 // Constructors and destructors
50   - GModelRadialGauss(void);
51   - explicit GModelRadialGauss(const GSkyDir& dir, const double& sigma);
52   - explicit GModelRadialGauss(const GXmlElement& xml);
53   - GModelRadialGauss(const GModelRadialGauss& model);
54   - virtual ~GModelRadialGauss(void);
  50 + GModelSpatialRadialGauss(void);
  51 + explicit GModelSpatialRadialGauss(const GSkyDir& dir, const double& sigma);
  52 + explicit GModelSpatialRadialGauss(const GXmlElement& xml);
  53 + GModelSpatialRadialGauss(const GModelSpatialRadialGauss& model);
  54 + virtual ~GModelSpatialRadialGauss(void);
55 55  
56 56 // Operators
57   - virtual GModelRadialGauss& operator=(const GModelRadialGauss& model);
  57 + virtual GModelSpatialRadialGauss& operator=(const GModelSpatialRadialGauss& model);
58 58  
59 59 // Implemented pure virtual methods
60   - virtual void clear(void);
61   - virtual GModelRadialGauss* clone(void) const;
62   - virtual std::string type(void) const { return "GaussFunction"; }
63   - virtual double eval(const double& theta) const;
64   - virtual double eval_gradients(const double& theta) const;
65   - virtual GSkyDir mc(GRan& ran) 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(void) const;
  60 + virtual void clear(void);
  61 + virtual GModelSpatialRadialGauss* clone(void) const;
  62 + virtual std::string type(void) const { return "GaussFunction"; }
  63 + virtual double eval(const double& theta) const;
  64 + virtual double eval_gradients(const double& theta) const;
  65 + virtual GSkyDir mc(GRan& ran) 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(void) const;
70 70  
71 71 // Other methods
72 72 double sigma(void) const { return m_sigma.real_value(); }
... ... @@ -75,11 +75,11 @@ public:
75 75 protected:
76 76 // Protected methods
77 77 void init_members(void);
78   - void copy_members(const GModelRadialGauss& model);
  78 + void copy_members(const GModelSpatialRadialGauss& model);
79 79 void free_members(void);
80 80  
81 81 // Protected members
82 82 GModelPar m_sigma; //!< Gaussian width (deg)
83 83 };
84 84  
85   -#endif /* GMODELRADIALGAUSS_HPP */
  85 +#endif /* GMODELSPATIALRADIALGAUSS_HPP */
... ...
include/GModelSpatialRadialShell.hpp
1 1 /***************************************************************************
2   - * GModelRadialShell.hpp - Radial shell source model class *
  2 + * GModelSpatialRadialShell.hpp - Radial shell source model class *
3 3 * ----------------------------------------------------------------------- *
4 4 * copyright (C) 2011-2013 by Christoph Deil *
5 5 * ----------------------------------------------------------------------- *
... ... @@ -19,13 +19,13 @@
19 19 * *
20 20 ***************************************************************************/
21 21 /**
22   - * @file GModelRadialShell.hpp
  22 + * @file GModelSpatialRadialShell.hpp
23 23 * @brief Radial shell model class interface definition
24 24 * @author Christoph Deil
25 25 */
26 26  
27   -#ifndef GMODELRADIALSHELL_HPP
28   -#define GMODELRADIALSHELL_HPP
  27 +#ifndef GMODELSPATIALRADIALSHELL_HPP
  28 +#define GMODELSPATIALRADIALSHELL_HPP
29 29  
30 30 /* __ Includes ___________________________________________________________ */
31 31 #include <string>
... ... @@ -36,7 +36,7 @@
36 36  
37 37  
38 38 /**************************************************************************
39   - * @class GModelRadialShell
  39 + * @class GModelSpatialRadialShell
40 40 *
41 41 * @brief Shell source model class
42 42 *
... ... @@ -54,32 +54,32 @@
54 54 * the gamma-ray domain, and improves the convergence of the fitting
55 55 * algorithms.
56 56 ***************************************************************************/
57   -class GModelRadialShell : public GModelSpatialRadial {
  57 +class GModelSpatialRadialShell : public GModelSpatialRadial {
58 58  
59 59 public:
60 60 // Constructors and destructors
61   - GModelRadialShell(void);
62   - explicit GModelRadialShell(const GSkyDir& dir,
  61 + GModelSpatialRadialShell(void);
  62 + explicit GModelSpatialRadialShell(const GSkyDir& dir,
63 63 const double& radius, const double& width,
64 64 const bool& small_angle = true);
65   - explicit GModelRadialShell(const GXmlElement& xml);
66   - GModelRadialShell(const GModelRadialShell& model);
67   - virtual ~GModelRadialShell(void);
  65 + explicit GModelSpatialRadialShell(const GXmlElement& xml);
  66 + GModelSpatialRadialShell(const GModelSpatialRadialShell& model);
  67 + virtual ~GModelSpatialRadialShell(void);
68 68  
69 69 // Operators
70   - virtual GModelRadialShell& operator=(const GModelRadialShell& model);
  70 + virtual GModelSpatialRadialShell& operator=(const GModelSpatialRadialShell& model);
71 71  
72 72 // Implemented pure virtual methods
73   - virtual void clear(void);
74   - virtual GModelRadialShell* clone(void) const;
75   - virtual std::string type(void) const { return "ShellFunction"; }
76   - virtual double eval(const double& theta) const;
77   - virtual double eval_gradients(const double& theta) const;
78   - virtual GSkyDir mc(GRan& ran) const;
79   - virtual double theta_max(void) const;
80   - virtual void read(const GXmlElement& xml);
81   - virtual void write(GXmlElement& xml) const;
82   - virtual std::string print(void) const;
  73 + virtual void clear(void);
  74 + virtual GModelSpatialRadialShell* clone(void) const;
  75 + virtual std::string type(void) const { return "ShellFunction"; }
  76 + virtual double eval(const double& theta) const;
  77 + virtual double eval_gradients(const double& theta) const;
  78 + virtual GSkyDir mc(GRan& ran) const;
  79 + virtual double theta_max(void) const;
  80 + virtual void read(const GXmlElement& xml);
  81 + virtual void write(GXmlElement& xml) const;
  82 + virtual std::string print(void) const;
83 83  
84 84 // Other methods
85 85 double radius(void) const { return m_radius.real_value(); }
... ... @@ -92,7 +92,7 @@ public:
92 92 protected:
93 93 // Protected methods
94 94 void init_members(void);
95   - void copy_members(const GModelRadialShell& model);
  95 + void copy_members(const GModelSpatialRadialShell& model);
96 96 void free_members(void);
97 97 void update(void) const;
98 98 static double f1(double x);
... ... @@ -113,4 +113,4 @@ protected:
113 113 mutable double m_norm; //!< Shell normalization
114 114 };
115 115  
116   -#endif /* GMODELRADIALSHELL_HPP */
  116 +#endif /* GMODELSPATIALRADIALSHELL_HPP */
... ...
include/GammaLib.hpp
... ... @@ -166,9 +166,9 @@
166 166 #include "GModelSpatialRegistry.hpp"
167 167 #include "GModelSpatialPointSource.hpp"
168 168 #include "GModelSpatialRadial.hpp"
169   -#include "GModelRadialDisk.hpp"
170   -#include "GModelRadialGauss.hpp"
171   -#include "GModelRadialShell.hpp"
  169 +#include "GModelSpatialRadialDisk.hpp"
  170 +#include "GModelSpatialRadialGauss.hpp"
  171 +#include "GModelSpatialRadialShell.hpp"
172 172 #include "GModelSpatialConst.hpp"
173 173 #include "GModelSpatialCube.hpp"
174 174 #include "GModelSpatialMap.hpp"
... ...
include/Makefile.am
... ... @@ -111,9 +111,9 @@ pkginclude_HEADERS = GammaLib.hpp \
111 111 GModelSpatialRegistry.hpp \
112 112 GModelSpatialPointSource.hpp \
113 113 GModelSpatialRadial.hpp \
114   - GModelRadialDisk.hpp \
115   - GModelRadialGauss.hpp \
116   - GModelRadialShell.hpp \
  114 + GModelSpatialRadialDisk.hpp \
  115 + GModelSpatialRadialGauss.hpp \
  116 + GModelSpatialRadialShell.hpp \
117 117 GModelSpatialConst.hpp \
118 118 GModelSpatialCube.hpp \
119 119 GModelSpatialMap.hpp \
... ...
pyext/GModelSky.i
... ... @@ -28,9 +28,9 @@
28 28 #include "GModelSky.hpp"
29 29 #include "GModelSpatial.hpp"
30 30 #include "GModelSpatialRadial.hpp"
31   -#include "GModelRadialDisk.hpp"
32   -#include "GModelRadialGauss.hpp"
33   -#include "GModelRadialShell.hpp"
  31 +#include "GModelSpatialRadialDisk.hpp"
  32 +#include "GModelSpatialRadialGauss.hpp"
  33 +#include "GModelSpatialRadialShell.hpp"
34 34 #include "GModelSpatialConst.hpp"
35 35 #include "GModelSpatialCube.hpp"
36 36 #include "GModelSpatialMap.hpp"
... ... @@ -49,14 +49,14 @@
49 49 /* __ Typemaps ___________________________________________________________ */
50 50 %typemap(out) GModelSpatial* {
51 51 if (dynamic_cast<GModelSpatialRadial*>($1) != NULL) {
52   - if (dynamic_cast<GModelSpatialRadial*>($1) != NULL) {
53   - $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GModelRadialDisk, 0 | 0 );
  52 + if (dynamic_cast<GModelSpatialRadialDisk*>($1) != NULL) {
  53 + $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GModelSpatialRadialDisk, 0 | 0 );
54 54 }
55   - else if (dynamic_cast<GModelRadialGauss*>($1) != NULL) {
56   - $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GModelRadialGauss, 0 | 0 );
  55 + else if (dynamic_cast<GModelSpatialRadialGauss*>($1) != NULL) {
  56 + $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GModelSpatialRadialGauss, 0 | 0 );
57 57 }
58   - else if (dynamic_cast<GModelRadialShell*>($1) != NULL) {
59   - $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GModelRadialShell, 0 | 0 );
  58 + else if (dynamic_cast<GModelSpatialRadialShell*>($1) != NULL) {
  59 + $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GModelSpatialRadialShell, 0 | 0 );
60 60 }
61 61 else {
62 62 $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GModelSpatialRadial, 0 | 0 );
... ...
pyext/GModelSpatialRadialDisk.i
1 1 /***************************************************************************
2   - * GModelRadialDisk.i - Radial disk source model class *
  2 + * GModelSpatialRadialDisk.i - Radial disk source model class *
3 3 * ----------------------------------------------------------------------- *
4 4 * copyright (C) 2011-2013 by Christoph Deil *
5 5 * ----------------------------------------------------------------------- *
... ... @@ -19,18 +19,18 @@
19 19 * *
20 20 ***************************************************************************/
21 21 /**
22   - * @file GModelRadialDisk.i
  22 + * @file GModelSpatialRadialDisk.i
23 23 * @brief Radial disk model class Python interface definition
24 24 * @author Christoph Deil
25 25 */
26 26 %{
27 27 /* Put headers and other declarations here that are needed for compilation */
28   -#include "GModelRadialDisk.hpp"
  28 +#include "GModelSpatialRadialDisk.hpp"
29 29 #include "GTools.hpp"
30 30 %}
31 31  
32 32 /**************************************************************************
33   - * @class GModelRadialDisk
  33 + * @class GModelSpatialRadialDisk
34 34 *
35 35 * @brief Disk source model class
36 36 *
... ... @@ -38,25 +38,25 @@
38 38 * model for a disk source, i.e. constant surface brightness within some
39 39 * radius and no emission outside.
40 40 ***************************************************************************/
41   -class GModelRadialDisk : public GModelSpatialRadial {
  41 +class GModelSpatialRadialDisk : public GModelSpatialRadial {
42 42 public:
43 43 // Constructors and destructors
44   - GModelRadialDisk(void);
45   - explicit GModelRadialDisk(const GSkyDir& dir, const double& radius);
46   - explicit GModelRadialDisk(const GXmlElement& xml);
47   - GModelRadialDisk(const GModelRadialDisk& model);
48   - virtual ~GModelRadialDisk(void);
  44 + GModelSpatialRadialDisk(void);
  45 + explicit GModelSpatialRadialDisk(const GSkyDir& dir, const double& radius);
  46 + explicit GModelSpatialRadialDisk(const GXmlElement& xml);
  47 + GModelSpatialRadialDisk(const GModelSpatialRadialDisk& model);
  48 + virtual ~GModelSpatialRadialDisk(void);
49 49  
50 50 // Implemented pure virtual methods
51   - virtual void clear(void);
52   - virtual GModelRadialDisk* clone(void) const;
53   - virtual std::string type(void) const;
54   - virtual double eval(const double& theta) const;
55   - virtual double eval_gradients(const double& theta) const;
56   - virtual GSkyDir mc(GRan& ran) const;
57   - virtual double theta_max(void) const;
58   - virtual void read(const GXmlElement& xml);
59   - virtual void write(GXmlElement& xml) const;
  51 + virtual void clear(void);
  52 + virtual GModelSpatialRadialDisk* clone(void) const;
  53 + virtual std::string type(void) const;
  54 + virtual double eval(const double& theta) const;
  55 + virtual double eval_gradients(const double& theta) const;
  56 + virtual GSkyDir mc(GRan& ran) const;
  57 + virtual double theta_max(void) const;
  58 + virtual void read(const GXmlElement& xml);
  59 + virtual void write(GXmlElement& xml) const;
60 60  
61 61 // Other methods
62 62 double radius(void) const;
... ... @@ -65,10 +65,10 @@ public:
65 65  
66 66  
67 67 /***********************************************************************//**
68   - * @brief GModelRadialDisk class extension
  68 + * @brief GModelSpatialRadialDisk class extension
69 69 ***************************************************************************/
70   -%extend GModelRadialDisk {
71   - GModelRadialDisk copy() {
  70 +%extend GModelSpatialRadialDisk {
  71 + GModelSpatialRadialDisk copy() {
72 72 return (*self);
73 73 }
74 74 };
... ...
pyext/GModelSpatialRadialGauss.i
1 1 /***************************************************************************
2   - * GModelRadialGauss.i - Radial Gaussian source model class *
  2 + * GModelSpatialRadialGauss.i - Radial Gaussian source model class *
3 3 * ----------------------------------------------------------------------- *
4 4 * copyright (C) 2011-2013 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
... ... @@ -19,41 +19,41 @@
19 19 * *
20 20 ***************************************************************************/
21 21 /**
22   - * @file GModelRadialGauss.i
  22 + * @file GModelSpatialRadialGauss.i
23 23 * @brief Radial Gaussian model class Python interface definition
24 24 * @author Juergen Knoedlseder
25 25 */
26 26 %{
27 27 /* Put headers and other declarations here that are needed for compilation */
28   -#include "GModelRadialGauss.hpp"
  28 +#include "GModelSpatialRadialGauss.hpp"
29 29 #include "GTools.hpp"
30 30 %}
31 31  
32 32  
33 33 /***********************************************************************//**
34   - * @class GModelRadialGauss
  34 + * @class GModelSpatialRadialGauss
35 35 *
36 36 * @brief Radial Gaussian model class
37 37 ***************************************************************************/
38   -class GModelRadialGauss : public GModelSpatialRadial {
  38 +class GModelSpatialRadialGauss : public GModelSpatialRadial {
39 39 public:
40 40 // Constructors and destructors
41   - GModelRadialGauss(void);
42   - explicit GModelRadialGauss(const GSkyDir& dir, const double& sigma);
43   - explicit GModelRadialGauss(const GXmlElement& xml);
44   - GModelRadialGauss(const GModelRadialGauss& model);
45   - virtual ~GModelRadialGauss(void);
  41 + GModelSpatialRadialGauss(void);
  42 + explicit GModelSpatialRadialGauss(const GSkyDir& dir, const double& sigma);
  43 + explicit GModelSpatialRadialGauss(const GXmlElement& xml);
  44 + GModelSpatialRadialGauss(const GModelSpatialRadialGauss& model);
  45 + virtual ~GModelSpatialRadialGauss(void);
46 46  
47 47 // Implemented pure virtual methods
48   - virtual void clear(void);
49   - virtual GModelRadialGauss* clone(void) const;
50   - virtual std::string type(void) const;
51   - virtual double eval(const double& theta) const;
52   - virtual double eval_gradients(const double& theta) const;
53   - virtual GSkyDir mc(GRan& ran) const;
54   - virtual double theta_max(void) const;
55   - virtual void read(const GXmlElement& xml);
56   - virtual void write(GXmlElement& xml) const;
  48 + virtual void clear(void);
  49 + virtual GModelSpatialRadialGauss* clone(void) const;
  50 + virtual std::string type(void) const;
  51 + virtual double eval(const double& theta) const;
  52 + virtual double eval_gradients(const double& theta) const;
  53 + virtual GSkyDir mc(GRan& ran) const;
  54 + virtual double theta_max(void) const;
  55 + virtual void read(const GXmlElement& xml);
  56 + virtual void write(GXmlElement& xml) const;
57 57  
58 58 // Other methods
59 59 double sigma(void) const;
... ... @@ -62,10 +62,10 @@ public:
62 62  
63 63  
64 64 /***********************************************************************//**
65   - * @brief GModelRadialGauss class extension
  65 + * @brief GModelSpatialRadialGauss class extension
66 66 ***************************************************************************/
67   -%extend GModelRadialGauss {
68   - GModelRadialGauss copy() {
  67 +%extend GModelSpatialRadialGauss {
  68 + GModelSpatialRadialGauss copy() {
69 69 return (*self);
70 70 }
71 71 };
... ...
pyext/GModelSpatialRadialShell.i
1 1 /***************************************************************************
2   - * GModelRadialShell.i - Radial spatial shell source model class *
  2 + * GModelSpatialRadialShell.i - Radial spatial shell source model class *
3 3 * ----------------------------------------------------------------------- *
4 4 * copyright (C) 2011-2013 by Christoph Deil *
5 5 * ----------------------------------------------------------------------- *
... ... @@ -19,42 +19,42 @@
19 19 * *
20 20 ***************************************************************************/
21 21 /**
22   - * @file GModelRadialShell.i
  22 + * @file GModelSpatialRadialShell.i
23 23 * @brief Radial spatial shell model class Python interface definition
24 24 * @author Christoph Deil
25 25 */
26 26 %{
27 27 /* Put headers and other declarations here that are needed for compilation */
28   -#include "GModelRadialShell.hpp"
  28 +#include "GModelSpatialRadialShell.hpp"
29 29 #include "GTools.hpp"
30 30 %}
31 31  
32 32 /**************************************************************************
33   - * @class GModelRadialShell
  33 + * @class GModelSpatialRadialShell
34 34 *
35 35 * @brief Radial shell source model class
36 36 ***************************************************************************/
37   -class GModelRadialShell : public GModelSpatialRadial {
  37 +class GModelSpatialRadialShell : public GModelSpatialRadial {
38 38 public:
39 39 // Constructors and destructors
40   - GModelRadialShell(void);
41   - explicit GModelRadialShell(const GSkyDir& dir,
  40 + GModelSpatialRadialShell(void);
  41 + explicit GModelSpatialRadialShell(const GSkyDir& dir,
42 42 const double& radius, const double& width,
43 43 const bool& small_angle = true);
44   - explicit GModelRadialShell(const GXmlElement& xml);
45   - GModelRadialShell(const GModelRadialShell& model);
46   - virtual ~GModelRadialShell(void);
  44 + explicit GModelSpatialRadialShell(const GXmlElement& xml);
  45 + GModelSpatialRadialShell(const GModelSpatialRadialShell& model);
  46 + virtual ~GModelSpatialRadialShell(void);
47 47  
48 48 // Implemented pure virtual methods
49   - virtual void clear(void);
50   - virtual GModelRadialShell* clone(void) const;
51   - virtual std::string type(void) const;
52   - virtual double eval(const double& theta) const;
53   - virtual double eval_gradients(const double& theta) const;
54   - virtual GSkyDir mc(GRan& ran) const;
55   - virtual double theta_max(void) const;
56   - virtual void read(const GXmlElement& xml);
57   - virtual void write(GXmlElement& xml) const;
  49 + virtual void clear(void);
  50 + virtual GModelSpatialRadialShell* clone(void) const;
  51 + virtual std::string type(void) const;
  52 + virtual double eval(const double& theta) const;
  53 + virtual double eval_gradients(const double& theta) const;
  54 + virtual GSkyDir mc(GRan& ran) const;
  55 + virtual double theta_max(void) const;
  56 + virtual void read(const GXmlElement& xml);
  57 + virtual void write(GXmlElement& xml) const;
58 58  
59 59 // Other methods
60 60 double radius(void) const;
... ... @@ -67,10 +67,10 @@ public:
67 67  
68 68  
69 69 /***********************************************************************//**
70   - * @brief GModelRadialShell class extension
  70 + * @brief GModelSpatialRadialShell class extension
71 71 ***************************************************************************/
72   -%extend GModelRadialShell {
73   - GModelRadialShell copy() {
  72 +%extend GModelSpatialRadialShell {
  73 + GModelSpatialRadialShell copy() {
74 74 return (*self);
75 75 }
76 76 };
... ...
pyext/gammalib/model.i
... ... @@ -54,9 +54,9 @@
54 54 %include "GModelSpatialRegistry.i"
55 55 %include "GModelSpatialPointSource.i"
56 56 %include "GModelSpatialRadial.i"
57   -%include "GModelRadialDisk.i"
58   -%include "GModelRadialGauss.i"
59   -%include "GModelRadialShell.i"
  57 +%include "GModelSpatialRadialDisk.i"
  58 +%include "GModelSpatialRadialGauss.i"
  59 +%include "GModelSpatialRadialShell.i"
60 60 %include "GModelSpatialConst.i"
61 61 %include "GModelSpatialCube.i"
62 62 %include "GModelSpatialMap.i"
... ...
src/model/GModelSpatialRadialDisk.cpp
1 1 /***************************************************************************
2   - * GModelRadialDisk.cpp - Radial disk source model class *
  2 + * GModelSpatialRadialDisk.cpp - Radial disk source model class *
3 3 * ----------------------------------------------------------------------- *
4 4 * copyright (C) 2011-2013 by Christoph Deil *
5 5 * ----------------------------------------------------------------------- *
... ... @@ -19,7 +19,7 @@
19 19 * *
20 20 ***************************************************************************/
21 21 /**
22   - * @file GModelRadialDisk.cpp
  22 + * @file GModelSpatialRadialDisk.cpp
23 23 * @brief Radial disk model class implementation
24 24 * @author Christoph Deil
25 25 */
... ... @@ -30,18 +30,18 @@
30 30 #endif
31 31 #include "GException.hpp"
32 32 #include "GTools.hpp"
33   -#include "GModelRadialDisk.hpp"
  33 +#include "GModelSpatialRadialDisk.hpp"
34 34 #include "GModelSpatialRegistry.hpp"
35 35  
36 36 /* __ Constants __________________________________________________________ */
37 37  
38 38 /* __ Globals ____________________________________________________________ */
39   -const GModelRadialDisk g_radial_disk_seed;
40   -const GModelSpatialRegistry g_radial_disk_registry(&g_radial_disk_seed);
  39 +const GModelSpatialRadialDisk g_radial_disk_seed;
  40 +const GModelSpatialRegistry g_radial_disk_registry(&g_radial_disk_seed);
41 41  
42 42 /* __ Method name definitions ____________________________________________ */
43   -#define G_READ "GModelRadialDisk::read(GXmlElement&)"
44   -#define G_WRITE "GModelRadialDisk::write(GXmlElement&)"
  43 +#define G_READ "GModelSpatialRadialDisk::read(GXmlElement&)"
  44 +#define G_WRITE "GModelSpatialRadialDisk::write(GXmlElement&)"
45 45  
46 46 /* __ Macros _____________________________________________________________ */
47 47  
... ... @@ -59,7 +59,7 @@ const GModelSpatialRegistry g_radial_disk_registry(&amp;g_radial_disk_seed);
59 59 /***********************************************************************//**
60 60 * @brief Void constructor
61 61 ***************************************************************************/
62   -GModelRadialDisk::GModelRadialDisk(void) : GModelSpatialRadial()
  62 +GModelSpatialRadialDisk::GModelSpatialRadialDisk(void) : GModelSpatialRadial()
63 63 {
64 64 // Initialise members
65 65 init_members();
... ... @@ -75,8 +75,9 @@ GModelRadialDisk::GModelRadialDisk(void) : GModelSpatialRadial()
75 75 * @param[in] dir Sky position of disk centre.
76 76 * @param[in] radius Disk radius (degrees).
77 77 ***************************************************************************/
78   -GModelRadialDisk::GModelRadialDisk(const GSkyDir& dir, const double& radius) :
79   - GModelSpatialRadial()
  78 +GModelSpatialRadialDisk::GModelSpatialRadialDisk(const GSkyDir& dir,
  79 + const double& radius) :
  80 + GModelSpatialRadial()
80 81 {
81 82 // Initialise members
82 83 init_members();
... ... @@ -96,11 +97,11 @@ GModelRadialDisk::GModelRadialDisk(const GSkyDir&amp; dir, const double&amp; radius) :
96 97 * @param[in] xml XML element.
97 98 *
98 99 * Creates instance of radial disk model by extracting information from an
99   - * XML element. See GModelRadialDisk::read() for more information about the
  100 + * XML element. See GModelSpatialRadialDisk::read() for more information about the
100 101 * expected structure of the XML element.
101 102 ***************************************************************************/
102   -GModelRadialDisk::GModelRadialDisk(const GXmlElement& xml) :
103   - GModelSpatialRadial()
  103 +GModelSpatialRadialDisk::GModelSpatialRadialDisk(const GXmlElement& xml) :
  104 + GModelSpatialRadial()
104 105 {
105 106 // Initialise members
106 107 init_members();
... ... @@ -118,8 +119,8 @@ GModelRadialDisk::GModelRadialDisk(const GXmlElement&amp; xml) :
118 119 *
119 120 * @param[in] model Radial disk model.
120 121 ***************************************************************************/
121   -GModelRadialDisk::GModelRadialDisk(const GModelRadialDisk& model) :
122   - GModelSpatialRadial(model)
  122 +GModelSpatialRadialDisk::GModelSpatialRadialDisk(const GModelSpatialRadialDisk& model) :
  123 + GModelSpatialRadial(model)
123 124 {
124 125 // Initialise members
125 126 init_members();
... ... @@ -135,7 +136,7 @@ GModelRadialDisk::GModelRadialDisk(const GModelRadialDisk&amp; model) :
135 136 /***********************************************************************//**
136 137 * @brief Destructor
137 138 ***************************************************************************/
138   -GModelRadialDisk::~GModelRadialDisk(void)
  139 +GModelSpatialRadialDisk::~GModelSpatialRadialDisk(void)
139 140 {
140 141 // Free members
141 142 free_members();
... ... @@ -155,8 +156,9 @@ GModelRadialDisk::~GModelRadialDisk(void)
155 156 * @brief Assignment operator
156 157 *
157 158 * @param[in] model Radial disk model.
  159 + * @return Radial disk model.
158 160 ***************************************************************************/
159   -GModelRadialDisk& GModelRadialDisk::operator= (const GModelRadialDisk& model)
  161 +GModelSpatialRadialDisk& GModelSpatialRadialDisk::operator=(const GModelSpatialRadialDisk& model)
160 162 {
161 163 // Execute only if object is not identical
162 164 if (this != &model) {
... ... @@ -189,7 +191,7 @@ GModelRadialDisk&amp; GModelRadialDisk::operator= (const GModelRadialDisk&amp; model)
189 191 /***********************************************************************//**
190 192 * @brief Clear instance
191 193 ***************************************************************************/
192   -void GModelRadialDisk::clear(void)
  194 +void GModelSpatialRadialDisk::clear(void)
193 195 {
194 196 // Free class members (base and derived classes, derived class first)
195 197 free_members();
... ... @@ -209,9 +211,9 @@ void GModelRadialDisk::clear(void)
209 211 /***********************************************************************//**
210 212 * @brief Clone instance
211 213 ***************************************************************************/
212   -GModelRadialDisk* GModelRadialDisk::clone(void) const
  214 +GModelSpatialRadialDisk* GModelSpatialRadialDisk::clone(void) const
213 215 {
214   - return new GModelRadialDisk(*this);
  216 + return new GModelSpatialRadialDisk(*this);
215 217 }
216 218  
217 219  
... ... @@ -242,7 +244,7 @@ GModelRadialDisk* GModelRadialDisk::clone(void) const
242 244 *
243 245 * is a normalization constant (see the update() method).
244 246 ***************************************************************************/
245   -double GModelRadialDisk::eval(const double& theta) const
  247 +double GModelSpatialRadialDisk::eval(const double& theta) const
246 248 {
247 249 // Update precomputation cache
248 250 update();
... ... @@ -253,7 +255,7 @@ double GModelRadialDisk::eval(const double&amp; theta) const
253 255 // Compile option: Check for NaN/Inf
254 256 #if defined(G_NAN_CHECK)
255 257 if (isnotanumber(value) || isinfinite(value)) {
256   - std::cout << "*** ERROR: GModelRadialDisk::eval";
  258 + std::cout << "*** ERROR: GModelSpatialRadialDisk::eval";
257 259 std::cout << "(theta=" << theta << "): NaN/Inf encountered";
258 260 std::cout << " (value=" << value;
259 261 std::cout << ", m_radius_rad=" << m_radius_rad;
... ... @@ -278,7 +280,7 @@ double GModelRadialDisk::eval(const double&amp; theta) const
278 280 *
279 281 * See the eval() method for more information.
280 282 ***************************************************************************/
281   -double GModelRadialDisk::eval_gradients(const double& theta) const
  283 +double GModelSpatialRadialDisk::eval_gradients(const double& theta) const
282 284 {
283 285 // Return value
284 286 return (eval(theta));
... ... @@ -292,7 +294,7 @@ double GModelRadialDisk::eval_gradients(const double&amp; theta) const
292 294 *
293 295 * Draws an arbitrary sky position from the 2D disk distribution.
294 296 ***************************************************************************/
295   -GSkyDir GModelRadialDisk::mc(GRan& ran) const
  297 +GSkyDir GModelSpatialRadialDisk::mc(GRan& ran) const
296 298 {
297 299 // Simulate offset from photon arrival direction
298 300 double cosrad = std::cos(radius()*deg2rad);
... ... @@ -311,7 +313,7 @@ GSkyDir GModelRadialDisk::mc(GRan&amp; ran) const
311 313 /***********************************************************************//**
312 314 * @brief Return maximum model radius (in radians)
313 315 ***************************************************************************/
314   -double GModelRadialDisk::theta_max(void) const
  316 +double GModelSpatialRadialDisk::theta_max(void) const
315 317 {
316 318 // Return value
317 319 return (radius()*deg2rad);
... ... @@ -336,7 +338,7 @@ double GModelRadialDisk::theta_max(void) const
336 338 * @todo Implement a test of the radius and radius boundary. The radius
337 339 * and radius minimum should be >0.
338 340 ***************************************************************************/
339   -void GModelRadialDisk::read(const GXmlElement& xml)
  341 +void GModelSpatialRadialDisk::read(const GXmlElement& xml)
340 342 {
341 343 // Determine number of parameter nodes in XML element
342 344 int npars = xml.elements("parameter");
... ... @@ -395,7 +397,7 @@ void GModelRadialDisk::read(const GXmlElement&amp; xml)
395 397 * Write the Disk source information into an XML element. The XML element
396 398 * will have 3 parameter leafs named "RA", "DEC" and "Radius"
397 399 ***************************************************************************/
398   -void GModelRadialDisk::write(GXmlElement& xml) const
  400 +void GModelSpatialRadialDisk::write(GXmlElement& xml) const
399 401 {
400 402 // Write disk location
401 403 GModelSpatialRadial::write(xml);
... ... @@ -443,14 +445,16 @@ void GModelRadialDisk::write(GXmlElement&amp; xml) const
443 445  
444 446 /***********************************************************************//**
445 447 * @brief Print information
  448 + *
  449 + * @return String containing model information.
446 450 ***************************************************************************/
447   -std::string GModelRadialDisk::print(void) const
  451 +std::string GModelSpatialRadialDisk::print(void) const
448 452 {
449 453 // Initialise result string
450 454 std::string result;
451 455  
452 456 // Append header
453   - result.append("=== GModelRadialDisk ===\n");
  457 + result.append("=== GModelSpatialRadialDisk ===\n");
454 458  
455 459 // Append parameters
456 460 result.append(parformat("Number of parameters")+str(size()));
... ... @@ -472,7 +476,7 @@ std::string GModelRadialDisk::print(void) const
472 476 /***********************************************************************//**
473 477 * @brief Initialise class members
474 478 ***************************************************************************/
475   -void GModelRadialDisk::init_members(void)
  479 +void GModelSpatialRadialDisk::init_members(void)
476 480 {
477 481 // Initialise Radius
478 482 m_radius.clear();
... ... @@ -508,7 +512,7 @@ void GModelRadialDisk::init_members(void)
508 512 * should have been done by init_members() that was called before. Otherwise
509 513 * we would have the radius twice on the stack.
510 514 ***************************************************************************/
511   -void GModelRadialDisk::copy_members(const GModelRadialDisk& model)
  515 +void GModelSpatialRadialDisk::copy_members(const GModelSpatialRadialDisk& model)
512 516 {
513 517 // Copy members
514 518 m_radius = model.m_radius;
... ... @@ -526,7 +530,7 @@ void GModelRadialDisk::copy_members(const GModelRadialDisk&amp; model)
526 530 /***********************************************************************//**
527 531 * @brief Delete class members
528 532 ***************************************************************************/
529   -void GModelRadialDisk::free_members(void)
  533 +void GModelSpatialRadialDisk::free_members(void)
530 534 {
531 535 // Return
532 536 return;
... ... @@ -544,7 +548,7 @@ void GModelRadialDisk::free_members(void)
544 548 * approximation you might have expected:
545 549 * \f[{\tt m\_norm} = \frac{1}{\pi r ^ 2}\f]
546 550 ***************************************************************************/
547   -void GModelRadialDisk::update() const
  551 +void GModelSpatialRadialDisk::update() const
548 552 {
549 553 // Update if radius has changed
550 554 if (m_last_radius != radius()) {
... ... @@ -564,10 +568,3 @@ void GModelRadialDisk::update() const
564 568 // Return
565 569 return;
566 570 }
567   -
568   -
569   -/*==========================================================================
570   - = =
571   - = Friends =
572   - = =
573   - ==========================================================================*/
... ...
src/model/GModelSpatialRadialGauss.cpp
1 1 /***************************************************************************
2   - * GModelRadialGauss.cpp - Radial Gaussian source model class *
  2 + * GModelSpatialRadialGauss.cpp - Radial Gaussian source model class *
3 3 * ----------------------------------------------------------------------- *
4 4 * copyright (C) 2011-2013 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
... ... @@ -19,7 +19,7 @@
19 19 * *
20 20 ***************************************************************************/
21 21 /**
22   - * @file GModelRadialGauss.cpp
  22 + * @file GModelSpatialRadialGauss.cpp
23 23 * @brief Radial Gaussian model class implementation
24 24 * @author Juergen Knoedlseder
25 25 */
... ... @@ -30,18 +30,18 @@
30 30 #endif
31 31 #include "GException.hpp"
32 32 #include "GTools.hpp"
33   -#include "GModelRadialGauss.hpp"
  33 +#include "GModelSpatialRadialGauss.hpp"
34 34 #include "GModelSpatialRegistry.hpp"
35 35  
36 36 /* __ Constants __________________________________________________________ */
37 37  
38 38 /* __ Globals ____________________________________________________________ */
39   -const GModelRadialGauss g_radial_gauss_seed;
40   -const GModelSpatialRegistry g_radial_gauss_registry(&g_radial_gauss_seed);
  39 +const GModelSpatialRadialGauss g_radial_gauss_seed;
  40 +const GModelSpatialRegistry g_radial_gauss_registry(&g_radial_gauss_seed);
41 41  
42 42 /* __ Method name definitions ____________________________________________ */
43   -#define G_READ "GModelRadialGauss::read(GXmlElement&)"
44   -#define G_WRITE "GModelRadialGauss::write(GXmlElement&)"
  43 +#define G_READ "GModelSpatialRadialGauss::read(GXmlElement&)"
  44 +#define G_WRITE "GModelSpatialRadialGauss::write(GXmlElement&)"
45 45  
46 46 /* __ Macros _____________________________________________________________ */
47 47  
... ... @@ -59,7 +59,7 @@ const GModelSpatialRegistry g_radial_gauss_registry(&amp;g_radial_gauss_seed);
59 59 /***********************************************************************//**
60 60 * @brief Void constructor
61 61 ***************************************************************************/
62   -GModelRadialGauss::GModelRadialGauss(void) : GModelSpatialRadial()
  62 +GModelSpatialRadialGauss::GModelSpatialRadialGauss(void) : GModelSpatialRadial()
63 63 {
64 64 // Initialise members
65 65 init_members();
... ... @@ -78,8 +78,9 @@ GModelRadialGauss::GModelRadialGauss(void) : GModelSpatialRadial()
78 78 * Creates instance of a Gaussian spatial model using a sky direction and
79 79 * a Gaussian width parameter \f$\sigma\f$ (in degrees).
80 80 ***************************************************************************/
81   -GModelRadialGauss::GModelRadialGauss(const GSkyDir& dir, const double& sigma) :
82   - GModelSpatialRadial()
  81 +GModelSpatialRadialGauss::GModelSpatialRadialGauss(const GSkyDir& dir,
  82 + const double& sigma) :
  83 + GModelSpatialRadial()
83 84 {
84 85 // Initialise members
85 86 init_members();
... ... @@ -99,11 +100,11 @@ GModelRadialGauss::GModelRadialGauss(const GSkyDir&amp; dir, const double&amp; sigma) :
99 100 * @param[in] xml XML element.
100 101 *
101 102 * Creates instance of a Gaussian spatial model by extracting information
102   - * from an XML element. See GModelRadialGauss::read() for more information
  103 + * from an XML element. See GModelSpatialRadialGauss::read() for more information
103 104 * about the expected structure of the XML element.
104 105 ***************************************************************************/
105   -GModelRadialGauss::GModelRadialGauss(const GXmlElement& xml) :
106   - GModelSpatialRadial()
  106 +GModelSpatialRadialGauss::GModelSpatialRadialGauss(const GXmlElement& xml) :
  107 + GModelSpatialRadial()
107 108 {
108 109 // Initialise members
109 110 init_members();
... ... @@ -121,8 +122,8 @@ GModelRadialGauss::GModelRadialGauss(const GXmlElement&amp; xml) :
121 122 *
122 123 * @param[in] model Radial Gaussian model.
123 124 ***************************************************************************/
124   -GModelRadialGauss::GModelRadialGauss(const GModelRadialGauss& model) :
125   - GModelSpatialRadial(model)
  125 +GModelSpatialRadialGauss::GModelSpatialRadialGauss(const GModelSpatialRadialGauss& model) :
  126 + GModelSpatialRadial(model)
126 127 {
127 128 // Initialise members
128 129 init_members();
... ... @@ -138,7 +139,7 @@ GModelRadialGauss::GModelRadialGauss(const GModelRadialGauss&amp; model) :
138 139 /***********************************************************************//**
139 140 * @brief Destructor
140 141 ***************************************************************************/
141   -GModelRadialGauss::~GModelRadialGauss(void)
  142 +GModelSpatialRadialGauss::~GModelSpatialRadialGauss(void)
142 143 {
143 144 // Free members
144 145 free_members();
... ... @@ -158,8 +159,9 @@ GModelRadialGauss::~GModelRadialGauss(void)
158 159 * @brief Assignment operator
159 160 *
160 161 * @param[in] model Radial Gaussian model.
  162 + * @return Radial Gaussian model.
161 163 ***************************************************************************/
162   -GModelRadialGauss& GModelRadialGauss::operator=(const GModelRadialGauss& model)
  164 +GModelSpatialRadialGauss& GModelSpatialRadialGauss::operator=(const GModelSpatialRadialGauss& model)
163 165 {
164 166 // Execute only if object is not identical
165 167 if (this != &model) {
... ... @@ -192,7 +194,7 @@ GModelRadialGauss&amp; GModelRadialGauss::operator=(const GModelRadialGauss&amp; model)
192 194 /***********************************************************************//**
193 195 * @brief Clear instance
194 196 ***************************************************************************/
195   -void GModelRadialGauss::clear(void)
  197 +void GModelSpatialRadialGauss::clear(void)
196 198 {
197 199 // Free class members (base and derived classes, derived class first)
198 200 free_members();
... ... @@ -212,9 +214,9 @@ void GModelRadialGauss::clear(void)
212 214 /***********************************************************************//**
213 215 * @brief Clone instance
214 216 ***************************************************************************/
215   -GModelRadialGauss* GModelRadialGauss::clone(void) const
  217 +GModelSpatialRadialGauss* GModelSpatialRadialGauss::clone(void) const
216 218 {
217   - return new GModelRadialGauss(*this);
  219 + return new GModelSpatialRadialGauss(*this);
218 220 }
219 221  
220 222  
... ... @@ -234,18 +236,18 @@ GModelRadialGauss* GModelRadialGauss::clone(void) const
234 236 * @todo The Gaussian function is only correct in the small angle
235 237 * approximation.
236 238 ***************************************************************************/
237   -double GModelRadialGauss::eval(const double& theta) const
  239 +double GModelSpatialRadialGauss::eval(const double& theta) const
238 240 {
239 241 // Compute value
240 242 double sigma_rad = sigma() * deg2rad;
241 243 double sigma2 = sigma_rad * sigma_rad;
242 244 double theta2 = theta * theta;
243   - double value = exp(-0.5 * theta2 / sigma2) / (twopi * sigma2);
  245 + double value = std::exp(-0.5 * theta2 / sigma2) / (twopi * sigma2);
244 246  
245 247 // Compile option: Check for NaN/Inf
246 248 #if defined(G_NAN_CHECK)
247 249 if (isnotanumber(value) || isinfinite(value)) {
248   - std::cout << "*** ERROR: GModelRadialGauss::eval";
  250 + std::cout << "*** ERROR: GModelSpatialRadialGauss::eval";
249 251 std::cout << "(theta=" << theta << "): NaN/Inf encountered";
250 252 std::cout << " (value=" << value;
251 253 std::cout << ", sigma_rad=" << sigma_rad;
... ... @@ -269,7 +271,7 @@ double GModelRadialGauss::eval(const double&amp; theta) const
269 271 * gradients will be computed. See GModelRadialShell::eval() for details
270 272 * about the implemented method.
271 273 ***************************************************************************/
272   -double GModelRadialGauss::eval_gradients(const double& theta) const
  274 +double GModelSpatialRadialGauss::eval_gradients(const double& theta) const
273 275 {
274 276 // Return value
275 277 return (eval(theta));
... ... @@ -285,7 +287,7 @@ double GModelRadialGauss::eval_gradients(const double&amp; theta) const
285 287 *
286 288 * @todo This method is only valid in the small angle approximation.
287 289 ***************************************************************************/
288   -GSkyDir GModelRadialGauss::mc(GRan& ran) const
  290 +GSkyDir GModelSpatialRadialGauss::mc(GRan& ran) const
289 291 {
290 292 // Simulate offset from photon arrival direction
291 293 double theta = sigma() * ran.chisq2();
... ... @@ -307,7 +309,7 @@ GSkyDir GModelRadialGauss::mc(GRan&amp; ran) const
307 309 * is of course arbitrary, but allows to limit the integration region for
308 310 * response computation.
309 311 ***************************************************************************/
310   -double GModelRadialGauss::theta_max(void) const
  312 +double GModelSpatialRadialGauss::theta_max(void) const
311 313 {
312 314 // Return value
313 315 return (sigma()*deg2rad*5.0);
... ... @@ -332,7 +334,7 @@ double GModelRadialGauss::theta_max(void) const
332 334 * @todo Implement a test of the sigma and sigma boundary. The sigma
333 335 * and sigma minimum should be >0.
334 336 ***************************************************************************/
335   -void GModelRadialGauss::read(const GXmlElement& xml)
  337 +void GModelSpatialRadialGauss::read(const GXmlElement& xml)
336 338 {
337 339 // Determine number of parameter nodes in XML element
338 340 int npars = xml.elements("parameter");
... ... @@ -394,7 +396,7 @@ void GModelRadialGauss::read(const GXmlElement&amp; xml)
394 396 * will have 3 parameter leafs named "RA", "DEC" and "Sigma". The location
395 397 * leafs are handled by the GModelRadial base class.
396 398 ***************************************************************************/
397   -void GModelRadialGauss::write(GXmlElement& xml) const
  399 +void GModelSpatialRadialGauss::write(GXmlElement& xml) const
398 400 {
399 401 // Write Gaussian location
400 402 GModelSpatialRadial::write(xml);
... ... @@ -442,14 +444,16 @@ void GModelRadialGauss::write(GXmlElement&amp; xml) const
442 444  
443 445 /***********************************************************************//**
444 446 * @brief Print Gaussian source information
  447 + *
  448 + * @return String containing model information.
445 449 ***************************************************************************/
446   -std::string GModelRadialGauss::print(void) const
  450 +std::string GModelSpatialRadialGauss::print(void) const
447 451 {
448 452 // Initialise result string
449 453 std::string result;
450 454  
451 455 // Append header
452   - result.append("=== GModelRadialGauss ===\n");
  456 + result.append("=== GModelSpatialRadialGauss ===\n");
453 457  
454 458 // Append parameters
455 459 result.append(parformat("Number of parameters")+str(size()));
... ... @@ -475,7 +479,7 @@ std::string GModelRadialGauss::print(void) const
475 479 * always require numerical gradient computations. The minimum Gaussian
476 480 * width is set to 1 arcsec.
477 481 ***************************************************************************/
478   -void GModelRadialGauss::init_members(void)
  482 +void GModelSpatialRadialGauss::init_members(void)
479 483 {
480 484  
481 485 // Initialise Gaussian sigma
... ... @@ -506,7 +510,7 @@ void GModelRadialGauss::init_members(void)
506 510 * should have been done by init_members() that was called before. Otherwise
507 511 * we would have sigma twice on the stack.
508 512 ***************************************************************************/
509   -void GModelRadialGauss::copy_members(const GModelRadialGauss& model)
  513 +void GModelSpatialRadialGauss::copy_members(const GModelSpatialRadialGauss& model)
510 514 {
511 515 // Copy members
512 516 m_sigma = model.m_sigma;
... ... @@ -519,7 +523,7 @@ void GModelRadialGauss::copy_members(const GModelRadialGauss&amp; model)
519 523 /***********************************************************************//**
520 524 * @brief Delete class members
521 525 ***************************************************************************/
522   -void GModelRadialGauss::free_members(void)
  526 +void GModelSpatialRadialGauss::free_members(void)
523 527 {
524 528 // Return
525 529 return;
... ...
src/model/GModelSpatialRadialShell.cpp
1 1 /***************************************************************************
2   - * GModelRadialShell.cpp - Radial shell source model class *
  2 + * GModelSpatialRadialShell.cpp - Radial shell source model class *
3 3 * ----------------------------------------------------------------------- *
4 4 * copyright (C) 2011-2013 by Christoph Deil *
5 5 * ----------------------------------------------------------------------- *
... ... @@ -19,7 +19,7 @@
19 19 * *
20 20 ***************************************************************************/
21 21 /**
22   - * @file GModelRadialShell.cpp
  22 + * @file GModelSpatialRadialShell.cpp
23 23 * @brief Radial shell model class implementation
24 24 * @author Christoph Deil
25 25 */
... ... @@ -30,18 +30,18 @@
30 30 #endif
31 31 #include "GException.hpp"
32 32 #include "GTools.hpp"
33   -#include "GModelRadialShell.hpp"
  33 +#include "GModelSpatialRadialShell.hpp"
34 34 #include "GModelSpatialRegistry.hpp"
35 35  
36 36 /* __ Constants __________________________________________________________ */
37 37  
38 38 /* __ Globals ____________________________________________________________ */
39   -const GModelRadialShell g_radial_shell_seed;
40   -const GModelSpatialRegistry g_radial_shell_registry(&g_radial_shell_seed);
  39 +const GModelSpatialRadialShell g_radial_shell_seed;
  40 +const GModelSpatialRegistry g_radial_shell_registry(&g_radial_shell_seed);
41 41  
42 42 /* __ Method name definitions ____________________________________________ */
43   -#define G_READ "GModelRadialShell::read(GXmlElement&)"
44   -#define G_WRITE "GModelRadialShell::write(GXmlElement&)"
  43 +#define G_READ "GModelSpatialRadialShell::read(GXmlElement&)"
  44 +#define G_WRITE "GModelSpatialRadialShell::write(GXmlElement&)"
45 45  
46 46 /* __ Macros _____________________________________________________________ */
47 47  
... ... @@ -60,7 +60,7 @@ const GModelSpatialRegistry g_radial_shell_registry(&amp;g_radial_shell_seed);
60 60 /***********************************************************************//**
61 61 * @brief Void constructor
62 62 ***************************************************************************/
63   -GModelRadialShell::GModelRadialShell(void) : GModelSpatialRadial()
  63 +GModelSpatialRadialShell::GModelSpatialRadialShell(void) : GModelSpatialRadial()
64 64 {
65 65 // Initialise members
66 66 init_members();
... ... @@ -81,11 +81,11 @@ GModelRadialShell::GModelRadialShell(void) : GModelSpatialRadial()
81 81 * The small angle approximation is (a little) faster, but incorrect for
82 82 * shells larger than a few degrees.
83 83 ***************************************************************************/
84   -GModelRadialShell::GModelRadialShell(const GSkyDir& dir,
  84 +GModelSpatialRadialShell::GModelSpatialRadialShell(const GSkyDir& dir,
85 85 const double& radius,
86 86 const double& width,
87 87 const bool& small_angle) :
88   - GModelSpatialRadial()
  88 + GModelSpatialRadial()
89 89 {
90 90 // Initialise members
91 91 init_members();
... ... @@ -107,11 +107,11 @@ GModelRadialShell::GModelRadialShell(const GSkyDir&amp; dir,
107 107 * @param[in] xml XML element.
108 108 *
109 109 * Creates instance of shell spatial model by extracting information from an
110   - * XML element. See GModelRadialShell::read() for more information about the
  110 + * XML element. See GModelSpatialRadialShell::read() for more information about the
111 111 * expected structure of the XML element.
112 112 ***************************************************************************/
113   -GModelRadialShell::GModelRadialShell(const GXmlElement& xml) :
114   - GModelSpatialRadial()
  113 +GModelSpatialRadialShell::GModelSpatialRadialShell(const GXmlElement& xml) :
  114 + GModelSpatialRadial()
115 115 {
116 116 // Initialise members
117 117 init_members();
... ... @@ -129,8 +129,8 @@ GModelRadialShell::GModelRadialShell(const GXmlElement&amp; xml) :
129 129 *
130 130 * @param[in] model Radial shell source model.
131 131 ***************************************************************************/
132   -GModelRadialShell::GModelRadialShell(const GModelRadialShell& model) :
133   - GModelSpatialRadial(model)
  132 +GModelSpatialRadialShell::GModelSpatialRadialShell(const GModelSpatialRadialShell& model) :
  133 + GModelSpatialRadial(model)
134 134 {
135 135 // Initialise members
136 136 init_members();
... ... @@ -146,7 +146,7 @@ GModelRadialShell::GModelRadialShell(const GModelRadialShell&amp; model) :
146 146 /***********************************************************************//**
147 147 * @brief Destructor
148 148 ***************************************************************************/
149   -GModelRadialShell::~GModelRadialShell(void)
  149 +GModelSpatialRadialShell::~GModelSpatialRadialShell(void)
150 150 {
151 151 // Free members
152 152 free_members();
... ... @@ -166,8 +166,9 @@ GModelRadialShell::~GModelRadialShell(void)
166 166 * @brief Assignment operator
167 167 *
168 168 * @param[in] model Radial shell source model.
  169 + * @return Radial shell source model.
169 170 ***************************************************************************/
170   -GModelRadialShell& GModelRadialShell::operator=(const GModelRadialShell& model)
  171 +GModelSpatialRadialShell& GModelSpatialRadialShell::operator=(const GModelSpatialRadialShell& model)
171 172 {
172 173 // Execute only if object is not identical
173 174 if (this != &model) {
... ... @@ -200,7 +201,7 @@ GModelRadialShell&amp; GModelRadialShell::operator=(const GModelRadialShell&amp; model)
200 201 /***********************************************************************//**
201 202 * @brief Clear instance
202 203 ***************************************************************************/
203   -void GModelRadialShell::clear(void)
  204 +void GModelSpatialRadialShell::clear(void)
204 205 {
205 206 // Free class members (base and derived classes, derived class first)
206 207 free_members();
... ... @@ -219,10 +220,12 @@ void GModelRadialShell::clear(void)
219 220  
220 221 /***********************************************************************//**
221 222 * @brief Clone instance
  223 + *
  224 + * @return Pointer to deep copy of model.
222 225 ***************************************************************************/
223   -GModelRadialShell* GModelRadialShell::clone(void) const
  226 +GModelSpatialRadialShell* GModelSpatialRadialShell::clone(void) const
224 227 {
225   - return new GModelRadialShell(*this);
  228 + return new GModelSpatialRadialShell(*this);
226 229 }
227 230  
228 231  
... ... @@ -278,7 +281,7 @@ GModelRadialShell* GModelRadialShell::clone(void) const
278 281 * Here, \f$\theta_{\rm in}\f$ and \f$\theta_{\rm out}\f$ are the shell inner
279 282 * and outer radius.
280 283 ***************************************************************************/
281   -double GModelRadialShell::eval(const double& theta) const
  284 +double GModelSpatialRadialShell::eval(const double& theta) const
282 285 {
283 286 // Update precomputation cache
284 287 update();
... ... @@ -296,9 +299,9 @@ double GModelRadialShell::eval(const double&amp; theta) const
296 299 // Compute value
297 300 double value = 0.0;
298 301 if (x < m_x_out) {
299   - value = sqrt(m_x_out - x);
  302 + value = std::sqrt(m_x_out - x);
300 303 if (x < m_x_in) {
301   - value -= sqrt(m_x_in - x);
  304 + value -= std::sqrt(m_x_in - x);
302 305 }
303 306 }
304 307  
... ... @@ -308,7 +311,7 @@ double GModelRadialShell::eval(const double&amp; theta) const
308 311 // Compile option: Check for NaN/Inf
309 312 #if defined(G_NAN_CHECK)
310 313 if (isnotanumber(result) || isinfinite(result)) {
311   - std::cout << "*** ERROR: GModelRadialShell::eval";
  314 + std::cout << "*** ERROR: GModelSpatialRadialShell::eval";
312 315 std::cout << "(theta=" << theta << "): NaN/Inf encountered";
313 316 std::cout << " (result=" << result;
314 317 std::cout << ", m_norm=" << m_norm;
... ... @@ -331,11 +334,11 @@ double GModelRadialShell::eval(const double&amp; theta) const
331 334 *
332 335 * @param[in] theta Angular distance from shell centre (radians).
333 336 *
334   - * This method simply calls GModelRadialShell::eval() as no analytical
335   - * gradients will be computed. See GModelRadialShell::eval() for details
  337 + * This method simply calls GModelSpatialRadialShell::eval() as no analytical
  338 + * gradients will be computed. See GModelSpatialRadialShell::eval() for details
336 339 * about the implemented method.
337 340 ***************************************************************************/
338   -double GModelRadialShell::eval_gradients(const double& theta) const
  341 +double GModelSpatialRadialShell::eval_gradients(const double& theta) const
339 342 {
340 343 // Return value
341 344 return (eval(theta));
... ... @@ -349,7 +352,7 @@ double GModelRadialShell::eval_gradients(const double&amp; theta) const
349 352 *
350 353 * Draws an arbitrary sky position from the 2D shell distribution.
351 354 ***************************************************************************/
352   -GSkyDir GModelRadialShell::mc(GRan& ran) const
  355 +GSkyDir GModelSpatialRadialShell::mc(GRan& ran) const
353 356 {
354 357 // Update precomputation cache
355 358 update();
... ... @@ -392,7 +395,7 @@ GSkyDir GModelRadialShell::mc(GRan&amp; ran) const
392 395 /***********************************************************************//**
393 396 * @brief Return maximum model radius (in radians)
394 397 ***************************************************************************/
395   -double GModelRadialShell::theta_max(void) const
  398 +double GModelSpatialRadialShell::theta_max(void) const
396 399 {
397 400 // Return value
398 401 return ((radius()+width())*deg2rad);
... ... @@ -418,7 +421,7 @@ double GModelRadialShell::theta_max(void) const
418 421 * width boundary. The radius and radius boundary should be >=0, the
419 422 * width and width boundary should be >0.
420 423 ***************************************************************************/
421   -void GModelRadialShell::read(const GXmlElement& xml)
  424 +void GModelSpatialRadialShell::read(const GXmlElement& xml)
422 425 {
423 426 // Determine number of parameter nodes in XML element
424 427 int npars = xml.elements("parameter");
... ... @@ -495,7 +498,7 @@ void GModelRadialShell::read(const GXmlElement&amp; xml)
495 498 * element will have 4 parameter leafs named "RA", "DEC", "Radius" and
496 499 * "Width". The location leafs are handled by the GModelRadial base class.
497 500 ***************************************************************************/
498   -void GModelRadialShell::write(GXmlElement& xml) const
  501 +void GModelSpatialRadialShell::write(GXmlElement& xml) const
499 502 {
500 503 // Write shell location
501 504 GModelSpatialRadial::write(xml);
... ... @@ -550,14 +553,16 @@ void GModelRadialShell::write(GXmlElement&amp; xml) const
550 553  
551 554 /***********************************************************************//**
552 555 * @brief Print information
  556 + *
  557 + * @return String containing model information.
553 558 ***************************************************************************/
554   -std::string GModelRadialShell::print(void) const
  559 +std::string GModelSpatialRadialShell::print(void) const
555 560 {
556 561 // Initialise result string
557 562 std::string result;
558 563  
559 564 // Append header
560   - result.append("=== GModelRadialShell ===\n");
  565 + result.append("=== GModelSpatialRadialShell ===\n");
561 566  
562 567 // Append parameters
563 568 result.append(parformat("Number of parameters")+str(size()));
... ... @@ -579,7 +584,7 @@ std::string GModelRadialShell::print(void) const
579 584 /***********************************************************************//**
580 585 * @brief Initialise class members
581 586 ***************************************************************************/
582   -void GModelRadialShell::init_members(void)
  587 +void GModelSpatialRadialShell::init_members(void)
583 588 {
584 589 // Initialise Radius
585 590 m_radius.clear();
... ... @@ -634,7 +639,7 @@ void GModelRadialShell::init_members(void)
634 639 * should have been done by init_members() that was called before. Otherwise
635 640 * we would have the radius and width twice on the stack.
636 641 ***************************************************************************/
637   -void GModelRadialShell::copy_members(const GModelRadialShell& model)
  642 +void GModelSpatialRadialShell::copy_members(const GModelSpatialRadialShell& model)
638 643 {
639 644 // Copy members
640 645 m_radius = model.m_radius;
... ... @@ -658,7 +663,7 @@ void GModelRadialShell::copy_members(const GModelRadialShell&amp; model)
658 663 /***********************************************************************//**
659 664 * @brief Delete class members
660 665 ***************************************************************************/
661   -void GModelRadialShell::free_members(void)
  666 +void GModelSpatialRadialShell::free_members(void)
662 667 {
663 668 // Return
664 669 return;
... ... @@ -695,7 +700,7 @@ void GModelRadialShell::free_members(void)
695 700 * \frac{\sqrt{2} \cos {\tt m\_theta\_in}}
696 701 * {\sqrt{2} + \sqrt{1 - \cos 2 {\tt m\_theta\_in}}} \right)\f]
697 702 ***************************************************************************/
698   -void GModelRadialShell::update() const
  703 +void GModelSpatialRadialShell::update() const
699 704 {
700 705 // Set constants
701 706 const double c1 = twopi / 3.0;
... ... @@ -734,7 +739,7 @@ void GModelRadialShell::update() const
734 739 // Compile option: Check for NaN/Inf
735 740 #if defined(G_NAN_CHECK)
736 741 if (isnotanumber(m_norm) || isinfinite(m_norm)) {
737   - std::cout << "*** ERROR: GModelRadialShell::update:";
  742 + std::cout << "*** ERROR: GModelSpatialRadialShell::update:";
738 743 std::cout << " NaN/Inf encountered";
739 744 std::cout << " (m_norm=" << m_norm;
740 745 std::cout << ", radius=" << radius();
... ... @@ -758,7 +763,7 @@ void GModelRadialShell::update() const
758 763 *
759 764 * Computes \f$f1(x) = \sqrt{1 - \cos 2 x}\f$.
760 765 ***************************************************************************/
761   -double GModelRadialShell::f1(double x)
  766 +double GModelSpatialRadialShell::f1(double x)
762 767 {
763 768 // Compute value
764 769 double f1 = std::sqrt(1.0 - std::cos(2.0 * x));
... ... @@ -776,7 +781,7 @@ double GModelRadialShell::f1(double x)
776 781 * \ln \left( \frac{\sqrt{2} \cos x}{\sqrt{2} + \sqrt{ 1 - \cos 2 x}}
777 782 * \right)\f].
778 783 ***************************************************************************/
779   -double GModelRadialShell::f2(double x)
  784 +double GModelSpatialRadialShell::f2(double x)
780 785 {
781 786 // Compute value
782 787 double t1 = (1.0 + std::cos(2.0*x)) / 4.0;
... ...
src/model/Makefile.am
... ... @@ -16,9 +16,9 @@ sources = GModelPar.cpp \
16 16 GModelSpatialRegistry.cpp \
17 17 GModelSpatialPointSource.cpp \
18 18 GModelSpatialRadial.cpp \
19   - GModelRadialDisk.cpp \
20   - GModelRadialGauss.cpp \
21   - GModelRadialShell.cpp \
  19 + GModelSpatialRadialDisk.cpp \
  20 + GModelSpatialRadialGauss.cpp \
  21 + GModelSpatialRadialShell.cpp \
22 22 GModelSpatialConst.cpp \
23 23 GModelSpatialCube.cpp \
24 24 GModelSpatialMap.cpp \
... ...