Commit 4a1f879aa6b7ef046eb96d287a937a67616f773a
1 parent
a38144ca
Rename spatial model components (#1818)
The following new names have been introduced for the spatial model components: * "PointSource" (alias: "SkyDirFunction") * "RadialDisk" (alias: "DiskFunction") * "RadialGaussian" (alias: "GaussFunction") * "RadialShell" (alias: "ShellFunction") * "EllipticalDisk" * "EllipticalGaussian" (alias: "EllipticalGauss") * "DiffuseIsotropic" (alias: "ConstantValue") * "DiffuseMap" (alias: "SpatialMap") * "DiffuseMapCube" (alias: "MapCubeFunction")
Showing
71 changed files
with
362 additions
and
157 deletions
ChangeLog
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | * Version 1.1.0 released |
| 4 | 4 | ========================= |
| 5 | 5 | |
| 6 | + Rename spatial model components (#1818) | |
| 6 | 7 | Fix consistency problem in GCTABackground3D (#1815) |
| 7 | 8 | Models accessing file now support relative file names (#1808) |
| 8 | 9 | Add GXmlElement and GXmlDocument filename() methods (#1808) | ... | ... |
NEWS
| ... | ... | @@ -217,6 +217,22 @@ The GModelSpatialDiffuseMap, GModelSpatialDiffuseCube and GModelSpectralFunc |
| 217 | 217 | class now support the specifications of file names that are relative to the |
| 218 | 218 | XML file (#1808). |
| 219 | 219 | |
| 220 | +The spatial model components have been renamed to enhance the readability and | |
| 221 | +to make them more homogenous. The Fermi/LAT Science Tools should also evolve | |
| 222 | +to support the new names: | |
| 223 | +* "PointSource" (alias: "SkyDirFunction") | |
| 224 | +* "RadialDisk" (alias: "DiskFunction") | |
| 225 | +* "RadialGaussian" (alias: "GaussFunction") | |
| 226 | +* "RadialShell" (alias: "ShellFunction") | |
| 227 | +* "EllipticalDisk" | |
| 228 | +* "EllipticalGaussian" (alias: "EllipticalGauss") | |
| 229 | +* "DiffuseIsotropic" (alias: "ConstantValue") | |
| 230 | +* "DiffuseMap" (alias: "SpatialMap") | |
| 231 | +* "DiffuseMapCube" (alias: "MapCubeFunction") | |
| 232 | +By default the old model names are still supported. Support of the old model | |
| 233 | +names can be turned off by specifying the --disable-legacy-model-names option | |
| 234 | +to the ./configure script (#1818). | |
| 235 | + | |
| 220 | 236 | |
| 221 | 237 | 9. Numerics module |
| 222 | 238 | ------------------ | ... | ... |
configure.ac
| ... | ... | @@ -699,6 +699,23 @@ fi |
| 699 | 699 | |
| 700 | 700 | |
| 701 | 701 | ############################################################################# |
| 702 | +# Checks for Legacy model names option (G_LEGACY_MODEL_NAMES) # | |
| 703 | +############################################################################# | |
| 704 | +AC_MSG_CHECKING(whether to enable legacy model names option) | |
| 705 | +AC_ARG_ENABLE([legacy_model_names], | |
| 706 | + AS_HELP_STRING([--enable-legacy-model-names], | |
| 707 | + [enables legacy model names [default=yes]]), | |
| 708 | + [LEGACY_MODEL_NAMES="$enableval"], | |
| 709 | + [LEGACY_MODEL_NAMES="yes"]) | |
| 710 | +if test "x$LEGACY_MODEL_NAMES" = "xyes"; then | |
| 711 | + AC_DEFINE([G_LEGACY_MODEL_NAMES], [1], [Legacy model names are enabled]) | |
| 712 | + AC_MSG_RESULT(yes) | |
| 713 | +else | |
| 714 | + AC_MSG_RESULT(no) | |
| 715 | +fi | |
| 716 | + | |
| 717 | + | |
| 718 | +############################################################################# | |
| 702 | 719 | # Checks for Warning option (G_WARNINGS) # |
| 703 | 720 | ############################################################################# |
| 704 | 721 | AC_MSG_CHECKING(whether to enable console warnings) |
| ... | ... | @@ -1560,6 +1577,11 @@ if test "x$SMALL_MEMORY" = "xyes"; then |
| 1560 | 1577 | else |
| 1561 | 1578 | echo " - Optimize memory usage (no)" |
| 1562 | 1579 | fi |
| 1580 | +if test "x$LEGACY_MODEL_NAMES" = "xyes"; then | |
| 1581 | + echo " * Enable legacy model names (yes) (default)" | |
| 1582 | +else | |
| 1583 | + echo " - Enable legacy model names (no)" | |
| 1584 | +fi | |
| 1563 | 1585 | if test "x$enable_openmp" = "xyes"; then |
| 1564 | 1586 | echo " * Enable OpenMP (yes) (default)" |
| 1565 | 1587 | else | ... | ... |
doc/source/users/user_manual/modules/model.rst
| ... | ... | @@ -114,7 +114,7 @@ Point source |
| 114 | 114 | .. code-block:: xml |
| 115 | 115 | |
| 116 | 116 | <source name="Crab" type="PointSource"> |
| 117 | - <spatialModel type="SkyDirFunction"> | |
| 117 | + <spatialModel type="PointSource"> | |
| 118 | 118 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 119 | 119 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 120 | 120 | </spatialModel> |
| ... | ... | @@ -129,7 +129,7 @@ Radial disk |
| 129 | 129 | .. code-block:: xml |
| 130 | 130 | |
| 131 | 131 | <source name="Crab" type="ExtendedSource"> |
| 132 | - <spatialModel type="DiskFunction"> | |
| 132 | + <spatialModel type="RadialDisk"> | |
| 133 | 133 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 134 | 134 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 135 | 135 | <parameter name="Radius" scale="1.0" value="0.20" min="0.01" max="10" free="1"/> |
| ... | ... | @@ -145,7 +145,7 @@ Radial Gaussian |
| 145 | 145 | .. code-block:: xml |
| 146 | 146 | |
| 147 | 147 | <source name="Crab" type="ExtendedSource"> |
| 148 | - <spatialModel type="GaussFunction"> | |
| 148 | + <spatialModel type="RadialGaussian"> | |
| 149 | 149 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 150 | 150 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 151 | 151 | <parameter name="Sigma" scale="1.0" value="0.20" min="0.01" max="10" free="1"/> |
| ... | ... | @@ -161,7 +161,7 @@ Radial shell |
| 161 | 161 | .. code-block:: xml |
| 162 | 162 | |
| 163 | 163 | <source name="Crab" type="ExtendedSource"> |
| 164 | - <spatialModel type="ShellFunction"> | |
| 164 | + <spatialModel type="RadialShell"> | |
| 165 | 165 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 166 | 166 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 167 | 167 | <parameter name="Radius" scale="1.0" value="0.30" min="0.01" max="10" free="1"/> |
| ... | ... | @@ -196,7 +196,7 @@ Elliptical Gaussian |
| 196 | 196 | .. code-block:: xml |
| 197 | 197 | |
| 198 | 198 | <source name="Crab" type="ExtendedSource"> |
| 199 | - <spatialModel type="EllipticalGauss"> | |
| 199 | + <spatialModel type="EllipticalGaussian"> | |
| 200 | 200 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 201 | 201 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 202 | 202 | <parameter name="PA" scale="1.0" value="45.0" min="-360" max="360" free="1"/> |
| ... | ... | @@ -214,7 +214,7 @@ Isotropic source |
| 214 | 214 | .. code-block:: xml |
| 215 | 215 | |
| 216 | 216 | <source name="Crab" type="DiffuseSource"> |
| 217 | - <spatialModel type="ConstantValue"> | |
| 217 | + <spatialModel type="DiffuseIsotropic"> | |
| 218 | 218 | <parameter name="Value" scale="1" value="1" min="1" max="1" free="0"/> |
| 219 | 219 | </spatialModel> |
| 220 | 220 | <spectrum type="..."> |
| ... | ... | @@ -228,7 +228,7 @@ Diffuse map |
| 228 | 228 | .. code-block:: xml |
| 229 | 229 | |
| 230 | 230 | <source name="Crab" type="DiffuseSource"> |
| 231 | - <spatialModel type="SpatialMap" file="map.fits"> | |
| 231 | + <spatialModel type="DiffuseMap" file="map.fits"> | |
| 232 | 232 | <parameter name="Prefactor" scale="1" value="1" min="0.001" max="1000.0" free="0"/> |
| 233 | 233 | </spatialModel> |
| 234 | 234 | <spectrum type="..."> |
| ... | ... | @@ -242,7 +242,7 @@ Diffuse map cube |
| 242 | 242 | .. code-block:: xml |
| 243 | 243 | |
| 244 | 244 | <source name="Crab" type="DiffuseSource"> |
| 245 | - <spatialModel type="MapCubeFunction" file="map_cube.fits"> | |
| 245 | + <spatialModel type="DiffuseMapCube" file="map_cube.fits"> | |
| 246 | 246 | <parameter name="Normalization" scale="1" value="1" min="0.001" max="1000.0" free="0"/> |
| 247 | 247 | </spatialModel> |
| 248 | 248 | <spectrum type="..."> | ... | ... |
examples/cpp/readmodel.cpp
| ... | ... | @@ -56,7 +56,7 @@ void create_xml_file(void) |
| 56 | 56 | file << " <parameter scale=\"1.0\" name=\"Scale\" min=\"10.0\""; |
| 57 | 57 | file << " max=\"1000000.0\" value=\"100.0\" free=\"0\"/>\n"; |
| 58 | 58 | file << " </spectrum>\n"; |
| 59 | - file << " <spatialModel type=\"SkyDirFunction\">\n"; | |
| 59 | + file << " <spatialModel type=\"PointSource\">\n"; | |
| 60 | 60 | file << " <parameter free=\"0\" max=\"360\" min=\"-360\""; |
| 61 | 61 | file << " name=\"RA\" scale=\"1\" value=\"83.6331\"/>\n"; |
| 62 | 62 | file << " <parameter free=\"0\" max=\"90\" min=\"-90\""; | ... | ... |
include/GModelSpatial.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatial.hpp - Spatial model abstract base class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2009-2015 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2009-2016 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -86,6 +86,7 @@ public: |
| 86 | 86 | virtual GModelSpatial* clone(void) const = 0; |
| 87 | 87 | virtual std::string classname(void) const = 0; |
| 88 | 88 | virtual std::string type(void) const = 0; |
| 89 | + virtual std::string alias(void) const = 0; | |
| 89 | 90 | virtual GClassCode code(void) const = 0; |
| 90 | 91 | virtual double eval(const GPhoton& photon) const = 0; |
| 91 | 92 | virtual double eval_gradients(const GPhoton& photon) const = 0; | ... | ... |
include/GModelSpatialDiffuse.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialDiffuse.hpp - Abstract diffuse spatial model base class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2013-2014 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2013-2016 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -62,6 +62,7 @@ public: |
| 62 | 62 | virtual GModelSpatialDiffuse* clone(void) const = 0; |
| 63 | 63 | virtual std::string classname(void) const = 0; |
| 64 | 64 | virtual std::string type(void) const = 0; |
| 65 | + virtual std::string alias(void) const = 0; | |
| 65 | 66 | virtual double eval(const GPhoton& photon) const = 0; |
| 66 | 67 | virtual double eval_gradients(const GPhoton& photon) const = 0; |
| 67 | 68 | virtual GSkyDir mc(const GEnergy& energy, const GTime& time, | ... | ... |
include/GModelSpatialDiffuseConst.hpp
| ... | ... | @@ -62,6 +62,7 @@ public: |
| 62 | 62 | virtual GModelSpatialDiffuseConst* clone(void) const; |
| 63 | 63 | virtual std::string classname(void) const; |
| 64 | 64 | virtual std::string type(void) const; |
| 65 | + virtual std::string alias(void) const; | |
| 65 | 66 | virtual double eval(const GPhoton& photon) const; |
| 66 | 67 | virtual double eval_gradients(const GPhoton& photon) const; |
| 67 | 68 | virtual GSkyDir mc(const GEnergy& energy, |
| ... | ... | @@ -107,13 +108,27 @@ std::string GModelSpatialDiffuseConst::classname(void) const |
| 107 | 108 | /***********************************************************************//** |
| 108 | 109 | * @brief Return spatial model type |
| 109 | 110 | * |
| 110 | - * @return "ConstantValue". | |
| 111 | + * @return "DiffuseIsotropic". | |
| 111 | 112 | * |
| 112 | 113 | * Returns the type of the isotropic spatial model. |
| 113 | 114 | ***************************************************************************/ |
| 114 | 115 | inline |
| 115 | 116 | std::string GModelSpatialDiffuseConst::type(void) const |
| 116 | 117 | { |
| 118 | + return "DiffuseIsotropic"; | |
| 119 | +} | |
| 120 | + | |
| 121 | + | |
| 122 | +/***********************************************************************//** | |
| 123 | + * @brief Return spatial model type alias | |
| 124 | + * | |
| 125 | + * @return "ConstantValue". | |
| 126 | + * | |
| 127 | + * Returns the alias of the isotropic spatial model. | |
| 128 | + ***************************************************************************/ | |
| 129 | +inline | |
| 130 | +std::string GModelSpatialDiffuseConst::alias(void) const | |
| 131 | +{ | |
| 117 | 132 | return "ConstantValue"; |
| 118 | 133 | } |
| 119 | 134 | ... | ... |
include/GModelSpatialDiffuseCube.hpp
| ... | ... | @@ -77,6 +77,7 @@ public: |
| 77 | 77 | virtual GModelSpatialDiffuseCube* clone(void) const; |
| 78 | 78 | virtual std::string classname(void) const; |
| 79 | 79 | virtual std::string type(void) const; |
| 80 | + virtual std::string alias(void) const; | |
| 80 | 81 | virtual double eval(const GPhoton& photon) const; |
| 81 | 82 | virtual double eval_gradients(const GPhoton& photon) const; |
| 82 | 83 | virtual GSkyDir mc(const GEnergy& energy, |
| ... | ... | @@ -152,13 +153,27 @@ std::string GModelSpatialDiffuseCube::classname(void) const |
| 152 | 153 | /***********************************************************************//** |
| 153 | 154 | * @brief Return spatial model type |
| 154 | 155 | * |
| 155 | - * @return "MapCubeFunction". | |
| 156 | + * @return "DiffuseMapCube". | |
| 156 | 157 | * |
| 157 | 158 | * Returns the type of the spatial map cube model. |
| 158 | 159 | ***************************************************************************/ |
| 159 | 160 | inline |
| 160 | 161 | std::string GModelSpatialDiffuseCube::type(void) const |
| 161 | 162 | { |
| 163 | + return "DiffuseMapCube"; | |
| 164 | +} | |
| 165 | + | |
| 166 | + | |
| 167 | +/***********************************************************************//** | |
| 168 | + * @brief Return spatial model type alias | |
| 169 | + * | |
| 170 | + * @return "MapCubeFunction". | |
| 171 | + * | |
| 172 | + * Returns the alias of the spatial map cube model. | |
| 173 | + ***************************************************************************/ | |
| 174 | +inline | |
| 175 | +std::string GModelSpatialDiffuseCube::alias(void) const | |
| 176 | +{ | |
| 162 | 177 | return "MapCubeFunction"; |
| 163 | 178 | } |
| 164 | 179 | ... | ... |
include/GModelSpatialDiffuseMap.hpp
| ... | ... | @@ -69,6 +69,7 @@ public: |
| 69 | 69 | virtual GModelSpatialDiffuseMap* clone(void) const; |
| 70 | 70 | virtual std::string classname(void) const; |
| 71 | 71 | virtual std::string type(void) const; |
| 72 | + virtual std::string alias(void) const; | |
| 72 | 73 | virtual double eval(const GPhoton& photon) const; |
| 73 | 74 | virtual double eval_gradients(const GPhoton& photon) const; |
| 74 | 75 | virtual GSkyDir mc(const GEnergy& energy, |
| ... | ... | @@ -133,13 +134,27 @@ std::string GModelSpatialDiffuseMap::classname(void) const |
| 133 | 134 | /***********************************************************************//** |
| 134 | 135 | * @brief Return spatial model type |
| 135 | 136 | * |
| 136 | - * @return "SpatialMap". | |
| 137 | + * @return "DiffuseMap". | |
| 137 | 138 | * |
| 138 | 139 | * Returns the type of the spatial map model. |
| 139 | 140 | ***************************************************************************/ |
| 140 | 141 | inline |
| 141 | 142 | std::string GModelSpatialDiffuseMap::type(void) const |
| 142 | 143 | { |
| 144 | + return "DiffuseMap"; | |
| 145 | +} | |
| 146 | + | |
| 147 | + | |
| 148 | +/***********************************************************************//** | |
| 149 | + * @brief Return spatial model type alias | |
| 150 | + * | |
| 151 | + * @return "SpatialMap". | |
| 152 | + * | |
| 153 | + * Returns the alias of the spatial map model. | |
| 154 | + ***************************************************************************/ | |
| 155 | +inline | |
| 156 | +std::string GModelSpatialDiffuseMap::alias(void) const | |
| 157 | +{ | |
| 143 | 158 | return "SpatialMap"; |
| 144 | 159 | } |
| 145 | 160 | ... | ... |
include/GModelSpatialElliptical.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialElliptical.hpp - Abstract elliptical spatial model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2013-2015 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2013-2016 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -66,6 +66,7 @@ public: |
| 66 | 66 | virtual GModelSpatialElliptical* clone(void) const = 0; |
| 67 | 67 | virtual std::string classname(void) const = 0; |
| 68 | 68 | virtual std::string type(void) const = 0; |
| 69 | + virtual std::string alias(void) const = 0; | |
| 69 | 70 | virtual double eval(const double& theta, |
| 70 | 71 | const double& posangle, |
| 71 | 72 | const GEnergy& energy, | ... | ... |
include/GModelSpatialEllipticalDisk.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialEllipticalDisk.hpp - Elliptical disk source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2013-2015 by Michael Mayer * | |
| 4 | + * copyright (C) 2013-2016 by Michael Mayer * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -65,6 +65,7 @@ public: |
| 65 | 65 | virtual GModelSpatialEllipticalDisk* clone(void) const; |
| 66 | 66 | virtual std::string classname(void) const; |
| 67 | 67 | virtual std::string type(void) const; |
| 68 | + virtual std::string alias(void) const; | |
| 68 | 69 | virtual double eval(const double& theta, |
| 69 | 70 | const double& posangle, |
| 70 | 71 | const GEnergy& energy, |
| ... | ... | @@ -125,4 +126,18 @@ std::string GModelSpatialEllipticalDisk::type(void) const |
| 125 | 126 | return "EllipticalDisk"; |
| 126 | 127 | } |
| 127 | 128 | |
| 129 | + | |
| 130 | +/***********************************************************************//** | |
| 131 | + * @brief Return model type alias | |
| 132 | + * | |
| 133 | + * @return "EllipticalDisk". | |
| 134 | + * | |
| 135 | + * Returns the alias of the elliptical disk model. | |
| 136 | + ***************************************************************************/ | |
| 137 | +inline | |
| 138 | +std::string GModelSpatialEllipticalDisk::alias(void) const | |
| 139 | +{ | |
| 140 | + return "EllipticalDisk"; | |
| 141 | +} | |
| 142 | + | |
| 128 | 143 | #endif /* GMODELSPATIALELLIPTICALDISK_HPP */ | ... | ... |
include/GModelSpatialEllipticalGauss.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialEllipticalGauss.hpp - Elliptical gauss source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2015 by Michael Mayer * | |
| 4 | + * copyright (C) 2015-2016 by Michael Mayer * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -65,6 +65,7 @@ public: |
| 65 | 65 | virtual GModelSpatialEllipticalGauss* clone(void) const; |
| 66 | 66 | virtual std::string classname(void) const; |
| 67 | 67 | virtual std::string type(void) const; |
| 68 | + virtual std::string alias(void) const; | |
| 68 | 69 | virtual double eval(const double& theta, |
| 69 | 70 | const double& posangle, |
| 70 | 71 | const GEnergy& energy, |
| ... | ... | @@ -125,13 +126,27 @@ std::string GModelSpatialEllipticalGauss::classname(void) const |
| 125 | 126 | /***********************************************************************//** |
| 126 | 127 | * @brief Return model type |
| 127 | 128 | * |
| 128 | - * @return "EllipticalGauss". | |
| 129 | + * @return "EllipticalGaussian". | |
| 129 | 130 | * |
| 130 | 131 | * Returns the type of the elliptical gauss model. |
| 131 | 132 | ***************************************************************************/ |
| 132 | 133 | inline |
| 133 | 134 | std::string GModelSpatialEllipticalGauss::type(void) const |
| 134 | 135 | { |
| 136 | + return "EllipticalGaussian"; | |
| 137 | +} | |
| 138 | + | |
| 139 | + | |
| 140 | +/***********************************************************************//** | |
| 141 | + * @brief Return model type alias | |
| 142 | + * | |
| 143 | + * @return "EllipticalGauss". | |
| 144 | + * | |
| 145 | + * Returns the alias of the elliptical gauss model. | |
| 146 | + ***************************************************************************/ | |
| 147 | +inline | |
| 148 | +std::string GModelSpatialEllipticalGauss::alias(void) const | |
| 149 | +{ | |
| 135 | 150 | return "EllipticalGauss"; |
| 136 | 151 | } |
| 137 | 152 | ... | ... |
include/GModelSpatialPointSource.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialPointSource.hpp - Spatial point source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2009-2015 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2009-2016 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -65,6 +65,7 @@ public: |
| 65 | 65 | virtual GModelSpatialPointSource* clone(void) const; |
| 66 | 66 | virtual std::string classname(void) const; |
| 67 | 67 | virtual std::string type(void) const; |
| 68 | + virtual std::string alias(void) const; | |
| 68 | 69 | virtual GClassCode code(void) const; |
| 69 | 70 | virtual double eval(const GPhoton& photon) const; |
| 70 | 71 | virtual double eval_gradients(const GPhoton& photon) const; |
| ... | ... | @@ -114,13 +115,27 @@ std::string GModelSpatialPointSource::classname(void) const |
| 114 | 115 | /***********************************************************************//** |
| 115 | 116 | * @brief Return model type |
| 116 | 117 | * |
| 117 | - * @return "SkyDirFunction". | |
| 118 | + * @return "PointSource". | |
| 118 | 119 | * |
| 119 | 120 | * Returns the type of the spatial model. |
| 120 | 121 | ***************************************************************************/ |
| 121 | 122 | inline |
| 122 | 123 | std::string GModelSpatialPointSource::type(void) const |
| 123 | 124 | { |
| 125 | + return "PointSource"; | |
| 126 | +} | |
| 127 | + | |
| 128 | + | |
| 129 | +/***********************************************************************//** | |
| 130 | + * @brief Return model type alias | |
| 131 | + * | |
| 132 | + * @return "SkyDirFunction". | |
| 133 | + * | |
| 134 | + * Returns the alias of the spatial model. | |
| 135 | + ***************************************************************************/ | |
| 136 | +inline | |
| 137 | +std::string GModelSpatialPointSource::alias(void) const | |
| 138 | +{ | |
| 124 | 139 | return "SkyDirFunction"; |
| 125 | 140 | } |
| 126 | 141 | ... | ... |
include/GModelSpatialRadial.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialRadial.hpp - Abstract radial spatial model base class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011-2015 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2011-2016 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -66,6 +66,7 @@ public: |
| 66 | 66 | virtual GModelSpatialRadial* clone(void) const = 0; |
| 67 | 67 | virtual std::string classname(void) const = 0; |
| 68 | 68 | virtual std::string type(void) const = 0; |
| 69 | + virtual std::string alias(void) const = 0; | |
| 69 | 70 | virtual double eval(const double& theta, |
| 70 | 71 | const GEnergy& energy, |
| 71 | 72 | const GTime& time) const = 0; | ... | ... |
include/GModelSpatialRadialDisk.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialRadialDisk.hpp - Radial disk source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011-2015 by Christoph Deil * | |
| 4 | + * copyright (C) 2011-2016 by Christoph Deil * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -62,6 +62,7 @@ public: |
| 62 | 62 | virtual GModelSpatialRadialDisk* clone(void) const; |
| 63 | 63 | virtual std::string classname(void) const; |
| 64 | 64 | virtual std::string type(void) const; |
| 65 | + virtual std::string alias(void) const; | |
| 65 | 66 | virtual double eval(const double& theta, |
| 66 | 67 | const GEnergy& energy, |
| 67 | 68 | const GTime& time) const; |
| ... | ... | @@ -114,13 +115,27 @@ std::string GModelSpatialRadialDisk::classname(void) const |
| 114 | 115 | /***********************************************************************//** |
| 115 | 116 | * @brief Return model type |
| 116 | 117 | * |
| 117 | - * @return "DiskFunction". | |
| 118 | + * @return "RadialDisk". | |
| 118 | 119 | * |
| 119 | 120 | * Returns the type of the radial disk model. |
| 120 | 121 | ***************************************************************************/ |
| 121 | 122 | inline |
| 122 | 123 | std::string GModelSpatialRadialDisk::type(void) const |
| 123 | 124 | { |
| 125 | + return "RadialDisk"; | |
| 126 | +} | |
| 127 | + | |
| 128 | + | |
| 129 | +/***********************************************************************//** | |
| 130 | + * @brief Return model type alias | |
| 131 | + * | |
| 132 | + * @return "DiskFunction". | |
| 133 | + * | |
| 134 | + * Returns the alias of the radial disk model. | |
| 135 | + ***************************************************************************/ | |
| 136 | +inline | |
| 137 | +std::string GModelSpatialRadialDisk::alias(void) const | |
| 138 | +{ | |
| 124 | 139 | return "DiskFunction"; |
| 125 | 140 | } |
| 126 | 141 | ... | ... |
include/GModelSpatialRadialGauss.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialRadialGauss.hpp - Radial Gaussian source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011-2015 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2011-2016 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -63,6 +63,7 @@ public: |
| 63 | 63 | virtual GModelSpatialRadialGauss* clone(void) const; |
| 64 | 64 | virtual std::string classname(void) const; |
| 65 | 65 | virtual std::string type(void) const; |
| 66 | + virtual std::string alias(void) const; | |
| 66 | 67 | virtual double eval(const double& theta, |
| 67 | 68 | const GEnergy& energy, |
| 68 | 69 | const GTime& time) const; |
| ... | ... | @@ -109,13 +110,27 @@ std::string GModelSpatialRadialGauss::classname(void) const |
| 109 | 110 | /***********************************************************************//** |
| 110 | 111 | * @brief Return model type |
| 111 | 112 | * |
| 112 | - * @return "GaussFunction". | |
| 113 | + * @return "RadialGaussian". | |
| 113 | 114 | * |
| 114 | 115 | * Returns the type of the radial Gauss model. |
| 115 | 116 | ***************************************************************************/ |
| 116 | 117 | inline |
| 117 | 118 | std::string GModelSpatialRadialGauss::type(void) const |
| 118 | 119 | { |
| 120 | + return "RadialGaussian"; | |
| 121 | +} | |
| 122 | + | |
| 123 | + | |
| 124 | +/***********************************************************************//** | |
| 125 | + * @brief Return model type alias | |
| 126 | + * | |
| 127 | + * @return "GaussFunction". | |
| 128 | + * | |
| 129 | + * Returns the alias of the radial Gauss model. | |
| 130 | + ***************************************************************************/ | |
| 131 | +inline | |
| 132 | +std::string GModelSpatialRadialGauss::alias(void) const | |
| 133 | +{ | |
| 119 | 134 | return "GaussFunction"; |
| 120 | 135 | } |
| 121 | 136 | ... | ... |
include/GModelSpatialRadialShell.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialRadialShell.hpp - Radial shell source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011-2015 by Christoph Deil * | |
| 4 | + * copyright (C) 2011-2016 by Christoph Deil * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -74,6 +74,7 @@ public: |
| 74 | 74 | virtual GModelSpatialRadialShell* clone(void) const; |
| 75 | 75 | virtual std::string classname(void) const; |
| 76 | 76 | virtual std::string type(void) const; |
| 77 | + virtual std::string alias(void) const; | |
| 77 | 78 | virtual double eval(const double& theta, |
| 78 | 79 | const GEnergy& energy, |
| 79 | 80 | const GTime& time) const; |
| ... | ... | @@ -135,13 +136,27 @@ std::string GModelSpatialRadialShell::classname(void) const |
| 135 | 136 | /***********************************************************************//** |
| 136 | 137 | * @brief Return model type |
| 137 | 138 | * |
| 138 | - * @return "ShellFunction". | |
| 139 | + * @return "RadialShell". | |
| 139 | 140 | * |
| 140 | 141 | * Returns the type of the radial shell model. |
| 141 | 142 | ***************************************************************************/ |
| 142 | 143 | inline |
| 143 | 144 | std::string GModelSpatialRadialShell::type(void) const |
| 144 | 145 | { |
| 146 | + return "RadialShell"; | |
| 147 | +} | |
| 148 | + | |
| 149 | + | |
| 150 | +/***********************************************************************//** | |
| 151 | + * @brief Return model type alias | |
| 152 | + * | |
| 153 | + * @return "ShellFunction". | |
| 154 | + * | |
| 155 | + * Returns the alias of the radial shell model. | |
| 156 | + ***************************************************************************/ | |
| 157 | +inline | |
| 158 | +std::string GModelSpatialRadialShell::alias(void) const | |
| 159 | +{ | |
| 145 | 160 | return "ShellFunction"; |
| 146 | 161 | } |
| 147 | 162 | ... | ... |
inst/com/test/data/crab.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.05" min="0.0" max="+5.0" free="0"/> |
| 7 | 7 | <parameter name="Scale" scale="1.0" value="1.0" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 12 | 12 | </spatialModel> | ... | ... |
inst/cta/test/data/crab.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/> |
| 7 | 7 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> |
| 12 | 12 | </spatialModel> | ... | ... |
inst/cta/test/data/crab_disk.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/> |
| 7 | 7 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="DiskFunction"> | |
| 9 | + <spatialModel type="RadialDisk"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 12 | 12 | <parameter name="Radius" scale="1.0" value="0.20" min="0.01" max="10" free="1"/> | ... | ... |
inst/cta/test/data/crab_eplaw.xml
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | <parameter name="Cutoff" scale="1e6" value="1.0" min="0.01" max="1000.0" free="1"/> |
| 8 | 8 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 9 | 9 | </spectrum> |
| 10 | - <spatialModel type="SkyDirFunction"> | |
| 10 | + <spatialModel type="PointSource"> | |
| 11 | 11 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/> |
| 12 | 12 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> |
| 13 | 13 | </spatialModel> | ... | ... |
inst/cta/test/data/crab_file_function.xml
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | <spectrum type="FileFunction" file="crab_file_function.dat"> |
| 5 | 5 | <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/> |
| 6 | 6 | </spectrum> |
| 7 | - <spatialModel type="SkyDirFunction"> | |
| 7 | + <spatialModel type="PointSource"> | |
| 8 | 8 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/> |
| 9 | 9 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> |
| 10 | 10 | </spatialModel> | ... | ... |
inst/cta/test/data/crab_file_function_mod.xml
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | <spectrum type="FileFunction" file="crab_file_function_mod.dat"> |
| 5 | 5 | <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/> |
| 6 | 6 | </spectrum> |
| 7 | - <spatialModel type="SkyDirFunction"> | |
| 7 | + <spatialModel type="PointSource"> | |
| 8 | 8 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/> |
| 9 | 9 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> |
| 10 | 10 | </spatialModel> | ... | ... |
inst/cta/test/data/crab_gauss.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/> |
| 7 | 7 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="GaussFunction"> | |
| 9 | + <spatialModel type="RadialGaussian"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 12 | 12 | <parameter name="Sigma" scale="1.0" value="0.20" min="0.01" max="10" free="1"/> | ... | ... |
inst/cta/test/data/crab_irf.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/> |
| 7 | 7 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> |
| 12 | 12 | </spatialModel> | ... | ... |
inst/cta/test/data/crab_poly.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/> |
| 7 | 7 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> |
| 12 | 12 | </spatialModel> | ... | ... |
inst/cta/test/data/crab_profile.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/> |
| 7 | 7 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> |
| 12 | 12 | </spatialModel> | ... | ... |
inst/cta/test/data/crab_ptsrc.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/> |
| 7 | 7 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> |
| 12 | 12 | </spatialModel> | ... | ... |
inst/cta/test/data/crab_shell.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/> |
| 7 | 7 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="ShellFunction"> | |
| 9 | + <spatialModel type="RadialShell"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 12 | 12 | <parameter name="Radius" scale="1.0" value="0.30" min="0.01" max="10" free="1"/> | ... | ... |
inst/cta/test/data/onoff_model.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/> |
| 7 | 7 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> |
| 12 | 12 | </spatialModel> | ... | ... |
inst/cta/test/data/radio.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/> |
| 7 | 7 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SpatialMap" file="radio_map.fits"> | |
| 9 | + <spatialModel type="DiffuseMap" file="radio_map.fits"> | |
| 10 | 10 | <parameter scale="1" name="Prefactor" min="0.001" max="1000.0" value="1" free="0"/> |
| 11 | 11 | </spatialModel> |
| 12 | 12 | </source> | ... | ... |
inst/cta/test/data/rsp_models.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.1" free="1"/> |
| 7 | 7 | <parameter scale="1.0" name="Scale" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SpatialMap" file="cena_lobes_parkes.fits"> | |
| 9 | + <spatialModel type="DiffuseMap" file="cena_lobes_parkes.fits"> | |
| 10 | 10 | <parameter scale="1" name="Prefactor" min="0.001" max="1000.0" value="1" free="0"/> |
| 11 | 11 | </spatialModel> |
| 12 | 12 | </source> | ... | ... |
inst/cta/test/data/stacked_model.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" value="2.48" error="0" scale="-1" min="0" max="5" free="1" /> |
| 7 | 7 | <parameter name="Scale" value="0.3" scale="1e+06" min="0.01" max="1000" free="0" /> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter name="RA" value="83.6331" scale="1" min="-360" max="360" free="0" /> |
| 11 | 11 | <parameter name="DEC" value="22.0145" scale="1" min="-90" max="90" free="0" /> |
| 12 | 12 | </spatialModel> | ... | ... |
inst/lat/test/data/p6v3/source_model.xml
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | <spectrum type="FileFunction" file="isotropic_iem_v02.txt"> |
| 4 | 4 | <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/> |
| 5 | 5 | </spectrum> |
| 6 | - <spatialModel type="ConstantValue"> | |
| 6 | + <spatialModel type="DiffuseIsotropic"> | |
| 7 | 7 | <parameter scale="1" name="Value" min="0" max="10" value="1" free="0"/> |
| 8 | 8 | </spatialModel> |
| 9 | 9 | </source> |
| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | <spectrum type="ConstantValue"> |
| 12 | 12 | <parameter scale="1.0" name="Value" min="0.0" max="1000.0" value="1.0" free="1"/> |
| 13 | 13 | </spectrum> |
| 14 | - <spatialModel type="MapCubeFunction" file="test_cube.fits"> | |
| 14 | + <spatialModel type="DiffuseMapCube" file="test_cube.fits"> | |
| 15 | 15 | <parameter scale="1" name="Normalization" min="0.001" max="1000.0" value="1" free="0"/> |
| 16 | 16 | </spatialModel> |
| 17 | 17 | </source> |
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 23 | 23 | <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> |
| 24 | 24 | </spectrum> |
| 25 | - <spatialModel type="SkyDirFunction"> | |
| 25 | + <spatialModel type="PointSource"> | |
| 26 | 26 | <parameter scale="1" name="RA" min="-360" max="360" value="83.6331" free="0"/> |
| 27 | 27 | <parameter scale="1" name="DEC" min="-90" max="90" value="22.0145" free="0"/> |
| 28 | 28 | </spatialModel> | ... | ... |
inst/lat/test/data/p7v6/crab_model.xml
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | <spectrum type="FileFunction" file="isotrop_2year_P76_source_v0.txt"> |
| 4 | 4 | <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/> |
| 5 | 5 | </spectrum> |
| 6 | - <spatialModel type="ConstantValue"> | |
| 6 | + <spatialModel type="DiffuseIsotropic"> | |
| 7 | 7 | <parameter scale="1" name="Value" min="0" max="10" value="1" free="0"/> |
| 8 | 8 | </spatialModel> |
| 9 | 9 | </source> |
| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | <spectrum type="ConstantValue"> |
| 12 | 12 | <parameter scale="1.0" name="Value" min="0.0" max="1000.0" value="1.0" free="1"/> |
| 13 | 13 | </spectrum> |
| 14 | - <spatialModel type="MapCubeFunction" file="test_cube.fits"> | |
| 14 | + <spatialModel type="DiffuseMapCube" file="test_cube.fits"> | |
| 15 | 15 | <parameter scale="1" name="Normalization" min="0.001" max="1000.0" value="1" free="0"/> |
| 16 | 16 | </spatialModel> |
| 17 | 17 | </source> |
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 23 | 23 | <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> |
| 24 | 24 | </spectrum> |
| 25 | - <spatialModel type="SkyDirFunction"> | |
| 25 | + <spatialModel type="PointSource"> | |
| 26 | 26 | <parameter scale="1" name="RA" min="-360" max="360" value="83.6331" free="0"/> |
| 27 | 27 | <parameter scale="1" name="DEC" min="-90" max="90" value="22.0145" free="0"/> |
| 28 | 28 | </spatialModel> | ... | ... |
inst/lat/test/data/p7v6/source_model.xml
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | <spectrum type="FileFunction" file="isotrop_2year_P76_source_v0.txt"> |
| 4 | 4 | <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/> |
| 5 | 5 | </spectrum> |
| 6 | - <spatialModel type="ConstantValue"> | |
| 6 | + <spatialModel type="DiffuseIsotropic"> | |
| 7 | 7 | <parameter scale="1" name="Value" min="0" max="10" value="1" free="0"/> |
| 8 | 8 | </spatialModel> |
| 9 | 9 | </source> |
| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | <spectrum type="ConstantValue"> |
| 12 | 12 | <parameter scale="1.0" name="Value" min="0.0" max="1000.0" value="1.0" free="1"/> |
| 13 | 13 | </spectrum> |
| 14 | - <spatialModel type="MapCubeFunction" file="test_cube.fits"> | |
| 14 | + <spatialModel type="DiffuseMapCube" file="test_cube.fits"> | |
| 15 | 15 | <parameter scale="1" name="Normalization" min="0.001" max="1000.0" value="1" free="0"/> |
| 16 | 16 | </spatialModel> |
| 17 | 17 | </source> |
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 23 | 23 | <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> |
| 24 | 24 | </spectrum> |
| 25 | - <spatialModel type="SkyDirFunction"> | |
| 25 | + <spatialModel type="PointSource"> | |
| 26 | 26 | <parameter scale="1" name="RA" min="-360" max="360" value="83.6331" free="0"/> |
| 27 | 27 | <parameter scale="1" name="DEC" min="-90" max="90" value="22.0145" free="0"/> |
| 28 | 28 | </spatialModel> | ... | ... |
inst/lat/test/data/p8v2/source_model.xml
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | <spectrum type="FileFunction" file="iso_P8R2_SOURCE_V6_v06.txt"> |
| 4 | 4 | <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/> |
| 5 | 5 | </spectrum> |
| 6 | - <spatialModel type="ConstantValue"> | |
| 6 | + <spatialModel type="DiffuseIsotropic"> | |
| 7 | 7 | <parameter scale="1" name="Value" min="0" max="10" value="1" free="0"/> |
| 8 | 8 | </spatialModel> |
| 9 | 9 | </source> |
| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | <spectrum type="ConstantValue"> |
| 12 | 12 | <parameter scale="1.0" name="Value" min="0.0" max="1000.0" value="1.0" free="1"/> |
| 13 | 13 | </spectrum> |
| 14 | - <spatialModel type="MapCubeFunction" file="test_cube.fits"> | |
| 14 | + <spatialModel type="DiffuseMapCube" file="test_cube.fits"> | |
| 15 | 15 | <parameter scale="1" name="Normalization" min="0.001" max="1000.0" value="1" free="0"/> |
| 16 | 16 | </spatialModel> |
| 17 | 17 | </source> |
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 23 | 23 | <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> |
| 24 | 24 | </spectrum> |
| 25 | - <spatialModel type="SkyDirFunction"> | |
| 25 | + <spatialModel type="PointSource"> | |
| 26 | 26 | <parameter scale="1" name="RA" min="-360" max="360" value="83.6331" free="0"/> |
| 27 | 27 | <parameter scale="1" name="DEC" min="-90" max="90" value="22.0145" free="0"/> |
| 28 | 28 | </spatialModel> | ... | ... |
inst/mwl/test/data/crab.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.1" free="1"/> |
| 7 | 7 | <parameter scale="1.0" name="Scale" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 11 | 11 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 12 | 12 | </spatialModel> | ... | ... |
inst/mwl/test/data/crab_mwl.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-3.0" free="1"/> |
| 7 | 7 | <parameter scale="1.0" name="Scale" min="1e-07" max="1e20" value="1.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 11 | 11 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 12 | 12 | </spatialModel> |
| ... | ... | @@ -17,7 +17,7 @@ |
| 17 | 17 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-1.5" free="1"/> |
| 18 | 18 | <parameter scale="1.0" name="Scale" min="1e-07" max="1e20" value="1000.0" free="0"/> |
| 19 | 19 | </spectrum> |
| 20 | - <spatialModel type="SkyDirFunction"> | |
| 20 | + <spatialModel type="PointSource"> | |
| 21 | 21 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 22 | 22 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 23 | 23 | </spatialModel> | ... | ... |
inst/mwl/test/data/crab_mwl2.xml
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | <parameter scale="1.0" name="Cutoff" min="1.0" max="100000.0" value="100.0" free="1"/> |
| 8 | 8 | <parameter scale="1.0" name="Scale" min="1e-07" max="1e20" value="1.0" free="0"/> |
| 9 | 9 | </spectrum> |
| 10 | - <spatialModel type="SkyDirFunction"> | |
| 10 | + <spatialModel type="PointSource"> | |
| 11 | 11 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 12 | 12 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 13 | 13 | </spatialModel> |
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-1.2" free="1"/> |
| 19 | 19 | <parameter scale="1.0" name="Scale" min="1e-07" max="1e20" value="1000.0" free="0"/> |
| 20 | 20 | </spectrum> |
| 21 | - <spatialModel type="SkyDirFunction"> | |
| 21 | + <spatialModel type="PointSource"> | |
| 22 | 22 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 23 | 23 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 24 | 24 | </spatialModel> | ... | ... |
src/model/GModelSpatialDiffuseConst.cpp
| ... | ... | @@ -410,7 +410,7 @@ double GModelSpatialDiffuseConst::mc_norm(const GSkyDir& dir, |
| 410 | 410 | * Read the isotropic source model information from an XML element. The XML |
| 411 | 411 | * element is expected to have the following format: |
| 412 | 412 | * |
| 413 | - * <spatialModel type="ConstantValue"> | |
| 413 | + * <spatialModel type="DiffuseIsotropic"> | |
| 414 | 414 | * <parameter name="Value" scale="1" value="1" min="1" max="1" free="0"/> |
| 415 | 415 | * </spatialModel> |
| 416 | 416 | * |
| ... | ... | @@ -442,7 +442,7 @@ void GModelSpatialDiffuseConst::read(const GXmlElement& xml) |
| 442 | 442 | * Write the isotropic source model information into an XML element. The XML |
| 443 | 443 | * element will have the following format: |
| 444 | 444 | * |
| 445 | - * <spatialModel type="ConstantValue"> | |
| 445 | + * <spatialModel type="DiffuseIsotropic"> | |
| 446 | 446 | * <parameter name="Value" scale="1" value="1" min="1" max="1" free="0"/> |
| 447 | 447 | * </spatialModel> |
| 448 | 448 | * |
| ... | ... | @@ -451,13 +451,13 @@ void GModelSpatialDiffuseConst::write(GXmlElement& xml) const |
| 451 | 451 | { |
| 452 | 452 | // Set model type |
| 453 | 453 | if (xml.attribute("type") == "") { |
| 454 | - xml.attribute("type", "ConstantValue"); | |
| 454 | + xml.attribute("type", type()); | |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | // Verify model type |
| 458 | - if (xml.attribute("type") != "ConstantValue") { | |
| 458 | + if (xml.attribute("type") != type()) { | |
| 459 | 459 | throw GException::model_invalid_spatial(G_WRITE, xml.attribute("type"), |
| 460 | - "Spatial model is not of type \"ConstantValue\"."); | |
| 460 | + "Spatial model is not of type \""+type()+"\"."); | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | // Get or create Value parameter | ... | ... |
src/model/GModelSpatialDiffuseCube.cpp
| ... | ... | @@ -508,13 +508,13 @@ bool GModelSpatialDiffuseCube::contains(const GSkyDir& dir, |
| 508 | 508 | * Read the map cube information from an XML element. The XML element should |
| 509 | 509 | * have either the format |
| 510 | 510 | * |
| 511 | - * <spatialModel type="MapCubeFunction" file="test_file.fits"> | |
| 511 | + * <spatialModel type="DiffuseMapCube" file="test_file.fits"> | |
| 512 | 512 | * <parameter name="Normalization" scale="1" value="1" min="0.1" max="10" free="0"/> |
| 513 | 513 | * </spatialModel> |
| 514 | 514 | * |
| 515 | 515 | * or alternatively |
| 516 | 516 | * |
| 517 | - * <spatialModel type="MapCubeFunction" file="test_file.fits"> | |
| 517 | + * <spatialModel type="DiffuseMapCube" file="test_file.fits"> | |
| 518 | 518 | * <parameter name="Value" scale="1" value="1" min="0.1" max="10" free="0"/> |
| 519 | 519 | * </spatialModel> |
| 520 | 520 | * |
| ... | ... | @@ -568,13 +568,13 @@ void GModelSpatialDiffuseCube::read(const GXmlElement& xml) |
| 568 | 568 | * Write the map cube information into an XML element. The XML element will |
| 569 | 569 | * have either the format |
| 570 | 570 | * |
| 571 | - * <spatialModel type="MapCubeFunction" file="test_file.fits"> | |
| 571 | + * <spatialModel type="DiffuseMapCube" file="test_file.fits"> | |
| 572 | 572 | * <parameter name="Normalization" scale="1" value="1" min="0.1" max="10" free="0"/> |
| 573 | 573 | * </spatialModel> |
| 574 | 574 | * |
| 575 | 575 | * or alternatively |
| 576 | 576 | * |
| 577 | - * <spatialModel type="MapCubeFunction" file="test_file.fits"> | |
| 577 | + * <spatialModel type="DiffuseMapCube" file="test_file.fits"> | |
| 578 | 578 | * <parameter name="Value" scale="1" value="1" min="0.1" max="10" free="0"/> |
| 579 | 579 | * </spatialModel> |
| 580 | 580 | * |
| ... | ... | @@ -584,13 +584,13 @@ void GModelSpatialDiffuseCube::write(GXmlElement& xml) const |
| 584 | 584 | { |
| 585 | 585 | // Set model type |
| 586 | 586 | if (xml.attribute("type") == "") { |
| 587 | - xml.attribute("type", "MapCubeFunction"); | |
| 587 | + xml.attribute("type", type()); | |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | // Verify model type |
| 591 | - if (xml.attribute("type") != "MapCubeFunction") { | |
| 591 | + if (xml.attribute("type") != type()) { | |
| 592 | 592 | throw GException::model_invalid_spatial(G_WRITE, xml.attribute("type"), |
| 593 | - "Spatial model is not of type \"MapCubeFunction\"."); | |
| 593 | + "Spatial model is not of type \""+type()+"\"."); | |
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | // If XML element has 0 nodes then append parameter node. The name | ... | ... |
src/model/GModelSpatialDiffuseMap.cpp
| ... | ... | @@ -487,13 +487,13 @@ bool GModelSpatialDiffuseMap::contains(const GSkyDir& dir, |
| 487 | 487 | * Reads the spatial information for a diffuse map from an XML element. The |
| 488 | 488 | * expected format of the XML element is |
| 489 | 489 | * |
| 490 | - * <spatialModel type="SpatialMap" file="myfile.fits" normalize="1"> | |
| 490 | + * <spatialModel type="DiffuseMap" file="myfile.fits" normalize="1"> | |
| 491 | 491 | * <parameter name="Prefactor" value="1" min="0.1" max="10" scale="1" free="0"/> |
| 492 | 492 | * </spatialModel> |
| 493 | 493 | * |
| 494 | 494 | * or |
| 495 | 495 | * |
| 496 | - * <spatialModel type="SpatialMap" file="myfile.fits" normalize="1"> | |
| 496 | + * <spatialModel type="DiffuseMap" file="myfile.fits" normalize="1"> | |
| 497 | 497 | * <parameter name="Normalization" value="1" min="0.1" max="10" scale="1" free="0"/> |
| 498 | 498 | * </spatialModel> |
| 499 | 499 | * |
| ... | ... | @@ -563,7 +563,7 @@ void GModelSpatialDiffuseMap::read(const GXmlElement& xml) |
| 563 | 563 | * Writes the spatial information for a diffuse map into an XML element. The |
| 564 | 564 | * format of the XML element is |
| 565 | 565 | * |
| 566 | - * <spatialModel type="SpatialMap" file="myfile.fits" normalize="1"> | |
| 566 | + * <spatialModel type="DiffuseMap" file="myfile.fits" normalize="1"> | |
| 567 | 567 | * <parameter name="Prefactor" value="1" min="0.1" max="10" scale="1" free="0"/> |
| 568 | 568 | * </spatialModel> |
| 569 | 569 | * |
| ... | ... | @@ -580,19 +580,19 @@ void GModelSpatialDiffuseMap::write(GXmlElement& xml) const |
| 580 | 580 | { |
| 581 | 581 | // Set model type |
| 582 | 582 | if (xml.attribute("type") == "") { |
| 583 | - xml.attribute("type", "SpatialMap"); | |
| 583 | + xml.attribute("type", type()); | |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | - // Set sky map file name | |
| 587 | - //xml.attribute("file", m_filename); | |
| 588 | - xml.attribute("file", gammalib::xml_file_reduce(xml, m_filename)); | |
| 589 | - | |
| 590 | 586 | // Verify model type |
| 591 | - if (xml.attribute("type") != "SpatialMap") { | |
| 587 | + if (xml.attribute("type") != type()) { | |
| 592 | 588 | throw GException::model_invalid_spatial(G_WRITE, xml.attribute("type"), |
| 593 | - "Spatial model is not of type \"SpatialMap\"."); | |
| 589 | + "Spatial model is not of type \""+type()+"\"."); | |
| 594 | 590 | } |
| 595 | 591 | |
| 592 | + // Set sky map file name | |
| 593 | + //xml.attribute("file", m_filename); | |
| 594 | + xml.attribute("file", gammalib::xml_file_reduce(xml, m_filename)); | |
| 595 | + | |
| 596 | 596 | // If XML element has 0 nodes then append parameter node. The name |
| 597 | 597 | // of the node is "Prefactor" as this is the Fermi/LAT standard. |
| 598 | 598 | // We thus assure that the XML files will be compatible with | ... | ... |
src/model/GModelSpatialEllipticalDisk.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialEllipticalDisk.cpp - Elliptical disk source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2013-2015 by Michael Mayer * | |
| 4 | + * copyright (C) 2013-2016 by Michael Mayer * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -455,7 +455,7 @@ double GModelSpatialEllipticalDisk::theta_max(void) const |
| 455 | 455 | * Reads the elliptical disk model information from an XML element. The XML |
| 456 | 456 | * element shall have either the format |
| 457 | 457 | * |
| 458 | - * <spatialModel type="DiskFunction"> | |
| 458 | + * <spatialModel type="EllipticalDisk"> | |
| 459 | 459 | * <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 460 | 460 | * <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 461 | 461 | * <parameter name="PA" scale="1.0" value="45.0" min="-360" max="360" free="1"/> |
| ... | ... | @@ -465,7 +465,7 @@ double GModelSpatialEllipticalDisk::theta_max(void) const |
| 465 | 465 | * |
| 466 | 466 | * or |
| 467 | 467 | * |
| 468 | - * <spatialModel type="DiskFunction"> | |
| 468 | + * <spatialModel type="EllipticalDisk"> | |
| 469 | 469 | * <parameter name="GLON" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 470 | 470 | * <parameter name="GLAT" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 471 | 471 | * <parameter name="PA" scale="1.0" value="45.0" min="-360" max="360" free="1"/> |
| ... | ... | @@ -544,7 +544,7 @@ void GModelSpatialEllipticalDisk::read(const GXmlElement& xml) |
| 544 | 544 | * Write the elliptical disk model information into an XML element. The XML |
| 545 | 545 | * element will have the format |
| 546 | 546 | * |
| 547 | - * <spatialModel type="DiskFunction"> | |
| 547 | + * <spatialModel type="EllipticalDisk"> | |
| 548 | 548 | * <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 549 | 549 | * <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 550 | 550 | * <parameter name="PA" scale="1.0" value="45.0" min="-360" max="360" free="1"/> | ... | ... |
src/model/GModelSpatialEllipticalGauss.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialEllipticalGauss.cpp - Elliptical gauss source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2015 by Michael Mayer * | |
| 4 | + * copyright (C) 2015-2016 by Michael Mayer * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -498,7 +498,7 @@ double GModelSpatialEllipticalGauss::theta_max(void) const |
| 498 | 498 | * Reads the elliptical gauss model information from an XML element. The XML |
| 499 | 499 | * element shall have either the format |
| 500 | 500 | * |
| 501 | - * <spatialModel type="EllipticalGauss"> | |
| 501 | + * <spatialModel type="EllipticalGaussian"> | |
| 502 | 502 | * <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 503 | 503 | * <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 504 | 504 | * <parameter name="PA" scale="1.0" value="45.0" min="-360" max="360" free="1"/> |
| ... | ... | @@ -508,7 +508,7 @@ double GModelSpatialEllipticalGauss::theta_max(void) const |
| 508 | 508 | * |
| 509 | 509 | * or |
| 510 | 510 | * |
| 511 | - * <spatialModel type="EllipticalGauss"> | |
| 511 | + * <spatialModel type="EllipticalGaussian"> | |
| 512 | 512 | * <parameter name="GLON" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 513 | 513 | * <parameter name="GLAT" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 514 | 514 | * <parameter name="PA" scale="1.0" value="45.0" min="-360" max="360" free="1"/> |
| ... | ... | @@ -587,7 +587,7 @@ void GModelSpatialEllipticalGauss::read(const GXmlElement& xml) |
| 587 | 587 | * Write the elliptical gauss model information into an XML element. The XML |
| 588 | 588 | * element will have the format |
| 589 | 589 | * |
| 590 | - * <spatialModel type="EllipticalGauss"> | |
| 590 | + * <spatialModel type="EllipticalGaussian"> | |
| 591 | 591 | * <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 592 | 592 | * <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 593 | 593 | * <parameter name="PA" scale="1.0" value="45.0" min="-360" max="360" free="1"/> | ... | ... |
src/model/GModelSpatialPointSource.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialPointSource.cpp - Spatial point source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2009-2015 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2009-2016 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -341,14 +341,14 @@ bool GModelSpatialPointSource::contains(const GSkyDir& dir, |
| 341 | 341 | * Read the point source information from an XML element with the following |
| 342 | 342 | * format |
| 343 | 343 | * |
| 344 | - * <spatialModel type="SkyDirFunction"> | |
| 344 | + * <spatialModel type="PointSource"> | |
| 345 | 345 | * <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 346 | 346 | * <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 347 | 347 | * </spatialModel> |
| 348 | 348 | * |
| 349 | 349 | * or |
| 350 | 350 | * |
| 351 | - * <spatialModel type="SkyDirFunction"> | |
| 351 | + * <spatialModel type="PointSource"> | |
| 352 | 352 | * <parameter free="0" max="360" min="-360" name="GLON" scale="1" value="83.6331" /> |
| 353 | 353 | * <parameter free="0" max="90" min="-90" name="GLAT" scale="1" value="22.0145" /> |
| 354 | 354 | * </spatialModel> |
| ... | ... | @@ -427,7 +427,7 @@ void GModelSpatialPointSource::read(const GXmlElement& xml) |
| 427 | 427 | * Write the point source information into an XML element with the following |
| 428 | 428 | * format |
| 429 | 429 | * |
| 430 | - * <spatialModel type="SkyDirFunction"> | |
| 430 | + * <spatialModel type="PointSource"> | |
| 431 | 431 | * <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 432 | 432 | * <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 433 | 433 | * </spatialModel> | ... | ... |
src/model/GModelSpatialRadialDisk.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialRadialDisk.cpp - Radial disk source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011-2015 by Christoph Deil * | |
| 4 | + * copyright (C) 2011-2016 by Christoph Deil * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -378,7 +378,7 @@ double GModelSpatialRadialDisk::theta_max(void) const |
| 378 | 378 | * Reads the radial disk model information from an XML element. The XML |
| 379 | 379 | * element shall have either the format |
| 380 | 380 | * |
| 381 | - * <spatialModel type="DiskFunction"> | |
| 381 | + * <spatialModel type="RadialDisk"> | |
| 382 | 382 | * <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 383 | 383 | * <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 384 | 384 | * <parameter name="Radius" scale="1.0" value="0.45" min="0.01" max="10" free="1"/> |
| ... | ... | @@ -386,7 +386,7 @@ double GModelSpatialRadialDisk::theta_max(void) const |
| 386 | 386 | * |
| 387 | 387 | * or |
| 388 | 388 | * |
| 389 | - * <spatialModel type="DiskFunction"> | |
| 389 | + * <spatialModel type="RadialDisk"> | |
| 390 | 390 | * <parameter name="GLON" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 391 | 391 | * <parameter name="GLAT" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 392 | 392 | * <parameter name="Radius" scale="1.0" value="0.45" min="0.01" max="10" free="1"/> |
| ... | ... | @@ -454,7 +454,7 @@ void GModelSpatialRadialDisk::read(const GXmlElement& xml) |
| 454 | 454 | * Writes the radial disk model information into an XML element. The XML |
| 455 | 455 | * element will have the format |
| 456 | 456 | * |
| 457 | - * <spatialModel type="DiskFunction"> | |
| 457 | + * <spatialModel type="RadialDisk"> | |
| 458 | 458 | * <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 459 | 459 | * <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 460 | 460 | * <parameter name="Radius" scale="1.0" value="0.45" min="0.01" max="10" free="1"/> | ... | ... |
src/model/GModelSpatialRadialGauss.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialRadialGauss.cpp - Radial Gaussian source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011-2015 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2011-2016 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -371,7 +371,7 @@ double GModelSpatialRadialGauss::theta_max(void) const |
| 371 | 371 | * Reads the radial Gauss model information from an XML element. The XML |
| 372 | 372 | * element shall have either the format |
| 373 | 373 | * |
| 374 | - * <spatialModel type="GaussFunction"> | |
| 374 | + * <spatialModel type="RadialGaussian"> | |
| 375 | 375 | * <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 376 | 376 | * <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 377 | 377 | * <parameter name="Sigma" scale="1.0" value="0.45" min="0.01" max="10" free="1"/> |
| ... | ... | @@ -379,7 +379,7 @@ double GModelSpatialRadialGauss::theta_max(void) const |
| 379 | 379 | * |
| 380 | 380 | * or |
| 381 | 381 | * |
| 382 | - * <spatialModel type="GaussFunction"> | |
| 382 | + * <spatialModel type="RadialGaussian"> | |
| 383 | 383 | * <parameter name="GLON" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 384 | 384 | * <parameter name="GLAT" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 385 | 385 | * <parameter name="Sigma" scale="1.0" value="0.45" min="0.01" max="10" free="1"/> |
| ... | ... | @@ -449,7 +449,7 @@ void GModelSpatialRadialGauss::read(const GXmlElement& xml) |
| 449 | 449 | * Writes the radial disk model information into an XML element. The XML |
| 450 | 450 | * element will have the format |
| 451 | 451 | * |
| 452 | - * <spatialModel type="DiskFunction"> | |
| 452 | + * <spatialModel type="RadialGaussian"> | |
| 453 | 453 | * <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 454 | 454 | * <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 455 | 455 | * <parameter name="Sigma" scale="1.0" value="0.45" min="0.01" max="10" free="1"/> | ... | ... |
src/model/GModelSpatialRadialShell.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialRadialShell.cpp - Radial shell source model class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011-2015 by Christoph Deil * | |
| 4 | + * copyright (C) 2011-2016 by Christoph Deil * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -417,7 +417,7 @@ double GModelSpatialRadialShell::theta_max(void) const |
| 417 | 417 | * Reads the radial shell model information from an XML element. The XML |
| 418 | 418 | * element shall have either the format |
| 419 | 419 | * |
| 420 | - * <spatialModel type="DiskFunction"> | |
| 420 | + * <spatialModel type="RadialShell"> | |
| 421 | 421 | * <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 422 | 422 | * <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 423 | 423 | * <parameter name="Radius" scale="1.0" value="0.30" min="0.01" max="10" free="1"/> |
| ... | ... | @@ -426,7 +426,7 @@ double GModelSpatialRadialShell::theta_max(void) const |
| 426 | 426 | * |
| 427 | 427 | * or |
| 428 | 428 | * |
| 429 | - * <spatialModel type="DiskFunction"> | |
| 429 | + * <spatialModel type="RadialShell"> | |
| 430 | 430 | * <parameter name="GLON" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 431 | 431 | * <parameter name="GLAT" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 432 | 432 | * <parameter name="Radius" scale="1.0" value="0.30" min="0.01" max="10" free="1"/> |
| ... | ... | @@ -513,7 +513,7 @@ void GModelSpatialRadialShell::read(const GXmlElement& xml) |
| 513 | 513 | * Writes the radial shell model information into an XML element. The XML |
| 514 | 514 | * element will have the format |
| 515 | 515 | * |
| 516 | - * <spatialModel type="DiskFunction"> | |
| 516 | + * <spatialModel type="RadialShell"> | |
| 517 | 517 | * <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 518 | 518 | * <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 519 | 519 | * <parameter name="Radius" scale="1.0" value="0.30" min="0.01" max="10" free="1"/> | ... | ... |
src/model/GModelSpatialRegistry.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GModelSpatialRegistry.cpp - Spatial model registry class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011-2013 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2011-2016 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -40,7 +40,7 @@ |
| 40 | 40 | /* __ Coding definitions _________________________________________________ */ |
| 41 | 41 | |
| 42 | 42 | /* __ Debug definitions __________________________________________________ */ |
| 43 | -#define G_DEBUG_REGISTRY 0 | |
| 43 | +//#define G_DEBUG_REGISTRY //!< Dump registry | |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | /*========================================================================== |
| ... | ... | @@ -58,7 +58,7 @@ GModelSpatialRegistry::GModelSpatialRegistry(void) |
| 58 | 58 | init_members(); |
| 59 | 59 | |
| 60 | 60 | // Debug option: Show actual registry |
| 61 | - #if G_DEBUG_REGISTRY | |
| 61 | + #if defined(G_DEBUG_REGISTRY) | |
| 62 | 62 | std::cout << "GModelSpatialRegistry(void): "; |
| 63 | 63 | for (int i = 0; i < size(); ++i) { |
| 64 | 64 | std::cout << "\"" << names()[i] << "\" "; |
| ... | ... | @@ -85,14 +85,19 @@ GModelSpatialRegistry::GModelSpatialRegistry(const GModelSpatial* model) |
| 85 | 85 | init_members(); |
| 86 | 86 | |
| 87 | 87 | // Debug option: Notify new registry |
| 88 | - #if G_DEBUG_REGISTRY | |
| 88 | + #if defined(G_DEBUG_REGISTRY) | |
| 89 | 89 | std::cout << "GModelSpatialRegistry(const GModelSpatial*): "; |
| 90 | 90 | std::cout << "add \"" << model->type() << "\" to registry." << std::endl; |
| 91 | 91 | #endif |
| 92 | 92 | |
| 93 | 93 | // Allocate new registry |
| 94 | + #if defined(G_LEGACY_MODEL_NAMES) | |
| 95 | + std::string* new_names = new std::string[size()+2]; | |
| 96 | + const GModelSpatial** new_models = new const GModelSpatial*[size()+2]; | |
| 97 | + #else | |
| 94 | 98 | std::string* new_names = new std::string[size()+1]; |
| 95 | 99 | const GModelSpatial** new_models = new const GModelSpatial*[size()+1]; |
| 100 | + #endif | |
| 96 | 101 | |
| 97 | 102 | // Save old registry |
| 98 | 103 | for (int i = 0; i < size(); ++i) { |
| ... | ... | @@ -104,15 +109,24 @@ GModelSpatialRegistry::GModelSpatialRegistry(const GModelSpatial* model) |
| 104 | 109 | new_names[size()] = model->type(); |
| 105 | 110 | new_models[size()] = model; |
| 106 | 111 | |
| 112 | + // Add new model with alias to registry for legacy naming convention | |
| 113 | + #if defined(G_LEGACY_MODEL_NAMES) | |
| 114 | + new_names[size()+1] = model->alias(); | |
| 115 | + new_models[size()+1] = model; | |
| 116 | + #endif | |
| 117 | + | |
| 107 | 118 | // Set pointers on new registry |
| 108 | 119 | names().assign(new_names); |
| 109 | 120 | models().assign(new_models); |
| 110 | 121 | |
| 111 | 122 | // Increment number of models in registry |
| 123 | + #if defined(G_LEGACY_MODEL_NAMES) | |
| 124 | + number()++; | |
| 125 | + #endif | |
| 112 | 126 | number()++; |
| 113 | 127 | |
| 114 | 128 | // Debug option: Show actual registry |
| 115 | - #if G_DEBUG_REGISTRY | |
| 129 | + #if defined(G_DEBUG_REGISTRY) | |
| 116 | 130 | std::cout << "GModelSpatialRegistry(const GModelSpatial*): "; |
| 117 | 131 | for (int i = 0; i < size(); ++i) { |
| 118 | 132 | std::cout << "\"" << names()[i] << "\" "; | ... | ... |
test/data/crab.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.1" free="1"/> |
| 7 | 7 | <parameter scale="1.0" name="Scale" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 11 | 11 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 12 | 12 | </spatialModel> | ... | ... |
test/data/model_diffuse_const.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.1" free="1"/> |
| 7 | 7 | <parameter scale="1.0" name="Scale" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="ConstantValue"> | |
| 9 | + <spatialModel type="DiffuseIsotropic"> | |
| 10 | 10 | <parameter name="Value" scale="1" value="1" min="0.1" max="10" free="0"/> |
| 11 | 11 | </spatialModel> |
| 12 | 12 | </source> | ... | ... |
test/data/model_diffuse_cube.xml
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | <spectrum type="ConstantValue"> |
| 5 | 5 | <parameter name="Value" scale="1" value="1" min="0" max="1000" free="1"/> |
| 6 | 6 | </spectrum> |
| 7 | - <spatialModel type="MapCubeFunction" file="test_cube.fits"> | |
| 7 | + <spatialModel type="DiffuseMapCube" file="test_cube.fits"> | |
| 8 | 8 | <parameter name="Normalization" scale="1" value="1" min="0.1" max="10" free="0"/> |
| 9 | 9 | </spatialModel> |
| 10 | 10 | </source> | ... | ... |
test/data/model_diffuse_map.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.1" free="1"/> |
| 7 | 7 | <parameter scale="1.0" name="Scale" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SpatialMap" file="cena_lobes_parkes.fits"> | |
| 9 | + <spatialModel type="DiffuseMap" file="cena_lobes_parkes.fits"> | |
| 10 | 10 | <parameter scale="1" name="Prefactor" min="0.001" max="1000.0" value="1" free="0"/> |
| 11 | 11 | </spatialModel> |
| 12 | 12 | </source> | ... | ... |
test/data/model_elliptical_gauss.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.1" free="1"/> |
| 7 | 7 | <parameter scale="1.0" name="Scale" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="EllipticalGauss"> | |
| 9 | + <spatialModel type="EllipticalGaussian"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 12 | 12 | <parameter name="PA" scale="1.0" value="45.0" min="-360" max="360" free="1"/> | ... | ... |
test/data/model_point_bplaw.xml
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | <parameter name="BreakValue" scale="1e6" value="0.3" min="0.01" max="1000.0" free="1"/> |
| 8 | 8 | <parameter name="Index2" scale="-1" value="2.70" min="0.01" max="+5.0" free="1"/> |
| 9 | 9 | </spectrum> |
| 10 | - <spatialModel type="SkyDirFunction"> | |
| 10 | + <spatialModel type="PointSource"> | |
| 11 | 11 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 12 | 12 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 13 | 13 | </spatialModel> | ... | ... |
test/data/model_point_const.xml
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | <spectrum type="ConstantValue"> |
| 5 | 5 | <parameter name="Normalization" scale="1e-16" value="5.7" min="1e-07" max="1000.0" free="1"/> |
| 6 | 6 | </spectrum> |
| 7 | - <spatialModel type="SkyDirFunction"> | |
| 7 | + <spatialModel type="PointSource"> | |
| 8 | 8 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 9 | 9 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 10 | 10 | </spatialModel> | ... | ... |
test/data/model_point_eplaw.xml
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | <parameter name="Cutoff" scale="1e6" value="1.0" min="0.01" max="1000.0" free="1"/> |
| 8 | 8 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 9 | 9 | </spectrum> |
| 10 | - <spatialModel type="SkyDirFunction"> | |
| 10 | + <spatialModel type="PointSource"> | |
| 11 | 11 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 12 | 12 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 13 | 13 | </spatialModel> | ... | ... |
test/data/model_point_filefct.xml
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | <spectrum type="FileFunction" file="filefunction.txt"> |
| 5 | 5 | <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/> |
| 6 | 6 | </spectrum> |
| 7 | - <spatialModel type="SkyDirFunction"> | |
| 7 | + <spatialModel type="PointSource"> | |
| 8 | 8 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 9 | 9 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 10 | 10 | </spatialModel> | ... | ... |
test/data/model_point_gauss.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Mean" scale="1e6" value="5.0" min="0.01" max="100.0" free="1"/> |
| 7 | 7 | <parameter name="Sigma" scale="1e6" value="1.0" min="0.01" max="100.0" free="1"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 11 | 11 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 12 | 12 | </spatialModel> | ... | ... |
test/data/model_point_logparabola.xml
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | <parameter name="Curvature" scale="-1" value="0.074" min="-5.0" max="+5.0" free="1"/> |
| 8 | 8 | <parameter name="Scale" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/> |
| 9 | 9 | </spectrum> |
| 10 | - <spatialModel type="SkyDirFunction"> | |
| 10 | + <spatialModel type="PointSource"> | |
| 11 | 11 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 12 | 12 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 13 | 13 | </spatialModel> | ... | ... |
test/data/model_point_nodes.xml
| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | <parameter scale="1e-07" name="Intensity" min="1e-07" max="1000.0" value="0.1" free="1"/> |
| 12 | 12 | </node> |
| 13 | 13 | </spectrum> |
| 14 | - <spatialModel type="SkyDirFunction"> | |
| 14 | + <spatialModel type="PointSource"> | |
| 15 | 15 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 16 | 16 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 17 | 17 | </spatialModel> | ... | ... |
test/data/model_point_plaw.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="1"/> |
| 7 | 7 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="SkyDirFunction"> | |
| 9 | + <spatialModel type="PointSource"> | |
| 10 | 10 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 11 | 11 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 12 | 12 | </spatialModel> | ... | ... |
test/data/model_point_plaw2.xml
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 8 | 8 | <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> |
| 9 | 9 | </spectrum> |
| 10 | - <spatialModel type="SkyDirFunction"> | |
| 10 | + <spatialModel type="PointSource"> | |
| 11 | 11 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 12 | 12 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 13 | 13 | </spatialModel> | ... | ... |
test/data/model_point_supeplaw.xml
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | <parameter name="Scale" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/> |
| 9 | 9 | <parameter name="Index2" scale="1.0" value="1.5" min="0.1" max="5.0" free="1"/> |
| 10 | 10 | </spectrum> |
| 11 | - <spatialModel type="SkyDirFunction"> | |
| 11 | + <spatialModel type="PointSource"> | |
| 12 | 12 | <parameter free="0" max="360" min="-360" name="RA" scale="1" value="83.6331" /> |
| 13 | 13 | <parameter free="0" max="90" min="-90" name="DEC" scale="1" value="22.0145" /> |
| 14 | 14 | </spatialModel> | ... | ... |
test/data/model_radial_disk.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.1" free="1"/> |
| 7 | 7 | <parameter scale="1.0" name="Scale" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="DiskFunction"> | |
| 9 | + <spatialModel type="RadialDisk"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 12 | 12 | <parameter name="Radius" scale="1.0" value="0.45" min="0.01" max="10" free="1"/> | ... | ... |
test/data/model_radial_gauss.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.1" free="1"/> |
| 7 | 7 | <parameter scale="1.0" name="Scale" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="GaussFunction"> | |
| 9 | + <spatialModel type="RadialGaussian"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 12 | 12 | <parameter name="Sigma" scale="1.0" value="0.20" min="0.01" max="10" free="1"/> | ... | ... |
test/data/model_radial_shell.xml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.1" free="1"/> |
| 7 | 7 | <parameter scale="1.0" name="Scale" min="10.0" max="1000000.0" value="100.0" free="0"/> |
| 8 | 8 | </spectrum> |
| 9 | - <spatialModel type="ShellFunction"> | |
| 9 | + <spatialModel type="RadialShell"> | |
| 10 | 10 | <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> |
| 11 | 11 | <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> |
| 12 | 12 | <parameter name="Radius" scale="1.0" value="0.30" min="0.01" max="10" free="1"/> | ... | ... |
test/data/test.xml
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | <parameter free="1" max="100000" min="500" name="Cutoff" scale="1" value="8244.185952" /> |
| 11 | 11 | <parameter free="0" max="5" min="0" name="Index2" scale="1" value="1" /> |
| 12 | 12 | </spectrum> |
| 13 | - <spatialModel file="LMC.fits" type="SpatialMap"> | |
| 13 | + <spatialModel file="LMC.fits" type="DiffuseMap"> | |
| 14 | 14 | <parameter free="0" max="1000" min="0.001" name="Prefactor" scale="1" value="1" /> |
| 15 | 15 | </spatialModel> |
| 16 | 16 | </source> | ... | ... |
test/test_GModel.cpp
| ... | ... | @@ -531,8 +531,8 @@ void TestGModel::test_point_source(void) |
| 531 | 531 | test_try("Test void constructor"); |
| 532 | 532 | try { |
| 533 | 533 | GModelSpatialPointSource model; |
| 534 | - test_assert(model.type() == "SkyDirFunction", | |
| 535 | - "Model type \"SkyDirFunction\" expected."); | |
| 534 | + test_assert(model.type() == "PointSource", | |
| 535 | + "Model type \"PointSource\" expected."); | |
| 536 | 536 | test_try_success(); |
| 537 | 537 | } |
| 538 | 538 | catch (std::exception &e) { |
| ... | ... | @@ -573,7 +573,7 @@ void TestGModel::test_point_source(void) |
| 573 | 573 | GXmlElement* element = xml.element(0)->element(0)->element("spatialModel", 0); |
| 574 | 574 | GModelSpatialPointSource model(*element); |
| 575 | 575 | test_value(model.size(), 2); |
| 576 | - test_assert(model.type() == "SkyDirFunction", "Expected \"SkyDirFunction\""); | |
| 576 | + test_assert(model.type() == "PointSource", "Expected \"PointSource\""); | |
| 577 | 577 | test_value(model.ra(), 83.6331); |
| 578 | 578 | test_value(model.dec(), +22.0145); |
| 579 | 579 | |
| ... | ... | @@ -618,8 +618,8 @@ void TestGModel::test_diffuse_const(void) |
| 618 | 618 | test_try("Test void constructor"); |
| 619 | 619 | try { |
| 620 | 620 | GModelSpatialDiffuseConst model; |
| 621 | - test_assert(model.type() == "ConstantValue", | |
| 622 | - "Model type \"ConstantValue\" expected."); | |
| 621 | + test_assert(model.type() == "DiffuseIsotropic", | |
| 622 | + "Model type \"DiffuseIsotropic\" expected."); | |
| 623 | 623 | test_try_success(); |
| 624 | 624 | } |
| 625 | 625 | catch (std::exception &e) { |
| ... | ... | @@ -645,7 +645,8 @@ void TestGModel::test_diffuse_const(void) |
| 645 | 645 | GXmlElement* element = xml.element(0)->element(0)->element("spatialModel", 0); |
| 646 | 646 | GModelSpatialDiffuseConst model(*element); |
| 647 | 647 | test_value(model.size(), 1); |
| 648 | - test_assert(model.type() == "ConstantValue", "Expected \"ConstantValue\""); | |
| 648 | + test_assert(model.type() == "DiffuseIsotropic", | |
| 649 | + "Expected \"DiffuseIsotropic\""); | |
| 649 | 650 | test_value(model.value(), 1.0); |
| 650 | 651 | |
| 651 | 652 | // Test value method |
| ... | ... | @@ -684,8 +685,8 @@ void TestGModel::test_diffuse_cube(void) |
| 684 | 685 | test_try("Test void constructor"); |
| 685 | 686 | try { |
| 686 | 687 | GModelSpatialDiffuseCube model; |
| 687 | - test_assert(model.type() == "MapCubeFunction", | |
| 688 | - "Model type \"MapCubeFunction\" expected."); | |
| 688 | + test_assert(model.type() == "DiffuseMapCube", | |
| 689 | + "Model type \"DiffuseMapCube\" expected."); | |
| 689 | 690 | test_assert(model.filename().url() == "", "Model filename \"\" expected."); |
| 690 | 691 | test_try_success(); |
| 691 | 692 | } |
| ... | ... | @@ -732,7 +733,8 @@ void TestGModel::test_diffuse_cube(void) |
| 732 | 733 | GXmlElement* element = xml.element(0)->element(0)->element("spatialModel", 0); |
| 733 | 734 | GModelSpatialDiffuseCube model(*element); |
| 734 | 735 | test_value(model.size(), 1); |
| 735 | - test_assert(model.type() == "MapCubeFunction", "Expected \"MapCubeFunction\""); | |
| 736 | + test_assert(model.type() == "DiffuseMapCube", | |
| 737 | + "Expected \"DiffuseMapCube\""); | |
| 736 | 738 | test_value(model.value(), 1.0); |
| 737 | 739 | test_assert(model.filename().url() == m_cube_file, |
| 738 | 740 | "Model filename \""+m_cube_file+"\" expected."); |
| ... | ... | @@ -780,8 +782,8 @@ void TestGModel::test_diffuse_map(void) |
| 780 | 782 | { |
| 781 | 783 | // Test void constructor |
| 782 | 784 | GModelSpatialDiffuseMap model1; |
| 783 | - test_assert(model1.type() == "SpatialMap", | |
| 784 | - "Check that model is of type \"SpatialMap\"."); | |
| 785 | + test_assert(model1.type() == "DiffuseMap", | |
| 786 | + "Check that model is of type \"DiffuseMap\"."); | |
| 785 | 787 | test_assert(model1.filename().url() == "", |
| 786 | 788 | "Check that model has empty filename."); |
| 787 | 789 | |
| ... | ... | @@ -806,9 +808,9 @@ void TestGModel::test_diffuse_map(void) |
| 806 | 808 | GModelSpatialDiffuseMap model(*elementp); |
| 807 | 809 | test_value(model.size(), 1, |
| 808 | 810 | "Check that model build from an XML element has one parameter."); |
| 809 | - test_assert(model.type() == "SpatialMap", | |
| 811 | + test_assert(model.type() == "DiffuseMap", | |
| 810 | 812 | "Check that model build from an XML element is of type " |
| 811 | - "\"SpatialMap\"."); | |
| 813 | + "\"DiffuseMap\"."); | |
| 812 | 814 | test_value(model.value(), 1.0, |
| 813 | 815 | "Check that normalisation of model build from an XML element is " |
| 814 | 816 | "unity."); |
| ... | ... | @@ -888,8 +890,8 @@ void TestGModel::test_radial_disk(void) |
| 888 | 890 | test_try("Test void constructor"); |
| 889 | 891 | try { |
| 890 | 892 | GModelSpatialRadialDisk model; |
| 891 | - test_assert(model.type() == "DiskFunction", | |
| 892 | - "Model type \"DiskFunction\" expected."); | |
| 893 | + test_assert(model.type() == "RadialDisk", | |
| 894 | + "Model type \"RadialDisk\" expected."); | |
| 893 | 895 | test_try_success(); |
| 894 | 896 | } |
| 895 | 897 | catch (std::exception &e) { |
| ... | ... | @@ -919,7 +921,7 @@ void TestGModel::test_radial_disk(void) |
| 919 | 921 | GXmlElement* element = xml.element(0)->element(0)->element("spatialModel", 0); |
| 920 | 922 | GModelSpatialRadialDisk model(*element); |
| 921 | 923 | test_value(model.size(), 3); |
| 922 | - test_assert(model.type() == "DiskFunction", "Expected \"DiskFunction\""); | |
| 924 | + test_assert(model.type() == "RadialDisk", "Expected \"RadialDisk\""); | |
| 923 | 925 | test_value(model.ra(), 83.6331); |
| 924 | 926 | test_value(model.dec(), 22.0145); |
| 925 | 927 | test_value(model.radius(), 0.45); |
| ... | ... | @@ -975,8 +977,8 @@ void TestGModel::test_radial_gauss(void) |
| 975 | 977 | test_try("Test void constructor"); |
| 976 | 978 | try { |
| 977 | 979 | GModelSpatialRadialGauss model; |
| 978 | - test_assert(model.type() == "GaussFunction", | |
| 979 | - "Model type \"GaussFunction\" expected."); | |
| 980 | + test_assert(model.type() == "RadialGaussian", | |
| 981 | + "Model type \"RadialGaussian\" expected."); | |
| 980 | 982 | test_try_success(); |
| 981 | 983 | } |
| 982 | 984 | catch (std::exception &e) { |
| ... | ... | @@ -1006,7 +1008,8 @@ void TestGModel::test_radial_gauss(void) |
| 1006 | 1008 | GXmlElement* element = xml.element(0)->element(0)->element("spatialModel", 0); |
| 1007 | 1009 | GModelSpatialRadialGauss model(*element); |
| 1008 | 1010 | test_value(model.size(), 3); |
| 1009 | - test_assert(model.type() == "GaussFunction", "Expected \"GaussFunction\""); | |
| 1011 | + test_assert(model.type() == "RadialGaussian", | |
| 1012 | + "Expected \"RadialGaussian\""); | |
| 1010 | 1013 | test_value(model.ra(), 83.6331); |
| 1011 | 1014 | test_value(model.dec(), 22.0145); |
| 1012 | 1015 | test_value(model.sigma(), 0.20); |
| ... | ... | @@ -1062,8 +1065,8 @@ void TestGModel::test_radial_shell(void) |
| 1062 | 1065 | test_try("Test void constructor"); |
| 1063 | 1066 | try { |
| 1064 | 1067 | GModelSpatialRadialShell model; |
| 1065 | - test_assert(model.type() == "ShellFunction", | |
| 1066 | - "Model type \"ShellFunction\" expected."); | |
| 1068 | + test_assert(model.type() == "RadialShell", | |
| 1069 | + "Model type \"RadialShell\" expected."); | |
| 1067 | 1070 | test_try_success(); |
| 1068 | 1071 | } |
| 1069 | 1072 | catch (std::exception &e) { |
| ... | ... | @@ -1094,7 +1097,7 @@ void TestGModel::test_radial_shell(void) |
| 1094 | 1097 | GXmlElement* element = xml.element(0)->element(0)->element("spatialModel", 0); |
| 1095 | 1098 | GModelSpatialRadialShell model(*element); |
| 1096 | 1099 | test_value(model.size(), 4); |
| 1097 | - test_assert(model.type() == "ShellFunction", "Expected \"ShellFunction\""); | |
| 1100 | + test_assert(model.type() == "RadialShell", "Expected \"RadialShell\""); | |
| 1098 | 1101 | test_value(model.ra(), 83.6331); |
| 1099 | 1102 | test_value(model.dec(), 22.0145); |
| 1100 | 1103 | test_value(model.radius(), 0.30); |
| ... | ... | @@ -1253,8 +1256,8 @@ void TestGModel::test_elliptical_gauss(void) |
| 1253 | 1256 | test_try("Test void constructor"); |
| 1254 | 1257 | try { |
| 1255 | 1258 | GModelSpatialEllipticalGauss model; |
| 1256 | - test_assert(model.type() == "EllipticalGauss", | |
| 1257 | - "Model type \"EllipticalGauss\" expected."); | |
| 1259 | + test_assert(model.type() == "EllipticalGaussian", | |
| 1260 | + "Model type \"EllipticalGaussian\" expected."); | |
| 1258 | 1261 | test_try_success(); |
| 1259 | 1262 | } |
| 1260 | 1263 | catch (std::exception &e) { |
| ... | ... | @@ -1286,7 +1289,8 @@ void TestGModel::test_elliptical_gauss(void) |
| 1286 | 1289 | GXmlElement* element = xml.element(0)->element(0)->element("spatialModel", 0); |
| 1287 | 1290 | GModelSpatialEllipticalGauss model(*element); |
| 1288 | 1291 | test_value(model.size(), 5); |
| 1289 | - test_assert(model.type() == "EllipticalGauss", "Expected \"EllipticalGauss\""); | |
| 1292 | + test_assert(model.type() == "EllipticalGaussian", | |
| 1293 | + "Expected \"EllipticalGaussian\""); | |
| 1290 | 1294 | test_value(model.ra(), 83.6331); |
| 1291 | 1295 | test_value(model.dec(), 22.0145); |
| 1292 | 1296 | test_value(model.posangle(), 45.0); |
| ... | ... | @@ -2633,13 +2637,22 @@ void TestGModel::test_model_registry(void) |
| 2633 | 2637 | int num = registry.size(); |
| 2634 | 2638 | for (int i = 0; i < num; ++i) { |
| 2635 | 2639 | GModelSpatial* ptr = registry.alloc(registry.name(i)); |
| 2636 | - test_assert(ptr != NULL, "Model pointer for \""+ registry.name(i)+"\" is NULL"); | |
| 2640 | + test_assert(ptr != NULL, | |
| 2641 | + "Model pointer for \""+ registry.name(i)+"\" is NULL"); | |
| 2637 | 2642 | if (ptr != NULL) { |
| 2638 | 2643 | |
| 2639 | 2644 | // Test model type |
| 2640 | - test_assert(ptr->type() == registry.name(i), | |
| 2645 | + #if defined(G_LEGACY_MODEL_NAMES) | |
| 2646 | + test_assert((ptr->type() == registry.name(i)) || | |
| 2647 | + (ptr->alias() == registry.name(i)), | |
| 2648 | + "Expected \""+registry.name(i)+"\" instead" | |
| 2649 | + " of \""+ptr->type()+"\" or \""+ | |
| 2650 | + ptr->alias()+"\"."); | |
| 2651 | + #else | |
| 2652 | + test_assert(ptr->type() == registry.name(i), | |
| 2641 | 2653 | "Expected \""+registry.name(i)+"\" instead" |
| 2642 | 2654 | " of \""+ptr->type()+"\"."); |
| 2655 | + #endif | |
| 2643 | 2656 | |
| 2644 | 2657 | // Free model |
| 2645 | 2658 | delete ptr; | ... | ... |