Commit 1fdb5143de686d7aadf8f6be3ab19d9e7cc72805
1 parent
109faeef
Replace GModelRadial by GModelSpatialRadial.
Showing
12 changed files
with
145 additions
and
146 deletions
include/GModelRadialDisk.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * GModelRadialDisk.hpp - Radial disk source model class * | |
| 2 | + * GModelRadialDisk.hpp - Radial disk source model class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011 by Christoph Deil * | |
| 4 | + * copyright (C) 2011-2013 by Christoph Deil * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | /** |
| 22 | 22 | * @file GModelRadialDisk.hpp |
| 23 | 23 | * @brief Radial disk model class interface definition |
| 24 | - * @author C. Deil | |
| 24 | + * @author Christoph Deil | |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | 27 | #ifndef GMODELRADIALDISK_HPP |
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | |
| 30 | 30 | /* __ Includes ___________________________________________________________ */ |
| 31 | 31 | #include <string> |
| 32 | -#include "GModelRadial.hpp" | |
| 32 | +#include "GModelSpatialRadial.hpp" | |
| 33 | 33 | #include "GModelPar.hpp" |
| 34 | 34 | #include "GSkyDir.hpp" |
| 35 | 35 | #include "GXmlElement.hpp" |
| ... | ... | @@ -44,7 +44,7 @@ |
| 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 GModelRadial { | |
| 47 | +class GModelRadialDisk : public GModelSpatialRadial { | |
| 48 | 48 | |
| 49 | 49 | public: |
| 50 | 50 | // Constructors and destructors | ... | ... |
include/GModelRadialGauss.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelRadialGauss.hpp - Radial Gaussian source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011 by Jurgen Knodlseder * | |
| 4 | + * copyright (C) 2011-2013 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | /** |
| 22 | 22 | * @file GModelRadialGauss.hpp |
| 23 | 23 | * @brief Radial Gaussian model class interface definition |
| 24 | - * @author J. Knodlseder | |
| 24 | + * @author Juergen Knoedlseder | |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | 27 | #ifndef GMODELRADIALGAUSS_HPP |
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | |
| 30 | 30 | /* __ Includes ___________________________________________________________ */ |
| 31 | 31 | #include <string> |
| 32 | -#include "GModelRadial.hpp" | |
| 32 | +#include "GModelSpatialRadial.hpp" | |
| 33 | 33 | #include "GModelPar.hpp" |
| 34 | 34 | #include "GSkyDir.hpp" |
| 35 | 35 | #include "GXmlElement.hpp" |
| ... | ... | @@ -43,7 +43,7 @@ |
| 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 GModelRadial { | |
| 46 | +class GModelRadialGauss : public GModelSpatialRadial { | |
| 47 | 47 | |
| 48 | 48 | public: |
| 49 | 49 | // Constructors and destructors | ... | ... |
include/GModelRadialShell.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * GModelRadialShell.hpp - Radial shell source model class * | |
| 2 | + * GModelRadialShell.hpp - Radial shell source model class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011 by Christoph Deil * | |
| 4 | + * copyright (C) 2011-2013 by Christoph Deil * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | /** |
| 22 | 22 | * @file GModelRadialShell.hpp |
| 23 | 23 | * @brief Radial shell model class interface definition |
| 24 | - * @author C. Deil | |
| 24 | + * @author Christoph Deil | |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | 27 | #ifndef GMODELRADIALSHELL_HPP |
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | |
| 30 | 30 | /* __ Includes ___________________________________________________________ */ |
| 31 | 31 | #include <string> |
| 32 | -#include "GModelRadial.hpp" | |
| 32 | +#include "GModelSpatialRadial.hpp" | |
| 33 | 33 | #include "GModelPar.hpp" |
| 34 | 34 | #include "GSkyDir.hpp" |
| 35 | 35 | #include "GXmlElement.hpp" |
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | * the gamma-ray domain, and improves the convergence of the fitting |
| 55 | 55 | * algorithms. |
| 56 | 56 | ***************************************************************************/ |
| 57 | -class GModelRadialShell : public GModelRadial { | |
| 57 | +class GModelRadialShell : public GModelSpatialRadial { | |
| 58 | 58 | |
| 59 | 59 | public: |
| 60 | 60 | // Constructors and destructors | ... | ... |
include/GResponse.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GResponse.hpp - Abstract response base class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2008-2012 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2008-2013 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -35,7 +35,7 @@ |
| 35 | 35 | #include "GSource.hpp" |
| 36 | 36 | #include "GEnergy.hpp" |
| 37 | 37 | #include "GTime.hpp" |
| 38 | -#include "GModelRadial.hpp" | |
| 38 | +#include "GModelSpatialRadial.hpp" | |
| 39 | 39 | #include "GFunction.hpp" |
| 40 | 40 | #include "GMatrix.hpp" |
| 41 | 41 | |
| ... | ... | @@ -111,12 +111,12 @@ protected: |
| 111 | 111 | // Npred theta integration kernel |
| 112 | 112 | class npred_kern_theta : public GFunction { |
| 113 | 113 | public: |
| 114 | - npred_kern_theta(const GResponse* rsp, | |
| 115 | - const GModelRadial* radial, | |
| 116 | - const GEnergy* srcEng, | |
| 117 | - const GTime* srcTime, | |
| 118 | - const GObservation* obs, | |
| 119 | - const GMatrix* rot) : | |
| 114 | + npred_kern_theta(const GResponse* rsp, | |
| 115 | + const GModelSpatialRadial* radial, | |
| 116 | + const GEnergy* srcEng, | |
| 117 | + const GTime* srcTime, | |
| 118 | + const GObservation* obs, | |
| 119 | + const GMatrix* rot) : | |
| 120 | 120 | m_rsp(rsp), |
| 121 | 121 | m_radial(radial), |
| 122 | 122 | m_srcEng(srcEng), |
| ... | ... | @@ -125,12 +125,12 @@ protected: |
| 125 | 125 | m_rot(rot) { } |
| 126 | 126 | double eval(double theta); |
| 127 | 127 | protected: |
| 128 | - const GResponse* m_rsp; //!< Pointer to response | |
| 129 | - const GModelRadial* m_radial; //!< Pointer to radial spatial model | |
| 130 | - const GEnergy* m_srcEng; //!< Pointer to true photon energy | |
| 131 | - const GTime* m_srcTime; //!< Pointer to true photon arrival time | |
| 132 | - const GObservation* m_obs; //!< Pointer to observation | |
| 133 | - const GMatrix* m_rot; //!< Pointer to rotation matrix | |
| 128 | + const GResponse* m_rsp; //!< Pointer to response | |
| 129 | + const GModelSpatialRadial* m_radial; //!< Pointer to radial spatial model | |
| 130 | + const GEnergy* m_srcEng; //!< Pointer to true photon energy | |
| 131 | + const GTime* m_srcTime; //!< Pointer to true photon arrival time | |
| 132 | + const GObservation* m_obs; //!< Pointer to observation | |
| 133 | + const GMatrix* m_rot; //!< Pointer to rotation matrix | |
| 134 | 134 | }; |
| 135 | 135 | |
| 136 | 136 | // Npred phi integration kernel | ... | ... |
inst/cta/include/GCTAResponse.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GCTAResponse.hpp - CTA Response class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2010-2012 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2010-2013 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -33,7 +33,7 @@ |
| 33 | 33 | #include "GMatrix.hpp" |
| 34 | 34 | #include "GEvent.hpp" |
| 35 | 35 | #include "GModelSky.hpp" |
| 36 | -#include "GModelRadial.hpp" | |
| 36 | +#include "GModelSpatialRadial.hpp" | |
| 37 | 37 | #include "GObservation.hpp" |
| 38 | 38 | #include "GResponse.hpp" |
| 39 | 39 | #include "GPointing.hpp" | ... | ... |
inst/cta/src/GCTAResponse.cpp
| ... | ... | @@ -879,7 +879,8 @@ double GCTAResponse::irf_extended(const GEvent& event, |
| 879 | 879 | } |
| 880 | 880 | |
| 881 | 881 | // Get pointer on radial model |
| 882 | - const GModelRadial* model = dynamic_cast<const GModelRadial*>(source.model()); | |
| 882 | + const GModelSpatialRadial* model = | |
| 883 | + dynamic_cast<const GModelSpatialRadial*>(source.model()); | |
| 883 | 884 | if (model == NULL) { |
| 884 | 885 | throw GCTAException::bad_model_type(G_IRF_EXTENDED); |
| 885 | 886 | } |
| ... | ... | @@ -1185,7 +1186,8 @@ double GCTAResponse::npred_extended(const GSource& source, |
| 1185 | 1186 | } |
| 1186 | 1187 | |
| 1187 | 1188 | // Get pointer on radial model |
| 1188 | - const GModelRadial* model = dynamic_cast<const GModelRadial*>(source.model()); | |
| 1189 | + const GModelSpatialRadial* model = | |
| 1190 | + dynamic_cast<const GModelSpatialRadial*>(source.model()); | |
| 1189 | 1191 | if (model == NULL) { |
| 1190 | 1192 | throw GCTAException::bad_model_type(G_IRF_EXTENDED); |
| 1191 | 1193 | } | ... | ... |
inst/cta/src/GCTAResponse_helpers.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * GCTAResponse_helpers.hpp - CTA response helper classes * | |
| 2 | + * GCTAResponse_helpers.hpp - CTA response helper classes * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2012 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2012-2013 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -34,7 +34,7 @@ |
| 34 | 34 | #include "GMatrix.hpp" |
| 35 | 35 | #include "GEnergy.hpp" |
| 36 | 36 | #include "GTime.hpp" |
| 37 | -#include "GModelRadial.hpp" | |
| 37 | +#include "GModelSpatialRadial.hpp" | |
| 38 | 38 | #include "GFunction.hpp" |
| 39 | 39 | |
| 40 | 40 | /* __ Type definitions ___________________________________________________ */ |
| ... | ... | @@ -91,16 +91,16 @@ protected: |
| 91 | 91 | ***************************************************************************/ |
| 92 | 92 | class cta_irf_radial_kern_rho : public GFunction { |
| 93 | 93 | public: |
| 94 | - cta_irf_radial_kern_rho(const GCTAResponse* rsp, | |
| 95 | - const GModelRadial* model, | |
| 96 | - double zenith, | |
| 97 | - double azimuth, | |
| 98 | - double srcLogEng, | |
| 99 | - double obsLogEng, | |
| 100 | - double zeta, | |
| 101 | - double lambda, | |
| 102 | - double omega0, | |
| 103 | - double delta_max) : | |
| 94 | + cta_irf_radial_kern_rho(const GCTAResponse* rsp, | |
| 95 | + const GModelSpatialRadial* model, | |
| 96 | + double zenith, | |
| 97 | + double azimuth, | |
| 98 | + double srcLogEng, | |
| 99 | + double obsLogEng, | |
| 100 | + double zeta, | |
| 101 | + double lambda, | |
| 102 | + double omega0, | |
| 103 | + double delta_max) : | |
| 104 | 104 | m_rsp(rsp), |
| 105 | 105 | m_model(model), |
| 106 | 106 | m_zenith(zenith), |
| ... | ... | @@ -118,21 +118,21 @@ public: |
| 118 | 118 | m_cos_delta_max(std::cos(delta_max)) { } |
| 119 | 119 | double eval(double rho); |
| 120 | 120 | protected: |
| 121 | - const GCTAResponse* m_rsp; //!< Pointer to CTA response | |
| 122 | - const GModelRadial* m_model; //!< Pointer to radial model | |
| 123 | - double m_zenith; //!< Pointing zenith angle | |
| 124 | - double m_azimuth; //!< Pointing azimuth angle | |
| 125 | - double m_srcLogEng; //!< True photon energy | |
| 126 | - double m_obsLogEng; //!< Measured photon energy | |
| 127 | - double m_zeta; //!< Distance model centre - measured photon | |
| 128 | - double m_cos_zeta; //!< Cosine of zeta | |
| 129 | - double m_sin_zeta; //!< Sine of zeta | |
| 130 | - double m_lambda; //!< Distance model centre - pointing | |
| 131 | - double m_cos_lambda; //!< Cosine of lambda | |
| 132 | - double m_sin_lambda; //!< Sine of lambda | |
| 133 | - double m_omega0; //!< Azimuth of pointing in model system | |
| 134 | - double m_delta_max; //!< Maximum PSF radius | |
| 135 | - double m_cos_delta_max; //!< Cosine of maximum PSF radius | |
| 121 | + const GCTAResponse* m_rsp; //!< Pointer to CTA response | |
| 122 | + const GModelSpatialRadial* m_model; //!< Pointer to radial spatial model | |
| 123 | + double m_zenith; //!< Pointing zenith angle | |
| 124 | + double m_azimuth; //!< Pointing azimuth angle | |
| 125 | + double m_srcLogEng; //!< True photon energy | |
| 126 | + double m_obsLogEng; //!< Measured photon energy | |
| 127 | + double m_zeta; //!< Distance model centre - measured photon | |
| 128 | + double m_cos_zeta; //!< Cosine of zeta | |
| 129 | + double m_sin_zeta; //!< Sine of zeta | |
| 130 | + double m_lambda; //!< Distance model centre - pointing | |
| 131 | + double m_cos_lambda; //!< Cosine of lambda | |
| 132 | + double m_sin_lambda; //!< Sine of lambda | |
| 133 | + double m_omega0; //!< Azimuth of pointing in model system | |
| 134 | + double m_delta_max; //!< Maximum PSF radius | |
| 135 | + double m_cos_delta_max; //!< Cosine of maximum PSF radius | |
| 136 | 136 | }; |
| 137 | 137 | |
| 138 | 138 | |
| ... | ... | @@ -194,15 +194,15 @@ protected: |
| 194 | 194 | ***************************************************************************/ |
| 195 | 195 | class cta_npred_radial_kern_theta : public GFunction { |
| 196 | 196 | public: |
| 197 | - cta_npred_radial_kern_theta(const GCTAResponse* rsp, | |
| 198 | - const GModelRadial* model, | |
| 199 | - const GEnergy* srcEng, | |
| 200 | - const GTime* srcTime, | |
| 201 | - const GCTAObservation* obs, | |
| 202 | - const GMatrix* rot, | |
| 203 | - double dist, | |
| 204 | - double radius, | |
| 205 | - double phi) : | |
| 197 | + cta_npred_radial_kern_theta(const GCTAResponse* rsp, | |
| 198 | + const GModelSpatialRadial* model, | |
| 199 | + const GEnergy* srcEng, | |
| 200 | + const GTime* srcTime, | |
| 201 | + const GCTAObservation* obs, | |
| 202 | + const GMatrix* rot, | |
| 203 | + double dist, | |
| 204 | + double radius, | |
| 205 | + double phi) : | |
| 206 | 206 | m_rsp(rsp), |
| 207 | 207 | m_model(model), |
| 208 | 208 | m_srcEng(srcEng), |
| ... | ... | @@ -217,18 +217,18 @@ public: |
| 217 | 217 | m_phi(phi) { } |
| 218 | 218 | double eval(double theta); |
| 219 | 219 | protected: |
| 220 | - const GCTAResponse* m_rsp; //!< Pointer to response | |
| 221 | - const GModelRadial* m_model; //!< Pointer to radial model | |
| 222 | - const GEnergy* m_srcEng; //!< Pointer to true photon energy | |
| 223 | - const GTime* m_srcTime; //!< Pointer to true photon arrival time | |
| 224 | - const GCTAObservation* m_obs; //!< Pointer to observation | |
| 225 | - const GMatrix* m_rot; //!< Rotation matrix | |
| 226 | - double m_dist; //!< Distance model-ROI centre | |
| 227 | - double m_cos_dist; //!< Cosine of distance model-ROI centre | |
| 228 | - double m_sin_dist; //!< Sine of distance model-ROI centre | |
| 229 | - double m_radius; //!< ROI+PSF radius | |
| 230 | - double m_cos_radius; //!< Cosine of ROI+PSF radius | |
| 231 | - double m_phi; //!< Position angle of ROI | |
| 220 | + const GCTAResponse* m_rsp; //!< Pointer to response | |
| 221 | + const GModelSpatialRadial* m_model; //!< Pointer to radial spatial model | |
| 222 | + const GEnergy* m_srcEng; //!< Pointer to true photon energy | |
| 223 | + const GTime* m_srcTime; //!< Pointer to true photon arrival time | |
| 224 | + const GCTAObservation* m_obs; //!< Pointer to observation | |
| 225 | + const GMatrix* m_rot; //!< Rotation matrix | |
| 226 | + double m_dist; //!< Distance model-ROI centre | |
| 227 | + double m_cos_dist; //!< Cosine of distance model-ROI centre | |
| 228 | + double m_sin_dist; //!< Sine of distance model-ROI centre | |
| 229 | + double m_radius; //!< ROI+PSF radius | |
| 230 | + double m_cos_radius; //!< Cosine of ROI+PSF radius | |
| 231 | + double m_phi; //!< Position angle of ROI | |
| 232 | 232 | }; |
| 233 | 233 | |
| 234 | 234 | ... | ... |
src/model/GModelRadialDisk.cpp
| ... | ... | @@ -59,7 +59,7 @@ const GModelSpatialRegistry g_radial_disk_registry(&g_radial_disk_seed); |
| 59 | 59 | /***********************************************************************//** |
| 60 | 60 | * @brief Void constructor |
| 61 | 61 | ***************************************************************************/ |
| 62 | -GModelRadialDisk::GModelRadialDisk(void) : GModelRadial() | |
| 62 | +GModelRadialDisk::GModelRadialDisk(void) : GModelSpatialRadial() | |
| 63 | 63 | { |
| 64 | 64 | // Initialise members |
| 65 | 65 | init_members(); |
| ... | ... | @@ -75,8 +75,8 @@ GModelRadialDisk::GModelRadialDisk(void) : GModelRadial() |
| 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, | |
| 79 | - const double& radius) : GModelRadial() | |
| 78 | +GModelRadialDisk::GModelRadialDisk(const GSkyDir& dir, const double& radius) : | |
| 79 | + GModelSpatialRadial() | |
| 80 | 80 | { |
| 81 | 81 | // Initialise members |
| 82 | 82 | init_members(); |
| ... | ... | @@ -99,7 +99,8 @@ GModelRadialDisk::GModelRadialDisk(const GSkyDir& dir, |
| 99 | 99 | * XML element. See GModelRadialDisk::read() for more information about the |
| 100 | 100 | * expected structure of the XML element. |
| 101 | 101 | ***************************************************************************/ |
| 102 | -GModelRadialDisk::GModelRadialDisk(const GXmlElement& xml) : GModelRadial() | |
| 102 | +GModelRadialDisk::GModelRadialDisk(const GXmlElement& xml) : | |
| 103 | + GModelSpatialRadial() | |
| 103 | 104 | { |
| 104 | 105 | // Initialise members |
| 105 | 106 | init_members(); |
| ... | ... | @@ -117,8 +118,8 @@ GModelRadialDisk::GModelRadialDisk(const GXmlElement& xml) : GModelRadial() |
| 117 | 118 | * |
| 118 | 119 | * @param[in] model Radial disk model. |
| 119 | 120 | ***************************************************************************/ |
| 120 | -GModelRadialDisk::GModelRadialDisk(const GModelRadialDisk& model) | |
| 121 | - : GModelRadial(model) | |
| 121 | +GModelRadialDisk::GModelRadialDisk(const GModelRadialDisk& model) : | |
| 122 | + GModelSpatialRadial(model) | |
| 122 | 123 | { |
| 123 | 124 | // Initialise members |
| 124 | 125 | init_members(); |
| ... | ... | @@ -161,7 +162,7 @@ GModelRadialDisk& GModelRadialDisk::operator= (const GModelRadialDisk& model) |
| 161 | 162 | if (this != &model) { |
| 162 | 163 | |
| 163 | 164 | // Copy base class members |
| 164 | - this->GModelRadial::operator=(model); | |
| 165 | + this->GModelSpatialRadial::operator=(model); | |
| 165 | 166 | |
| 166 | 167 | // Free members |
| 167 | 168 | free_members(); |
| ... | ... | @@ -187,17 +188,17 @@ GModelRadialDisk& GModelRadialDisk::operator= (const GModelRadialDisk& model) |
| 187 | 188 | |
| 188 | 189 | /***********************************************************************//** |
| 189 | 190 | * @brief Clear instance |
| 190 | -***************************************************************************/ | |
| 191 | + ***************************************************************************/ | |
| 191 | 192 | void GModelRadialDisk::clear(void) |
| 192 | 193 | { |
| 193 | 194 | // Free class members (base and derived classes, derived class first) |
| 194 | 195 | free_members(); |
| 195 | - this->GModelRadial::free_members(); | |
| 196 | + this->GModelSpatialRadial::free_members(); | |
| 196 | 197 | this->GModelSpatial::free_members(); |
| 197 | 198 | |
| 198 | 199 | // Initialise members |
| 199 | 200 | this->GModelSpatial::init_members(); |
| 200 | - this->GModelRadial::init_members(); | |
| 201 | + this->GModelSpatialRadial::init_members(); | |
| 201 | 202 | init_members(); |
| 202 | 203 | |
| 203 | 204 | // Return |
| ... | ... | @@ -207,7 +208,7 @@ void GModelRadialDisk::clear(void) |
| 207 | 208 | |
| 208 | 209 | /***********************************************************************//** |
| 209 | 210 | * @brief Clone instance |
| 210 | -***************************************************************************/ | |
| 211 | + ***************************************************************************/ | |
| 211 | 212 | GModelRadialDisk* GModelRadialDisk::clone(void) const |
| 212 | 213 | { |
| 213 | 214 | return new GModelRadialDisk(*this); |
| ... | ... | @@ -347,7 +348,7 @@ void GModelRadialDisk::read(const GXmlElement& xml) |
| 347 | 348 | } |
| 348 | 349 | |
| 349 | 350 | // Read disk location |
| 350 | - GModelRadial::read(xml); | |
| 351 | + GModelSpatialRadial::read(xml); | |
| 351 | 352 | |
| 352 | 353 | // Extract model parameters |
| 353 | 354 | int npar[1] = {0}; |
| ... | ... | @@ -397,7 +398,7 @@ void GModelRadialDisk::read(const GXmlElement& xml) |
| 397 | 398 | void GModelRadialDisk::write(GXmlElement& xml) const |
| 398 | 399 | { |
| 399 | 400 | // Write disk location |
| 400 | - GModelRadial::write(xml); | |
| 401 | + GModelSpatialRadial::write(xml); | |
| 401 | 402 | |
| 402 | 403 | // If XML element has 2 nodes (which should be the location nodes) |
| 403 | 404 | // then append 1 parameter node |
| ... | ... | @@ -450,6 +451,8 @@ std::string GModelRadialDisk::print(void) const |
| 450 | 451 | |
| 451 | 452 | // Append header |
| 452 | 453 | result.append("=== GModelRadialDisk ===\n"); |
| 454 | + | |
| 455 | + // Append parameters | |
| 453 | 456 | result.append(parformat("Number of parameters")+str(size())); |
| 454 | 457 | for (int i = 0; i < size(); ++i) { |
| 455 | 458 | result.append("\n"+m_pars[i]->print()); | ... | ... |
src/model/GModelRadialGauss.cpp
| ... | ... | @@ -59,7 +59,7 @@ const GModelSpatialRegistry g_radial_gauss_registry(&g_radial_gauss_seed); |
| 59 | 59 | /***********************************************************************//** |
| 60 | 60 | * @brief Void constructor |
| 61 | 61 | ***************************************************************************/ |
| 62 | -GModelRadialGauss::GModelRadialGauss(void) : GModelRadial() | |
| 62 | +GModelRadialGauss::GModelRadialGauss(void) : GModelSpatialRadial() | |
| 63 | 63 | { |
| 64 | 64 | // Initialise members |
| 65 | 65 | init_members(); |
| ... | ... | @@ -78,8 +78,8 @@ GModelRadialGauss::GModelRadialGauss(void) : GModelRadial() |
| 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, | |
| 82 | - const double& sigma) : GModelRadial() | |
| 81 | +GModelRadialGauss::GModelRadialGauss(const GSkyDir& dir, const double& sigma) : | |
| 82 | + GModelSpatialRadial() | |
| 83 | 83 | { |
| 84 | 84 | // Initialise members |
| 85 | 85 | init_members(); |
| ... | ... | @@ -102,7 +102,8 @@ GModelRadialGauss::GModelRadialGauss(const GSkyDir& dir, |
| 102 | 102 | * from an XML element. See GModelRadialGauss::read() for more information |
| 103 | 103 | * about the expected structure of the XML element. |
| 104 | 104 | ***************************************************************************/ |
| 105 | -GModelRadialGauss::GModelRadialGauss(const GXmlElement& xml) : GModelRadial() | |
| 105 | +GModelRadialGauss::GModelRadialGauss(const GXmlElement& xml) : | |
| 106 | + GModelSpatialRadial() | |
| 106 | 107 | { |
| 107 | 108 | // Initialise members |
| 108 | 109 | init_members(); |
| ... | ... | @@ -120,8 +121,8 @@ GModelRadialGauss::GModelRadialGauss(const GXmlElement& xml) : GModelRadial() |
| 120 | 121 | * |
| 121 | 122 | * @param[in] model Radial Gaussian model. |
| 122 | 123 | ***************************************************************************/ |
| 123 | -GModelRadialGauss::GModelRadialGauss(const GModelRadialGauss& model) | |
| 124 | - : GModelRadial(model) | |
| 124 | +GModelRadialGauss::GModelRadialGauss(const GModelRadialGauss& model) : | |
| 125 | + GModelSpatialRadial(model) | |
| 125 | 126 | { |
| 126 | 127 | // Initialise members |
| 127 | 128 | init_members(); |
| ... | ... | @@ -164,7 +165,7 @@ GModelRadialGauss& GModelRadialGauss::operator=(const GModelRadialGauss& model) |
| 164 | 165 | if (this != &model) { |
| 165 | 166 | |
| 166 | 167 | // Copy base class members |
| 167 | - this->GModelRadial::operator=(model); | |
| 168 | + this->GModelSpatialRadial::operator=(model); | |
| 168 | 169 | |
| 169 | 170 | // Free members |
| 170 | 171 | free_members(); |
| ... | ... | @@ -190,17 +191,17 @@ GModelRadialGauss& GModelRadialGauss::operator=(const GModelRadialGauss& model) |
| 190 | 191 | |
| 191 | 192 | /***********************************************************************//** |
| 192 | 193 | * @brief Clear instance |
| 193 | -***************************************************************************/ | |
| 194 | + ***************************************************************************/ | |
| 194 | 195 | void GModelRadialGauss::clear(void) |
| 195 | 196 | { |
| 196 | 197 | // Free class members (base and derived classes, derived class first) |
| 197 | 198 | free_members(); |
| 198 | - this->GModelRadial::free_members(); | |
| 199 | + this->GModelSpatialRadial::free_members(); | |
| 199 | 200 | this->GModelSpatial::free_members(); |
| 200 | 201 | |
| 201 | 202 | // Initialise members |
| 202 | 203 | this->GModelSpatial::init_members(); |
| 203 | - this->GModelRadial::init_members(); | |
| 204 | + this->GModelSpatialRadial::init_members(); | |
| 204 | 205 | init_members(); |
| 205 | 206 | |
| 206 | 207 | // Return |
| ... | ... | @@ -210,7 +211,7 @@ void GModelRadialGauss::clear(void) |
| 210 | 211 | |
| 211 | 212 | /***********************************************************************//** |
| 212 | 213 | * @brief Clone instance |
| 213 | -***************************************************************************/ | |
| 214 | + ***************************************************************************/ | |
| 214 | 215 | GModelRadialGauss* GModelRadialGauss::clone(void) const |
| 215 | 216 | { |
| 216 | 217 | return new GModelRadialGauss(*this); |
| ... | ... | @@ -343,7 +344,7 @@ void GModelRadialGauss::read(const GXmlElement& xml) |
| 343 | 344 | } |
| 344 | 345 | |
| 345 | 346 | // Read Gaussian location |
| 346 | - GModelRadial::read(xml); | |
| 347 | + GModelSpatialRadial::read(xml); | |
| 347 | 348 | |
| 348 | 349 | // Extract model parameters |
| 349 | 350 | int npar[1] = {0}; |
| ... | ... | @@ -395,8 +396,8 @@ void GModelRadialGauss::read(const GXmlElement& xml) |
| 395 | 396 | ***************************************************************************/ |
| 396 | 397 | void GModelRadialGauss::write(GXmlElement& xml) const |
| 397 | 398 | { |
| 398 | - // Write shell location | |
| 399 | - GModelRadial::write(xml); | |
| 399 | + // Write Gaussian location | |
| 400 | + GModelSpatialRadial::write(xml); | |
| 400 | 401 | |
| 401 | 402 | // If XML element has 2 nodes (which should be the location nodes) |
| 402 | 403 | // then append 1 parameter node |
| ... | ... | @@ -449,6 +450,8 @@ std::string GModelRadialGauss::print(void) const |
| 449 | 450 | |
| 450 | 451 | // Append header |
| 451 | 452 | result.append("=== GModelRadialGauss ===\n"); |
| 453 | + | |
| 454 | + // Append parameters | |
| 452 | 455 | result.append(parformat("Number of parameters")+str(size())); |
| 453 | 456 | for (int i = 0; i < size(); ++i) { |
| 454 | 457 | result.append("\n"+m_pars[i]->print()); |
| ... | ... | @@ -521,10 +524,3 @@ void GModelRadialGauss::free_members(void) |
| 521 | 524 | // Return |
| 522 | 525 | return; |
| 523 | 526 | } |
| 524 | - | |
| 525 | - | |
| 526 | -/*========================================================================== | |
| 527 | - = = | |
| 528 | - = Friends = | |
| 529 | - = = | |
| 530 | - ==========================================================================*/ | ... | ... |
src/model/GModelRadialShell.cpp
| ... | ... | @@ -60,7 +60,7 @@ const GModelSpatialRegistry g_radial_shell_registry(&g_radial_shell_seed); |
| 60 | 60 | /***********************************************************************//** |
| 61 | 61 | * @brief Void constructor |
| 62 | 62 | ***************************************************************************/ |
| 63 | -GModelRadialShell::GModelRadialShell(void) : GModelRadial() | |
| 63 | +GModelRadialShell::GModelRadialShell(void) : GModelSpatialRadial() | |
| 64 | 64 | { |
| 65 | 65 | // Initialise members |
| 66 | 66 | init_members(); |
| ... | ... | @@ -84,7 +84,8 @@ GModelRadialShell::GModelRadialShell(void) : GModelRadial() |
| 84 | 84 | GModelRadialShell::GModelRadialShell(const GSkyDir& dir, |
| 85 | 85 | const double& radius, |
| 86 | 86 | const double& width, |
| 87 | - const bool& small_angle) : GModelRadial() | |
| 87 | + const bool& small_angle) : | |
| 88 | + GModelSpatialRadial() | |
| 88 | 89 | { |
| 89 | 90 | // Initialise members |
| 90 | 91 | init_members(); |
| ... | ... | @@ -109,7 +110,8 @@ GModelRadialShell::GModelRadialShell(const GSkyDir& dir, |
| 109 | 110 | * XML element. See GModelRadialShell::read() for more information about the |
| 110 | 111 | * expected structure of the XML element. |
| 111 | 112 | ***************************************************************************/ |
| 112 | -GModelRadialShell::GModelRadialShell(const GXmlElement& xml) : GModelRadial() | |
| 113 | +GModelRadialShell::GModelRadialShell(const GXmlElement& xml) : | |
| 114 | + GModelSpatialRadial() | |
| 113 | 115 | { |
| 114 | 116 | // Initialise members |
| 115 | 117 | init_members(); |
| ... | ... | @@ -127,8 +129,8 @@ GModelRadialShell::GModelRadialShell(const GXmlElement& xml) : GModelRadial() |
| 127 | 129 | * |
| 128 | 130 | * @param[in] model Radial shell source model. |
| 129 | 131 | ***************************************************************************/ |
| 130 | -GModelRadialShell::GModelRadialShell(const GModelRadialShell& model) | |
| 131 | - : GModelRadial(model) | |
| 132 | +GModelRadialShell::GModelRadialShell(const GModelRadialShell& model) : | |
| 133 | + GModelSpatialRadial(model) | |
| 132 | 134 | { |
| 133 | 135 | // Initialise members |
| 134 | 136 | init_members(); |
| ... | ... | @@ -171,7 +173,7 @@ GModelRadialShell& GModelRadialShell::operator=(const GModelRadialShell& model) |
| 171 | 173 | if (this != &model) { |
| 172 | 174 | |
| 173 | 175 | // Copy base class members |
| 174 | - this->GModelRadial::operator=(model); | |
| 176 | + this->GModelSpatialRadial::operator=(model); | |
| 175 | 177 | |
| 176 | 178 | // Free members |
| 177 | 179 | free_members(); |
| ... | ... | @@ -197,17 +199,17 @@ GModelRadialShell& GModelRadialShell::operator=(const GModelRadialShell& model) |
| 197 | 199 | |
| 198 | 200 | /***********************************************************************//** |
| 199 | 201 | * @brief Clear instance |
| 200 | -***************************************************************************/ | |
| 202 | + ***************************************************************************/ | |
| 201 | 203 | void GModelRadialShell::clear(void) |
| 202 | 204 | { |
| 203 | 205 | // Free class members (base and derived classes, derived class first) |
| 204 | 206 | free_members(); |
| 205 | - this->GModelRadial::free_members(); | |
| 207 | + this->GModelSpatialRadial::free_members(); | |
| 206 | 208 | this->GModelSpatial::free_members(); |
| 207 | 209 | |
| 208 | 210 | // Initialise members |
| 209 | 211 | this->GModelSpatial::init_members(); |
| 210 | - this->GModelRadial::init_members(); | |
| 212 | + this->GModelSpatialRadial::init_members(); | |
| 211 | 213 | init_members(); |
| 212 | 214 | |
| 213 | 215 | // Return |
| ... | ... | @@ -217,7 +219,7 @@ void GModelRadialShell::clear(void) |
| 217 | 219 | |
| 218 | 220 | /***********************************************************************//** |
| 219 | 221 | * @brief Clone instance |
| 220 | -***************************************************************************/ | |
| 222 | + ***************************************************************************/ | |
| 221 | 223 | GModelRadialShell* GModelRadialShell::clone(void) const |
| 222 | 224 | { |
| 223 | 225 | return new GModelRadialShell(*this); |
| ... | ... | @@ -428,7 +430,7 @@ void GModelRadialShell::read(const GXmlElement& xml) |
| 428 | 430 | } |
| 429 | 431 | |
| 430 | 432 | // Read shell location |
| 431 | - GModelRadial::read(xml); | |
| 433 | + GModelSpatialRadial::read(xml); | |
| 432 | 434 | |
| 433 | 435 | // Extract remaining model parameters. Note that we have to loop over |
| 434 | 436 | // all parameters to find the remaining 2 parameters that are |
| ... | ... | @@ -496,7 +498,7 @@ void GModelRadialShell::read(const GXmlElement& xml) |
| 496 | 498 | void GModelRadialShell::write(GXmlElement& xml) const |
| 497 | 499 | { |
| 498 | 500 | // Write shell location |
| 499 | - GModelRadial::write(xml); | |
| 501 | + GModelSpatialRadial::write(xml); | |
| 500 | 502 | |
| 501 | 503 | // If XML element has 2 nodes (which should be the location nodes) |
| 502 | 504 | // then append 2 parameter nodes |
| ... | ... | @@ -556,6 +558,8 @@ std::string GModelRadialShell::print(void) const |
| 556 | 558 | |
| 557 | 559 | // Append header |
| 558 | 560 | result.append("=== GModelRadialShell ===\n"); |
| 561 | + | |
| 562 | + // Append parameters | |
| 559 | 563 | result.append(parformat("Number of parameters")+str(size())); |
| 560 | 564 | for (int i = 0; i < size(); ++i) { |
| 561 | 565 | result.append("\n"+m_pars[i]->print()); |
| ... | ... | @@ -783,10 +787,3 @@ double GModelRadialShell::f2(double x) |
| 783 | 787 | // Return value |
| 784 | 788 | return f2; |
| 785 | 789 | } |
| 786 | - | |
| 787 | - | |
| 788 | -/*========================================================================== | |
| 789 | - = = | |
| 790 | - = Friends = | |
| 791 | - = = | |
| 792 | - ==========================================================================*/ | ... | ... |
src/model/GModelSky.cpp
| ... | ... | @@ -33,7 +33,7 @@ |
| 33 | 33 | #include "GModelRegistry.hpp" |
| 34 | 34 | #include "GModelSky.hpp" |
| 35 | 35 | #include "GModelSpatialPointSource.hpp" |
| 36 | -#include "GModelRadial.hpp" | |
| 36 | +#include "GModelSpatialRadial.hpp" | |
| 37 | 37 | #include "GModelSpatialRegistry.hpp" |
| 38 | 38 | #include "GModelSpectralRegistry.hpp" |
| 39 | 39 | #include "GModelTemporalRegistry.hpp" |
| ... | ... | @@ -924,13 +924,13 @@ void GModelSky::set_type(void) |
| 924 | 924 | // Continue only if we have a spatial model component |
| 925 | 925 | if (m_spatial != NULL) { |
| 926 | 926 | |
| 927 | - // Is model a point source? | |
| 927 | + // Is spatial model a point source? | |
| 928 | 928 | if (dynamic_cast<const GModelSpatialPointSource*>(m_spatial) != NULL) { |
| 929 | 929 | m_type = "PointSource"; |
| 930 | 930 | } |
| 931 | 931 | |
| 932 | - // ... otherwise, is model an extended source? | |
| 933 | - else if (dynamic_cast<const GModelRadial*>(m_spatial) != NULL) { | |
| 932 | + // ... otherwise, is spatial model a radial source? | |
| 933 | + else if (dynamic_cast<const GModelSpatialRadial*>(m_spatial) != NULL) { | |
| 934 | 934 | m_type = "ExtendedSource"; |
| 935 | 935 | } |
| 936 | 936 | ... | ... |
src/obs/GResponse.cpp
| ... | ... | @@ -38,7 +38,7 @@ |
| 38 | 38 | #include "GException.hpp" |
| 39 | 39 | #include "GTools.hpp" |
| 40 | 40 | #include "GModelSpatialPointSource.hpp" |
| 41 | -#include "GModelRadial.hpp" | |
| 41 | +#include "GModelSpatialRadial.hpp" | |
| 42 | 42 | |
| 43 | 43 | /* __ Method name definitions ____________________________________________ */ |
| 44 | 44 | #define G_IRF_EXTENDED "GResponse::irf_extended(GInstDir&, GEnergy&,"\ |
| ... | ... | @@ -167,13 +167,13 @@ double GResponse::irf(const GEvent& event, |
| 167 | 167 | // Initialise IRF value |
| 168 | 168 | double irf = 0.0; |
| 169 | 169 | |
| 170 | - // Is model a point source? | |
| 170 | + // Is spatial model a point source? | |
| 171 | 171 | if (dynamic_cast<const GModelSpatialPointSource*>(source.model()) != NULL) { |
| 172 | 172 | irf = irf_ptsrc(event, source, obs); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - // Is model an extended source? | |
| 176 | - else if (dynamic_cast<const GModelRadial*>(source.model()) != NULL) { | |
| 175 | + // Is spatial model a radial source? | |
| 176 | + else if (dynamic_cast<const GModelSpatialRadial*>(source.model()) != NULL) { | |
| 177 | 177 | irf = irf_extended(event, source, obs); |
| 178 | 178 | } |
| 179 | 179 | |
| ... | ... | @@ -291,13 +291,13 @@ double GResponse::npred(const GSource& source, const GObservation& obs) const |
| 291 | 291 | // Initialise Npred value |
| 292 | 292 | double npred = 0.0; |
| 293 | 293 | |
| 294 | - // Is model a point source? | |
| 294 | + // Is spatial model a point source? | |
| 295 | 295 | if (dynamic_cast<const GModelSpatialPointSource*>(source.model()) != NULL) { |
| 296 | 296 | npred = npred_ptsrc(source, obs); |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | - // Is model an extended source? | |
| 300 | - else if (dynamic_cast<const GModelRadial*>(source.model()) != NULL) { | |
| 299 | + // Is spatial model a radial source? | |
| 300 | + else if (dynamic_cast<const GModelSpatialRadial*>(source.model()) != NULL) { | |
| 301 | 301 | npred = npred_extended(source, obs); |
| 302 | 302 | } |
| 303 | 303 | |
| ... | ... | @@ -369,7 +369,8 @@ double GResponse::npred_extended(const GSource& source, |
| 369 | 369 | double npred = 0.0; |
| 370 | 370 | |
| 371 | 371 | // Get radial model |
| 372 | - const GModelRadial* src = dynamic_cast<const GModelRadial*>(source.model()); | |
| 372 | + const GModelSpatialRadial* src = | |
| 373 | + dynamic_cast<const GModelSpatialRadial*>(source.model()); | |
| 373 | 374 | |
| 374 | 375 | // Continue only if model is valid |
| 375 | 376 | if (src != NULL) { | ... | ... |