Commit fbd66c42237e17a316960cae289b21f0d1c020b8
1 parent
a949aa5a
Merge in GModelSpectralPlawEnergyFlux
Showing
13 changed files
with
468 additions
and
821 deletions
ChangeLog
| 1 | -2016-07-24 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 1 | +2016-07-28 |
| 2 | + | ||
| 3 | + * Version 1.2.0 released | ||
| 4 | + ========================= | ||
| 5 | + | ||
| 6 | + Add GModelSpectralPlawEnergyFlux class (#1790) | ||
| 7 | + Rename GModelSpectralPlaw2 to GModelSpectralPlawPhotonFlux (#1790) | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +2016-07-24 | ||
| 2 | 11 | ||
| 3 | * Version 1.1.0 released | 12 | * Version 1.1.0 released |
| 4 | ========================= | 13 | ========================= |
| @@ -70,7 +79,7 @@ | @@ -70,7 +79,7 @@ | ||
| 70 | Finalize implementation of CTA On/Off fitting (#1044, #1781) | 79 | Finalize implementation of CTA On/Off fitting (#1044, #1781) |
| 71 | 80 | ||
| 72 | 81 | ||
| 73 | -2016-01-27 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 82 | +2016-01-27 |
| 74 | 83 | ||
| 75 | * Bug fix version 1.0.1 released | 84 | * Bug fix version 1.0.1 released |
| 76 | ================================ | 85 | ================================ |
| @@ -81,7 +90,7 @@ | @@ -81,7 +90,7 @@ | ||
| 81 | Correct diffuse map MC normalisation (#1584) | 90 | Correct diffuse map MC normalisation (#1584) |
| 82 | 91 | ||
| 83 | 92 | ||
| 84 | -2015-12-18 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 93 | +2015-12-18 |
| 85 | 94 | ||
| 86 | * Version 1.0.0 released | 95 | * Version 1.0.0 released |
| 87 | ========================= | 96 | ========================= |
| @@ -99,7 +108,7 @@ | @@ -99,7 +108,7 @@ | ||
| 99 | Resolve Python test problem on El Capitan (#1563) | 108 | Resolve Python test problem on El Capitan (#1563) |
| 100 | 109 | ||
| 101 | 110 | ||
| 102 | -2015-10-28 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 111 | +2015-10-28 |
| 103 | 112 | ||
| 104 | * Version 0.11.0 released | 113 | * Version 0.11.0 released |
| 105 | ========================= | 114 | ========================= |
| @@ -130,7 +139,7 @@ | @@ -130,7 +139,7 @@ | ||
| 130 | Implement rejection method for skymap Monte Carlo (#1465) | 139 | Implement rejection method for skymap Monte Carlo (#1465) |
| 131 | 140 | ||
| 132 | 141 | ||
| 133 | -2015-05-22 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 142 | +2015-05-22 |
| 134 | 143 | ||
| 135 | * Version 0.10.0 released | 144 | * Version 0.10.0 released |
| 136 | ========================= | 145 | ========================= |
| @@ -162,7 +171,7 @@ | @@ -162,7 +171,7 @@ | ||
| 162 | Add CTA Prod2 instrument response function (#1464) | 171 | Add CTA Prod2 instrument response function (#1464) |
| 163 | 172 | ||
| 164 | 173 | ||
| 165 | -2015-01-07 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 174 | +2015-01-07 |
| 166 | 175 | ||
| 167 | * Bug fix version 0.9.1 released | 176 | * Bug fix version 0.9.1 released |
| 168 | ================================ | 177 | ================================ |
| @@ -170,7 +179,7 @@ | @@ -170,7 +179,7 @@ | ||
| 170 | Fixed bug #1383 (unit test error with recent gcc compiler) | 179 | Fixed bug #1383 (unit test error with recent gcc compiler) |
| 171 | 180 | ||
| 172 | 181 | ||
| 173 | -2014-11-13 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 182 | +2014-11-13 |
| 174 | 183 | ||
| 175 | * Version 0.9.0 released | 184 | * Version 0.9.0 released |
| 176 | ======================== | 185 | ======================== |
| @@ -210,7 +219,7 @@ | @@ -210,7 +219,7 @@ | ||
| 210 | Several bug corrections | 219 | Several bug corrections |
| 211 | 220 | ||
| 212 | 221 | ||
| 213 | -2014-03-12 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 222 | +2014-03-12 |
| 214 | 223 | ||
| 215 | * Bug fix Version 0.8.2 released | 224 | * Bug fix Version 0.8.2 released |
| 216 | ================================ | 225 | ================================ |
| @@ -230,7 +239,7 @@ | @@ -230,7 +239,7 @@ | ||
| 230 | Correct LAT PSF computation for sources outside event cube | 239 | Correct LAT PSF computation for sources outside event cube |
| 231 | 240 | ||
| 232 | 241 | ||
| 233 | -2014-02-05 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 242 | +2014-02-05 |
| 234 | 243 | ||
| 235 | * Bug fix Version 0.8.1 released | 244 | * Bug fix Version 0.8.1 released |
| 236 | ================================ | 245 | ================================ |
| @@ -247,7 +256,7 @@ | @@ -247,7 +256,7 @@ | ||
| 247 | Correct deadtime computation for CTA non point source response (#1133) | 256 | Correct deadtime computation for CTA non point source response (#1133) |
| 248 | 257 | ||
| 249 | 258 | ||
| 250 | -2014-01-18 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 259 | +2014-01-18 |
| 251 | 260 | ||
| 252 | * Version 0.8.0 released | 261 | * Version 0.8.0 released |
| 253 | ======================== | 262 | ======================== |
| @@ -279,7 +288,8 @@ | @@ -279,7 +288,8 @@ | ||
| 279 | - GWcslib => GWcs | 288 | - GWcslib => GWcs |
| 280 | - GWcsHPX => GHealpix | 289 | - GWcsHPX => GHealpix |
| 281 | 290 | ||
| 282 | -2012-12-18 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 291 | + |
| 292 | +2012-12-18 | ||
| 283 | 293 | ||
| 284 | * Version 0.7.0 released | 294 | * Version 0.7.0 released |
| 285 | ======================== | 295 | ======================== |
| @@ -300,7 +310,8 @@ | @@ -300,7 +310,8 @@ | ||
| 300 | Rework GTime interface and introduce GTimeReference class | 310 | Rework GTime interface and introduce GTimeReference class |
| 301 | Add GModelSpectralLogParabola spectral model | 311 | Add GModelSpectralLogParabola spectral model |
| 302 | 312 | ||
| 303 | -2012-09-17 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 313 | + |
| 314 | +2012-09-17 | ||
| 304 | 315 | ||
| 305 | * Bug fix version 0.6.2 released | 316 | * Bug fix version 0.6.2 released |
| 306 | ================================ | 317 | ================================ |
| @@ -312,7 +323,8 @@ | @@ -312,7 +323,8 @@ | ||
| 312 | Improve Python bindings configuration | 323 | Improve Python bindings configuration |
| 313 | Add TEST_ENV_DIR to load library path | 324 | Add TEST_ENV_DIR to load library path |
| 314 | 325 | ||
| 315 | -2012-09-15 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 326 | + |
| 327 | +2012-09-15 | ||
| 316 | 328 | ||
| 317 | * Bug fix version 0.6.1 released | 329 | * Bug fix version 0.6.1 released |
| 318 | ================================ | 330 | ================================ |
| @@ -320,7 +332,8 @@ | @@ -320,7 +332,8 @@ | ||
| 320 | Do not require gammalib/__init__.py file to be present | 332 | Do not require gammalib/__init__.py file to be present |
| 321 | clang++ compiler takes precedence over g++ compiler | 333 | clang++ compiler takes precedence over g++ compiler |
| 322 | 334 | ||
| 323 | -2012-09-14 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 335 | + |
| 336 | +2012-09-14 | ||
| 324 | 337 | ||
| 325 | * Version 0.6.0 released | 338 | * Version 0.6.0 released |
| 326 | ======================== | 339 | ======================== |
| @@ -334,7 +347,8 @@ | @@ -334,7 +347,8 @@ | ||
| 334 | Correct bugs in GSparseMatrix | 347 | Correct bugs in GSparseMatrix |
| 335 | Enhance code quality | 348 | Enhance code quality |
| 336 | 349 | ||
| 337 | -2012-04-03 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 350 | + |
| 351 | +2012-04-03 | ||
| 338 | 352 | ||
| 339 | * Version 0.5.0 released | 353 | * Version 0.5.0 released |
| 340 | ======================== | 354 | ======================== |
| @@ -351,7 +365,8 @@ | @@ -351,7 +365,8 @@ | ||
| 351 | Add GModelSpectralNodes model | 365 | Add GModelSpectralNodes model |
| 352 | Correct Npred integration in GCTAModelRadialAcceptance | 366 | Correct Npred integration in GCTAModelRadialAcceptance |
| 353 | 367 | ||
| 354 | -2011-10-12 Juergen Knoedlseder <knodlseder@cesr.fr> | 368 | + |
| 369 | +2011-10-12 | ||
| 355 | 370 | ||
| 356 | * Version 0.4.12 released | 371 | * Version 0.4.12 released |
| 357 | ========================= | 372 | ========================= |
| @@ -359,7 +374,8 @@ | @@ -359,7 +374,8 @@ | ||
| 359 | Add missing #include <cstring> to GTools.cpp | 374 | Add missing #include <cstring> to GTools.cpp |
| 360 | Correct but in python interface for GSymMatrix and GSparseMatrix | 375 | Correct but in python interface for GSymMatrix and GSparseMatrix |
| 361 | 376 | ||
| 362 | -2011-10-03 Juergen Knoedlseder <knodlseder@cesr.fr> | 377 | + |
| 378 | +2011-10-03 | ||
| 363 | 379 | ||
| 364 | * Version 0.4.11 released | 380 | * Version 0.4.11 released |
| 365 | ========================= | 381 | ========================= |
| @@ -380,7 +396,8 @@ | @@ -380,7 +396,8 @@ | ||
| 380 | Replace FITS table column methods by access operators | 396 | Replace FITS table column methods by access operators |
| 381 | Fix bug in GSparseMatrix::cs_transpose | 397 | Fix bug in GSparseMatrix::cs_transpose |
| 382 | 398 | ||
| 383 | -2011-07-20 Juergen Knoedlseder <knodlseder@cesr.fr> | 399 | + |
| 400 | +2011-07-20 | ||
| 384 | 401 | ||
| 385 | * Version 0.4.10 released | 402 | * Version 0.4.10 released |
| 386 | ========================= | 403 | ========================= |
| @@ -388,7 +405,8 @@ | @@ -388,7 +405,8 @@ | ||
| 388 | Improve configuration script | 405 | Improve configuration script |
| 389 | Minor bug fixes | 406 | Minor bug fixes |
| 390 | 407 | ||
| 391 | -2011-07-09 Juergen Knoedlseder <knodlseder@cesr.fr> | 408 | + |
| 409 | +2011-07-09 | ||
| 392 | 410 | ||
| 393 | * Version 0.4.9 released | 411 | * Version 0.4.9 released |
| 394 | ======================== | 412 | ======================== |
| @@ -400,7 +418,8 @@ | @@ -400,7 +418,8 @@ | ||
| 400 | Add NaN/Inf check in various places (--enable-nan-check) | 418 | Add NaN/Inf check in various places (--enable-nan-check) |
| 401 | Test for presence of Python.h | 419 | Test for presence of Python.h |
| 402 | 420 | ||
| 403 | -2011-02-24 Juergen Knoedlseder <knodlseder@cesr.fr> | 421 | + |
| 422 | +2011-02-24 | ||
| 404 | 423 | ||
| 405 | * Version 0.4.7 released | 424 | * Version 0.4.7 released |
| 406 | ======================== | 425 | ======================== |
| @@ -408,7 +427,8 @@ | @@ -408,7 +427,8 @@ | ||
| 408 | Fix memory leaks in container classes handling pointers | 427 | Fix memory leaks in container classes handling pointers |
| 409 | Add more example scripts | 428 | Add more example scripts |
| 410 | 429 | ||
| 411 | -2011-02-21 Juergen Knoedlseder <knodlseder@cesr.fr> | 430 | + |
| 431 | +2011-02-21 | ||
| 412 | 432 | ||
| 413 | * Version 0.4.6 released | 433 | * Version 0.4.6 released |
| 414 | ======================== | 434 | ======================== |
| @@ -421,7 +441,8 @@ | @@ -421,7 +441,8 @@ | ||
| 421 | Add Doxygen and man support (make doxygen; make doxygen-install) | 441 | Add Doxygen and man support (make doxygen; make doxygen-install) |
| 422 | Add html documentation | 442 | Add html documentation |
| 423 | 443 | ||
| 424 | -2011-02-02 Juergen Knoedlseder <knodlseder@cesr.fr> | 444 | + |
| 445 | +2011-02-02 | ||
| 425 | 446 | ||
| 426 | * Version 0.4.5 released | 447 | * Version 0.4.5 released |
| 427 | ======================== | 448 | ======================== |
| @@ -433,7 +454,8 @@ | @@ -433,7 +454,8 @@ | ||
| 433 | Improve automatic configuration, remove autogen.sh | 454 | Improve automatic configuration, remove autogen.sh |
| 434 | Adapt for Solaris 2.10 | 455 | Adapt for Solaris 2.10 |
| 435 | 456 | ||
| 436 | -2011-01-06 Juergen Knoedlseder <knodlseder@cesr.fr> | 457 | + |
| 458 | +2011-01-06 | ||
| 437 | 459 | ||
| 438 | * Version 0.4.4 released | 460 | * Version 0.4.4 released |
| 439 | ======================== | 461 | ======================== |
| @@ -443,7 +465,8 @@ | @@ -443,7 +465,8 @@ | ||
| 443 | Correct some bugs and enhance some classes | 465 | Correct some bugs and enhance some classes |
| 444 | Correct and validate Fermi-LAT interface for binned analysis | 466 | Correct and validate Fermi-LAT interface for binned analysis |
| 445 | 467 | ||
| 446 | -2010-12-20 Juergen Knoedlseder <knodlseder@cesr.fr> | 468 | + |
| 469 | +2010-12-20 | ||
| 447 | 470 | ||
| 448 | * Version 0.4.3 released | 471 | * Version 0.4.3 released |
| 449 | ======================== | 472 | ======================== |
| @@ -453,7 +476,8 @@ | @@ -453,7 +476,8 @@ | ||
| 453 | Add more source models | 476 | Add more source models |
| 454 | First working Fermi-LAT interface for binned analysis | 477 | First working Fermi-LAT interface for binned analysis |
| 455 | 478 | ||
| 456 | -2010-11-23 Juergen Knoedlseder <knodlseder@cesr.fr> | 479 | + |
| 480 | +2010-11-23 | ||
| 457 | 481 | ||
| 458 | * Version 0.4.2 released | 482 | * Version 0.4.2 released |
| 459 | ======================== | 483 | ======================== |
| @@ -461,7 +485,8 @@ | @@ -461,7 +485,8 @@ | ||
| 461 | Tag sources with GammaLib-00-04-02 | 485 | Tag sources with GammaLib-00-04-02 |
| 462 | Enhance FITS interface | 486 | Enhance FITS interface |
| 463 | 487 | ||
| 464 | -2010-11-15 Juergen Knoedlseder <knodlseder@cesr.fr> | 488 | + |
| 489 | +2010-11-15 | ||
| 465 | 490 | ||
| 466 | * Version 0.4.1 released | 491 | * Version 0.4.1 released |
| 467 | ======================== | 492 | ======================== |
| @@ -471,14 +496,16 @@ | @@ -471,14 +496,16 @@ | ||
| 471 | Prototype implementation of application logger | 496 | Prototype implementation of application logger |
| 472 | Cleanup of FITS interface | 497 | Cleanup of FITS interface |
| 473 | 498 | ||
| 474 | -2010-06-11 Juergen Knoedlseder <knodlseder@cesr.fr> | 499 | + |
| 500 | +2010-06-11 | ||
| 475 | 501 | ||
| 476 | * Version 0.4.0 released | 502 | * Version 0.4.0 released |
| 477 | ======================== | 503 | ======================== |
| 478 | 504 | ||
| 479 | Tag sources with GammaLib-00-04-00 | 505 | Tag sources with GammaLib-00-04-00 |
| 480 | 506 | ||
| 481 | -2009-10-09 Juergen Knoedlseder <knodlseder@cesr.fr> | 507 | + |
| 508 | +2009-10-09 | ||
| 482 | 509 | ||
| 483 | * Version 0.2.0 released | 510 | * Version 0.2.0 released |
| 484 | ======================== | 511 | ======================== |
NEWS
| 1 | -New Features and Important Changes in GammaLib 1.1.0 | 1 | +New Features and Important Changes in GammaLib 1.2.0 |
| 2 | 2 | ||
| 3 | -Author(s) : Juergen Knoedlseder | ||
| 4 | - | ||
| 5 | -24 July 2016 | 3 | +28 July 2016 |
| 6 | 4 | ||
| 7 | 5 | ||
| 8 | 1. Introduction | 6 | 1. Introduction |
| @@ -14,151 +12,38 @@ made since the last release of GammaLib. | @@ -14,151 +12,38 @@ made since the last release of GammaLib. | ||
| 14 | 2. Public interface modifications | 12 | 2. Public interface modifications |
| 15 | --------------------------------- | 13 | --------------------------------- |
| 16 | The following classes have been added: | 14 | The following classes have been added: |
| 17 | -- GCTAPsfTable | ||
| 18 | -- GWcsSIN | 15 | +- GModelSpectralPlawEnergyFlux |
| 19 | 16 | ||
| 20 | The following classes have been removed: | 17 | The following classes have been removed: |
| 21 | -- GCTAOnOffObservations | ||
| 22 | - | ||
| 23 | -The following methods have been added to the public interface: | ||
| 24 | -- GApplication::logFileClose() | ||
| 25 | -- GObservation::events() (non-const variant) | ||
| 26 | -- GObservation::nobserved() | ||
| 27 | -- GObservations::nobserved() | ||
| 28 | -- GFilename::operator std::string() | ||
| 29 | -- GFilename::exists() | ||
| 30 | -- GFilename::is_fits() | ||
| 31 | -- GFilename::remove() | ||
| 32 | -- GFilaname::protocol() | ||
| 33 | -- GFilename::path() | ||
| 34 | -- GFilename::file() | ||
| 35 | -- GCsv::append() | ||
| 36 | -- GSkyMap::shape() | ||
| 37 | -- GSkyMap::ndim() | ||
| 38 | -- GModelSky::spatial() | ||
| 39 | -- GModelSky::spectral() | ||
| 40 | -- GModelSky::temporal() | ||
| 41 | -- GArf::columns() | ||
| 42 | -- GArf::at() | ||
| 43 | -- GArf::append() | ||
| 44 | -- GArf::operator()(int,int) | ||
| 45 | -- GArf::operator[](std::string) | ||
| 46 | -- GXmlDocument::filename() | ||
| 47 | -- GXmlNode::filename() | ||
| 48 | -- GXmlNode::parent() | ||
| 49 | -- GCTAObservation(GFilename) constructor | ||
| 50 | -- GCTAResponseTable::axis(std::string) | ||
| 51 | -- GCTAResponseTable::table(std::string) | ||
| 52 | -- GCTAResponseTable::has_axis(std::string) | ||
| 53 | -- GCTAResponseTable::has_table(std::string) | ||
| 54 | -- GCTAEventCube::weights() | ||
| 55 | -- GCTAEventBin::weight() | ||
| 56 | -- friend GTime operator+(const GTime& time, const double& seconds) | ||
| 57 | -- friend GTime operator+(const double& seconds, const GTime& time) | ||
| 58 | -- friend GTime operator-(const GTime& time, const double& seconds) | ||
| 59 | -- friend double operator-(const GTime& a, const GTime& b) | ||
| 60 | -- GTime::operator+=(const double& seconds) | ||
| 61 | -- GTime::operator-=(const double& seconds) | ||
| 62 | -- friend double operator/(const GEnergy& a, const GEnergy& b); | 18 | +- ... |
| 19 | + | ||
| 20 | +The following classes have been renamed: | ||
| 21 | +- GModelSpectralPlawPhotonFlux, was GModelSpectralPlaw2 | ||
| 22 | + | ||
| 23 | +The following methods have been added: | ||
| 24 | +- ... | ||
| 63 | 25 | ||
| 64 | The following methods have been removed: | 26 | The following methods have been removed: |
| 65 | -- GFilename::size() | ||
| 66 | -- gammalib::file_exists() | ||
| 67 | -- gammalib::file_exists_gzip() | ||
| 68 | -- gammalib::is_fits() | ||
| 69 | -- GTime::operator+=(const GTime& time) | ||
| 70 | -- GTime::operator-=(const GTime& time) | ||
| 71 | -- GTime::operator*=(const double& scale) | ||
| 72 | -- GTime::operator/=(const double& scale) | ||
| 73 | -- friend GTime operator+(const GTime &a, const GTime &b) | ||
| 74 | -- friend GTime operator-(const GTime &a, const GTime &b) | ||
| 75 | -- friend GTime operator* (const GTime &time, const double &s) | ||
| 76 | -- friend GTime operator*(const double &s, const GTime &time) | ||
| 77 | -- friend GTime operator*(const GTime &time, const double &s) | ||
| 78 | -- friend GTime operator/(const GTime &time, const double &s) | ||
| 79 | -- GXmlElement::parent() | ||
| 80 | -- GCTACubeExposure::elogmeans() | ||
| 81 | -- GCTACubePsf::elogmeans() | ||
| 82 | -- GCTACubeBackground::elogmeans() | 27 | +- ... |
| 83 | 28 | ||
| 84 | The following methods have been renamed: | 29 | The following methods have been renamed: |
| 85 | -- GCTAResponseTable::tables(), was GCTAResponseTable::size() | ||
| 86 | -- GCTAResponseTable::axis_bins(), was GCTAResponseTable::axis() | ||
| 87 | -- GFilename::is_empty(), was GFilename::empty() | ||
| 88 | -- GFilename::url(), was GFilename::filename() | ||
| 89 | -- GCTAEventCube::counts(), was GCTAEventCube::map() | ||
| 90 | -- GCTACubePsf::cube(), was GCTACubePsf::map() | ||
| 91 | -- GCTACubeEdisp::cube(), was GCTACubeEdisp::map() | ||
| 92 | - | ||
| 93 | -The following classes now use GFilename for filenames arguments instead | ||
| 94 | -of std::string: | ||
| 95 | -- GApplicationPar | ||
| 96 | -- GApplicationPars | ||
| 97 | -- GArf | ||
| 98 | -- GCsv | ||
| 99 | -- GEbounds | ||
| 100 | -- GEnergies | ||
| 101 | -- GEventCube, GCOMEventCube, GCTAEventCube, GLATEventCube, GMWLSpectrum | ||
| 102 | -- GEventList, GCTAEventList, GLATEventList | ||
| 103 | -- GEvents | ||
| 104 | -- GGti | ||
| 105 | -- GLog | ||
| 106 | -- GModelSpatialDiffuseCube | ||
| 107 | -- GModelSpatialDiffuseMap | ||
| 108 | -- GModelSpectralFunc | ||
| 109 | -- GModels | ||
| 110 | -- GNodeArray | ||
| 111 | -- GObservations | ||
| 112 | -- GPha | ||
| 113 | -- GRmf | ||
| 114 | -- GSkyMap | ||
| 115 | -- GSkyRegions | ||
| 116 | -- GTestSuites | ||
| 117 | -- GXml | ||
| 118 | -- GCTAAeff, GCTAAeff2D, GCTAAeffArf, GCTAAeffPerfTable | ||
| 119 | -- GCTABackground, GCTABackground3D, GCTABackgroundPerfTable | ||
| 120 | -- GCTACubeBackground, GCTACubeExposure, GCTACubePsf | ||
| 121 | -- GCTAEdisp, GCTAEdisp2D, GCTAEdispPerfTable, GCTAEdispRmf | ||
| 122 | -- GCTAObservation | ||
| 123 | -- GCTAOnOffObservations | ||
| 124 | -- GCTAPointing | ||
| 125 | -- GCTAPsf, GCTAPsf2D, GCTAPsfKing, GCTAPsfPerfTable, GCTAPsfVector | ||
| 126 | - | ||
| 127 | -The return value has been changed for the following methods: | ||
| 128 | -- GFits::filename() returns now GFilename instead of std::string | ||
| 129 | -- GCTAObservation::eventtype() returns now std::string instead of const std::string& | ||
| 130 | -- GCaldb::filename() returns now GFilename instead of std::string | ||
| 131 | - | ||
| 132 | -The interface for the following methods has been changed: | ||
| 133 | -- GFitsImage naxes constructor | ||
| 134 | -- GFitsImageByte naxes constructor | ||
| 135 | -- GFitsImageDouble naxes constructor | ||
| 136 | -- GFitsImageFloat naxes constructor | ||
| 137 | -- GFitsImageLong naxes constructor | ||
| 138 | -- GFitsImageLongLong naxes constructor | ||
| 139 | -- GFitsImageSByte naxes constructor | ||
| 140 | -- GFitsImageShort naxes constructor | ||
| 141 | -- GFitsImageULong naxes constructor | ||
| 142 | -- GFitsImageUShort naxes constructor | ||
| 143 | -- GSkyMap::save() | ||
| 144 | -- GModelSpectralRegistry::alloc() | ||
| 145 | -- GModelSpatialRegistry::alloc() | ||
| 146 | -- GModelTemporalRegistry::alloc() | 30 | +- GModelSpectralPlawPhotonFlux::flux(), was GModelSpectralPlaw2::integral() |
| 31 | + | ||
| 32 | +The parameters for the following methods have been changed: | ||
| 33 | +- ... | ||
| 34 | + | ||
| 35 | +The return value of the following methods has been changed: | ||
| 36 | +- ... | ||
| 147 | 37 | ||
| 148 | 38 | ||
| 149 | 3. Configuration | 39 | 3. Configuration |
| 150 | ----------------- | 40 | ----------------- |
| 151 | -The GammaLib package now supports out of source builds (#1484). | 41 | +None |
| 152 | 42 | ||
| 153 | 43 | ||
| 154 | 4. Application module | 44 | 4. Application module |
| 155 | --------------------- | 45 | --------------------- |
| 156 | -The GApplicationPar::filename() methods now take and return GFilename objects | ||
| 157 | -instead of std::string objects (#1671). | ||
| 158 | - | ||
| 159 | -A GApplication::logFileClose() method has been added to force writing the | ||
| 160 | -trailer and closing the log file. This is primarily useful for usage in | ||
| 161 | -Python where the desctructor is not always called. | 46 | +None |
| 162 | 47 | ||
| 163 | 48 | ||
| 164 | 5. Base module | 49 | 5. Base module |
| @@ -168,15 +53,7 @@ None | @@ -168,15 +53,7 @@ None | ||
| 168 | 53 | ||
| 169 | 6. FITS I/O Interface | 54 | 6. FITS I/O Interface |
| 170 | --------------------- | 55 | --------------------- |
| 171 | -The GFitsTableCol::insert() method did not work corretly for an empty column | ||
| 172 | -since it de-allocated memory without having necessarily memory on disk. This | ||
| 173 | -was corrected by allocating now memory after inserting elements into an empty | ||
| 174 | -FITS column. | ||
| 175 | - | ||
| 176 | -GFits now uses the GFilename class to store the FITS filename (fixes #1649). | ||
| 177 | - | ||
| 178 | -The GFitsImage naxes constructor now takes a std::vector as argument instead | ||
| 179 | -of a pointer to an array and a dimension (#1779). | 56 | +None |
| 180 | 57 | ||
| 181 | 58 | ||
| 182 | 7. Linear algebra module | 59 | 7. Linear algebra module |
| @@ -186,82 +63,11 @@ None | @@ -186,82 +63,11 @@ None | ||
| 186 | 63 | ||
| 187 | 8. Model module | 64 | 8. Model module |
| 188 | --------------- | 65 | --------------- |
| 189 | -Sky directions drawn by GModelSpatialDiffuseConst::mc() are now restricted | ||
| 190 | -to the simulation cone that has previously been defined using the mc_norm() | ||
| 191 | -method. This speeds up considerbly the Monte Carlo simulations for an | ||
| 192 | -isotropic diffuse model (#1674). | ||
| 193 | - | ||
| 194 | -The GModelSpectral eval() and eval_gradients() methods use an empty GTim() | ||
| 195 | -object as default time argument since all spectral models are so far time- | ||
| 196 | -independent. This avoids that a user needs to specify a dummy time argument | ||
| 197 | -(#1672). | ||
| 198 | - | ||
| 199 | -The set_mc_cone() methods of the GModelSpatialDiffuseCube class and the | ||
| 200 | -GModelSpatialDiffuseMap class now recompute only the Monte Carlo acceptance | ||
| 201 | -cone in case that the cone centre or radius have changed since the last | ||
| 202 | -computation. This speeds up the computations (#1673). | ||
| 203 | - | ||
| 204 | -The GModelSpatialDiffuseCube::mc() method now uses a rejection method for | ||
| 205 | -simulating sky directions, which makes the MC method identical to the model | ||
| 206 | -evaluation method, using in both cases a log-log interpolation. The simulation | ||
| 207 | -cone is now used for Monte Carlo simulations (#1722). | ||
| 208 | - | ||
| 209 | -Also the GModelSpatialDiffuseMap::mc() method now uses a rejection method for | ||
| 210 | -simulating sky directions (#1725). | ||
| 211 | - | ||
| 212 | -The methods spatial(), spectral() and temporal() have been added to GModelSky | ||
| 213 | -to allow setting of model components. | ||
| 214 | - | ||
| 215 | -Private methods GModel::read_attributes() and GModel::write_attributes() have | ||
| 216 | -been added to centralize the reading and writing of model attributes. These | ||
| 217 | -methods are now called at all relevant places, reducing code duplication and | ||
| 218 | -assuring that all attributes are correctly read by all classes and constructors | ||
| 219 | -(#1765). | ||
| 220 | - | ||
| 221 | -The GModelSpatialDiffuseMap, GModelSpatialDiffuseCube and GModelSpectralFunc | ||
| 222 | -class now support the specifications of file names that are relative to the | ||
| 223 | -XML file (#1808). | ||
| 224 | - | ||
| 225 | -The spatial model components have been renamed to enhance the readability and | ||
| 226 | -to make them more homogenous. The Fermi/LAT Science Tools should also evolve | ||
| 227 | -to support the new names: | ||
| 228 | -* "PointSource" (alias: "SkyDirFunction") | ||
| 229 | -* "RadialDisk" (alias: "DiskFunction") | ||
| 230 | -* "RadialGaussian" (alias: "GaussFunction") | ||
| 231 | -* "RadialShell" (alias: "ShellFunction") | ||
| 232 | -* "EllipticalDisk" | ||
| 233 | -* "EllipticalGaussian" (alias: "EllipticalGauss") | ||
| 234 | -* "DiffuseIsotropic" (alias: "ConstantValue") | ||
| 235 | -* "DiffuseMap" (alias: "SpatialMap") | ||
| 236 | -* "DiffuseMapCube" (alias: "MapCubeFunction") | ||
| 237 | -By default the old model names are still supported. Support of the old model | ||
| 238 | -names can be turned off by specifying the --disable-legacy-model-names option | ||
| 239 | -to the ./configure script (#1818). | ||
| 240 | - | ||
| 241 | -The model classes now write the same XML element names than those that were read | ||
| 242 | -in. In that way a maximum legacy for the Fermi/LAT data format is assured (#1820). | ||
| 243 | - | ||
| 244 | -The spectral registry class now also checks for model parameter names which allows | ||
| 245 | -to have models of the same type but with different parameters in the registry | ||
| 246 | -(#1824). The interface for the GModelSpectralRegistry::alloc() method has been | ||
| 247 | -changed so that it no longer takes a name string but an XML element. The same has | ||
| 248 | -been done for the GModelSpatialRegistry and GModelTemporalRegistry classes so that | ||
| 249 | -more general model definition XML file handling can be implemented. | ||
| 250 | - | ||
| 251 | -The names of some spectral model components have been modified to be more | ||
| 252 | -explicit and homogenous: | ||
| 253 | -* "Constant" (was "ConstantValue") | ||
| 254 | -* "PowerLaw" (combines "PowerLaw" and "PowerLaw2") | ||
| 255 | -* "BrokenPowerLaw" | ||
| 256 | -* "ExponentialCutoffPowerLaw" (was "ExpCutoff") | ||
| 257 | -* "SuperExponentialCutoffPowerLaw" (was "PLSuperExpCutoff") | ||
| 258 | -* "Gaussian" | ||
| 259 | -* "LogParabola" | ||
| 260 | -* "FileFunction" | ||
| 261 | -* "NodeFunction" | ||
| 262 | -By default the old model names are still supported. Support of the old model | ||
| 263 | -names can be turned off by specifying the --disable-legacy-model-names option | ||
| 264 | -to the ./configure script (#1821). | 66 | +The GModelSpectralPlaw2 class has been renamed to GModelSpectralPlawPhotonFlux |
| 67 | +and the integral() methods were renamed to flux(). A new class | ||
| 68 | +GModelSpectralPlawEnergyFlux has been added that handles integral energy | ||
| 69 | +fluxes as opposed to GModelSpectralPlawPhotonFlux that handles integral | ||
| 70 | +photon fluxes. Unit tests have been added for the new class (#1790). | ||
| 265 | 71 | ||
| 266 | 72 | ||
| 267 | 9. Numerics module | 73 | 9. Numerics module |
| @@ -271,29 +77,7 @@ None | @@ -271,29 +77,7 @@ None | ||
| 271 | 77 | ||
| 272 | 10. Observation module | 78 | 10. Observation module |
| 273 | ---------------------- | 79 | ---------------------- |
| 274 | -A non-const GObservation::events() method has been added to allow for | ||
| 275 | -the manipulation of events within an observation without the need to | ||
| 276 | -create a local copy. | ||
| 277 | - | ||
| 278 | -The argument of GObservation::deadc(GTime) now defaults to GTime() so | ||
| 279 | -that no argument is needed when calling the method. This reflects the | ||
| 280 | -fact that the deadtime correction is often computed as an average value | ||
| 281 | -over the observation, and does in fact not depend on time (#1670). | ||
| 282 | - | ||
| 283 | -The GTime operators have been revised as time is implemented as an | ||
| 284 | -absolute quantity, while addition and subtraction of GTime objects are | ||
| 285 | -relative operations. The GTime arguments of the operators have thus be | ||
| 286 | -replaced by double precision values that specify relative time in seconds. | ||
| 287 | -The multiplication and division operators have been removed (#1714). | ||
| 288 | - | ||
| 289 | -The GObservations::nobserved() method has been added that returns the | ||
| 290 | -total number of events in an observation container. The method is used | ||
| 291 | -by the print() method. The method uses the GObservation::nobserved() | ||
| 292 | -method that have also been added to determine for each observation | ||
| 293 | -the number of observed events (#1723). | ||
| 294 | - | ||
| 295 | -A division operator has been added to the GEnergy method to compute the | ||
| 296 | -ratio of two energies. | 80 | +None |
| 297 | 81 | ||
| 298 | 82 | ||
| 299 | 11. Optimization module | 83 | 11. Optimization module |
| @@ -303,90 +87,32 @@ None | @@ -303,90 +87,32 @@ None | ||
| 303 | 87 | ||
| 304 | 12. Sky module | 88 | 12. Sky module |
| 305 | -------------- | 89 | -------------- |
| 306 | -The GSkyMap load() and save() methods now support the handling of FITS | ||
| 307 | -extension names. Users can now specify with which extension name a sky | ||
| 308 | -map is written to a FITS file, and from which extension name it should | ||
| 309 | -be loaded. This allows to have multiple sky maps in the same file, and | ||
| 310 | -to mix also HEALPix and WCS maps in the same file (#1695). | ||
| 311 | - | ||
| 312 | -A GSkyMap::publish() method has been added that publishes the sky map | ||
| 313 | -on a Virtual Observatory Hub. This finally makes GammaLib interoperable | ||
| 314 | -with VO imaging tools (#1231). | ||
| 315 | - | ||
| 316 | -A shape member was added to the GSkyMap class to enable handling of | ||
| 317 | -images with more than 3 dimensions. The shape() methods set or retrieve | ||
| 318 | -the number of maps in each of the dimensions, the ndim() method returns | ||
| 319 | -the number of dimensions. Note that a longitude and latitude dimensions | ||
| 320 | -are not counted in the map dimensions, i.e. a 3D image cube with | ||
| 321 | -longitude, latitude and a number of maps has a dimension of 1 (#1733). | ||
| 322 | - | ||
| 323 | -An optional extname argument has been added to the GSkyMap::save() method | ||
| 324 | -so that the extension name can be set (#1787). | ||
| 325 | - | ||
| 326 | -The Orthographic/synthesis (SIN) projection has been added to the WCS | ||
| 327 | -projections (#1798). | 90 | +None |
| 328 | 91 | ||
| 329 | 92 | ||
| 330 | 13. Support module | 93 | 13. Support module |
| 331 | ------------------ | 94 | ------------------ |
| 332 | -The GFilename class has been extended and some methods have been renamed. | ||
| 333 | -The full filename including and FITS extension is now returned by an | ||
| 334 | -implicit type conversion operator std::string(). The filename() method has | ||
| 335 | -been renamed to url(), and the methods exists(), is_fits() and remove() | ||
| 336 | -have been added to replace functions of the GTools module that were used | ||
| 337 | -for this purpose in the past. Furthermore, the method protocol() returns | ||
| 338 | -the access protocol (e.g. http, ftp, file) of the file name, the method | ||
| 339 | -path() returns the path of th file name, and the method file() returns the | ||
| 340 | -file name without the path. | ||
| 341 | - | ||
| 342 | -Put FITS access in a critical OMP zone to make GFilename::is_fits() thread | ||
| 343 | -safe (#1717). | ||
| 344 | - | ||
| 345 | -The gammalib::number() function was added to convert a singular noun into | ||
| 346 | -a plural noun is the number of instances of the noun is not one (#1743). | ||
| 347 | - | ||
| 348 | -The GCsv::append() method appends a list of strings to a CSV file. This allow | ||
| 349 | -easy creation of a CSV file, in particular from Python lists (#1773). | 95 | +None |
| 350 | 96 | ||
| 351 | 97 | ||
| 352 | 14. XML module | 98 | 14. XML module |
| 353 | -------------- | 99 | -------------- |
| 354 | -The GXmlAttribute class does no longer store the hyphens of an attribute, but | ||
| 355 | -the hyphens are stripped upon construction, and added back when writing the | ||
| 356 | -attribute into a URL. The side effect of this new behaviour is that XML test | ||
| 357 | -reports are also written in case that an exception has occured during a unit | ||
| 358 | -test (#1746). | ||
| 359 | - | ||
| 360 | -The node parent attribute has been move from the GXmlElement class to the | ||
| 361 | -GXmlNode class, the parent() access methods have also been moved to GXmlNode. | ||
| 362 | -A filename() method has been added to the GXmlNode and GXmlDocument classes | ||
| 363 | -that enables accessing the file name of the XML file from a GXmlNode object. | ||
| 364 | -The method walks up the parents until the root node is found, and it gets the | ||
| 365 | -file name from the root node (#1808). | 100 | +None |
| 366 | 101 | ||
| 367 | 102 | ||
| 368 | 15. VO module | 103 | 15. VO module |
| 369 | ------------- | 104 | ------------- |
| 370 | -A GVOClient::publish() method was added that allows publishing of a FITS | ||
| 371 | -image to the Hub. The FITS image will be saved into a temporary storage | ||
| 372 | -location and the Hub will be informed that an image is available. | 105 | +None |
| 373 | 106 | ||
| 374 | 107 | ||
| 375 | 16. Xspec module | 108 | 16. Xspec module |
| 376 | ---------------- | 109 | ---------------- |
| 377 | -The GArf class now also handles additional double precision columns that may | ||
| 378 | -be needed for response computation. | 110 | +None |
| 379 | 111 | ||
| 380 | 112 | ||
| 381 | 17. Test module | 113 | 17. Test module |
| 382 | --------------- | 114 | --------------- |
| 383 | -A GTestSuite::test_value() method has been added for strings to simplify the | ||
| 384 | -writing of test cases for string comparison (#1772). | ||
| 385 | - | ||
| 386 | -The Python interface for handling of SWIG exceptions is now also compatible | ||
| 387 | -with Python 3, hence there should be no longer "basic_string ::_S_construct | ||
| 388 | -null not valid" messages when errors occur in the SWIG interface under | ||
| 389 | -Python 3. | 115 | +None |
| 390 | 116 | ||
| 391 | 117 | ||
| 392 | 18. Multi-wavelength interface | 118 | 18. Multi-wavelength interface |
| @@ -396,104 +122,12 @@ None | @@ -396,104 +122,12 @@ None | ||
| 396 | 122 | ||
| 397 | 19. Fermi-LAT interface | 123 | 19. Fermi-LAT interface |
| 398 | ---------------------- | 124 | ---------------------- |
| 399 | -Pass 8 response function and data are now supported. The LAT module has been | ||
| 400 | -adapted so that event types can be handled. Note that the fisheye effect is | ||
| 401 | -not taken into account (#1517). | 125 | +None |
| 402 | 126 | ||
| 403 | 127 | ||
| 404 | 20. CTA interface | 128 | 20. CTA interface |
| 405 | ----------------- | 129 | ----------------- |
| 406 | -The response table instrument response functions now rely on the FITS table | ||
| 407 | -column names to determine the information instead of hard-wired column indices | ||
| 408 | -(#1656). | ||
| 409 | - | ||
| 410 | -Event fetching and disposal has been implemented in the GCTAEventList class by | ||
| 411 | -additing the fetch() and dispose() methods. Now, events are only loaded upon | ||
| 412 | -request and can be dispatched after user to save memory. The event fetching and | ||
| 413 | -disposal logic has been removed from GCTAObservation (#1648). | ||
| 414 | - | ||
| 415 | -Add GCTAEventList::remove() method to remove events from an event list. | ||
| 416 | - | ||
| 417 | -The GCTAEventList::append() method now also appends empty elements to the | ||
| 418 | -additional columns so that all event list columns have finally the same length. | ||
| 419 | - | ||
| 420 | -The GCTAEdisp2D::compute_ebounds_obs() and GCTAEdisp2::compute_ebounds_src() | ||
| 421 | -methods have been corrected so that they return the energy intervals covered by | ||
| 422 | -valid matrix elements. With the code before there were problems with not setting | ||
| 423 | -correctly the maximum energies of the intervals (#1662). | ||
| 424 | - | ||
| 425 | -The extension name for the GTI HDU is now determined from the data sub-space | ||
| 426 | -keyword provided in the events FITS file header. This allows to have multiple | ||
| 427 | -GTIs (and also event lists) in a single FITS file. We do however require that | ||
| 428 | -the event and GTI extension reside in the same FITS file. The name of the GTI | ||
| 429 | -extension can be recovered using the GCTAEventList::gtiname() method. This | ||
| 430 | -satisfies the feature request #1598. | ||
| 431 | - | ||
| 432 | -A second variant of a write() method has been added to GCTAEventList that allows | ||
| 433 | -specifying the events and Good Time Intervals FITS extension names. The standard | ||
| 434 | -write() method will call this new write() method using the events extension name | ||
| 435 | -extracted from the file name and the GTI extension name set by the m_gti_extname | ||
| 436 | -member. The GCTAObservation::write() method was also extended and now has two | ||
| 437 | -optional arguments that allow specifying the events and Good Time Interval FITS | ||
| 438 | -extension names. These are simply forwared to the new GCTAEventList::write(). | ||
| 439 | -The GCTAObservation::save() method has now a special logic that decodes any | ||
| 440 | -optionally specified extension in the format [EVENTS;GTI] into an events and a | ||
| 441 | -Good Time Intervals extension name. These changes satisfy the feature request | ||
| 442 | -#1598. | ||
| 443 | - | ||
| 444 | -A rejection method is now used in GCTABackground3D::mc() to assure that the Monte | ||
| 445 | -Carlo simulated instrument directions are identical to the model evaluations | ||
| 446 | -(#1722). | ||
| 447 | - | ||
| 448 | -Add GCTACubeEdisp class that computes the mean energy dispersion for a stacked | ||
| 449 | -analysis. This class is now used in GCTAResponseCube to take into account the | ||
| 450 | -energy dispersion is a stacked analysis (#1721, #1801). | ||
| 451 | - | ||
| 452 | -A filename constructor has been added to GCTAObservation that allows constructing | ||
| 453 | -a CTA observation from an event list or a counts cube. A dummy argument has been | ||
| 454 | -added to the instrument constructor so that it does not conflict with the filename | ||
| 455 | -constructor (#1744). | ||
| 456 | - | ||
| 457 | -The interpolation scheme was changed in GCTABackground3D. Formerly, if one of the | ||
| 458 | -rates above and below the requested energy was zero, the rate from the non-zero | ||
| 459 | -node was taken, resulting in a discontinuity. Now the rate is set to zero. | ||
| 460 | - | ||
| 461 | -The classes GCTACubePsf and GCTACubeEdisp now save the information in 4D images | ||
| 462 | -instead of folding two dimension in a single dimension of a 3D image. | ||
| 463 | - | ||
| 464 | -The GCTAOnOffObservations container class has now been removed, as On/Off observations | ||
| 465 | -are now stored as any other observation in the GObservations container (#1669). | ||
| 466 | - | ||
| 467 | -The On/Off fitting of CTA data has now been implemented (#1044). | ||
| 468 | - | ||
| 469 | -The GCTAPsfTable class has been added to support non-parametric point spread function | ||
| 470 | -histograms (#1786). | ||
| 471 | - | ||
| 472 | -The classes GCTACubeExposure, GCTACubePsf and GCTACubeBackground store response values | ||
| 473 | -for given sets of energies, and now the energies are written into the FITS files instead | ||
| 474 | -of the energy boundaries enclosing these energies. This provides a more explicit storage | ||
| 475 | -of the response information, as before the energies had to be inferred from the energy | ||
| 476 | -boundaries of the bins (#1788). | ||
| 477 | - | ||
| 478 | -The GCTACubeExposure::elogmeans(), GCTACubePsf::elogmeans(), and GCTACubeBackground::elogmeans() | ||
| 479 | -methods have been removed as the energies() methods provide now essentially the same | ||
| 480 | -information. | ||
| 481 | - | ||
| 482 | -A weight sky map has been added to the CTA event cube, and the weight of each bin is | ||
| 483 | -multiplied to the bin size in the GCTAEventBin::size() method so that model values are | ||
| 484 | -weigthed according to the bin weight. This enables the usage of only partially covered | ||
| 485 | -bins, arising for example from different energy thresholds or ROIs (#1789). | ||
| 486 | - | ||
| 487 | -The cube response classes GCTACubeExposure, GCTACubePsf, GCTACubeEdisp and | ||
| 488 | -GCTACubeBackground do no longer select on RoI and energy boundaries as this is now | ||
| 489 | -handled by the weight array (#1789). | ||
| 490 | - | ||
| 491 | -The GCTAAeff2D class no longer extrapolates the effective area beyond the boundaries | ||
| 492 | -of the response table, but sets the effective area values to zero (#1784). | ||
| 493 | - | ||
| 494 | -The GCTABackground3D class now assures that the mc() method covers the same DETX and DETY | ||
| 495 | -range than the access operator. This fixes a consistency problem between Monte Carlo | ||
| 496 | -sampling and function evaluation (#1815). | 130 | +None |
| 497 | 131 | ||
| 498 | 132 | ||
| 499 | 21. COMPTEL interface | 133 | 21. COMPTEL interface |
README.md
| 1 | GammaLib information | 1 | GammaLib information |
| 2 | ==================== | 2 | ==================== |
| 3 | -* Version: 1.2.0.dev1 (24 July 2016) | 3 | +* Version: 1.2.0.dev1 (28 July 2016) |
| 4 | * Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu) | 4 | * Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu) |
| 5 | 5 | ||
| 6 | [](https://cta-jenkins.irap.omp.eu/job/gammalib-integrate-os/) | 6 | [](https://cta-jenkins.irap.omp.eu/job/gammalib-integrate-os/) |
doc/source/users/user_manual/modules/model.rst
| @@ -445,17 +445,17 @@ format: | @@ -445,17 +445,17 @@ format: | ||
| 445 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> | 445 | <parameter name="Scale" scale="1e6" value="0.3" min="0.01" max="1000.0" free="0"/> |
| 446 | </spectrum> | 446 | </spectrum> |
| 447 | 447 | ||
| 448 | -An alternative power law function is defined by the :doxy:`GModelSpectralPlawPhotonFlux` | ||
| 449 | -class that uses the integral photon flux as parameter rather than the | ||
| 450 | -Prefactor: | 448 | +An alternative power law function is defined by the |
| 449 | +:doxy:`GModelSpectralPlawPhotonFlux` class that uses the integral photon flux | ||
| 450 | +as parameter rather than the ``Prefactor``: | ||
| 451 | 451 | ||
| 452 | .. math:: | 452 | .. math:: |
| 453 | - \frac{dN}{dE} = \frac{F_{\rm Ph}(\gamma+1)E^{\gamma}} | 453 | + \frac{dN}{dE} = \frac{F_{\rm ph}(\gamma+1)E^{\gamma}} |
| 454 | {E_{\rm max}^{\gamma+1} - E_{\rm min}^{\gamma+1}} | 454 | {E_{\rm max}^{\gamma+1} - E_{\rm min}^{\gamma+1}} |
| 455 | 455 | ||
| 456 | where the parameters in the XML definition have the following mappings: | 456 | where the parameters in the XML definition have the following mappings: |
| 457 | 457 | ||
| 458 | -* :math:`F_{\rm Ph}` = ``PhotonFlux`` | 458 | +* :math:`F_{\rm ph}` = ``PhotonFlux`` |
| 459 | * :math:`\gamma` = ``Index`` | 459 | * :math:`\gamma` = ``Index`` |
| 460 | * :math:`E_{\rm min}` = ``LowerLimit`` | 460 | * :math:`E_{\rm min}` = ``LowerLimit`` |
| 461 | * :math:`E_{\rm max}` = ``UpperLimit`` | 461 | * :math:`E_{\rm max}` = ``UpperLimit`` |
| @@ -466,9 +466,9 @@ is: | @@ -466,9 +466,9 @@ is: | ||
| 466 | .. code-block:: xml | 466 | .. code-block:: xml |
| 467 | 467 | ||
| 468 | <spectrum type="PowerLaw"> | 468 | <spectrum type="PowerLaw"> |
| 469 | - <parameter scale="1e-07" name="PhotonFlux" min="1e-07" max="1000.0" value="1.0" free="1"/> | ||
| 470 | - <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.0" free="1"/> | ||
| 471 | - <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> | 469 | + <parameter scale="1e-07" name="PhotonFlux" min="1e-07" max="1000.0" value="1.0" free="1"/> |
| 470 | + <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.0" free="1"/> | ||
| 471 | + <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> | ||
| 472 | <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> | 472 | <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> |
| 473 | </spectrum> | 473 | </spectrum> |
| 474 | 474 | ||
| @@ -478,24 +478,24 @@ format: | @@ -478,24 +478,24 @@ format: | ||
| 478 | .. code-block:: xml | 478 | .. code-block:: xml |
| 479 | 479 | ||
| 480 | <spectrum type="PowerLaw2"> | 480 | <spectrum type="PowerLaw2"> |
| 481 | - <parameter scale="1e-07" name="Intergal" min="1e-07" max="1000.0" value="1.0" free="1"/> | ||
| 482 | - <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.0" free="1"/> | ||
| 483 | - <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> | 481 | + <parameter scale="1e-07" name="Intergal" min="1e-07" max="1000.0" value="1.0" free="1"/> |
| 482 | + <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.0" free="1"/> | ||
| 483 | + <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> | ||
| 484 | <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> | 484 | <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> |
| 485 | </spectrum> | 485 | </spectrum> |
| 486 | 486 | ||
| 487 | .. note:: | 487 | .. note:: |
| 488 | 488 | ||
| 489 | - The UpperLimit and LowerLimit parameters are always treated as fixed and, | ||
| 490 | - as should be apparent from this definition, the flux given by the PhotonFlux | ||
| 491 | - parameter is over the range (LowerLimit, UpperLimit). Use of this model | ||
| 492 | - allows the errors on the integrated photon flux to be evaluated directly by | ||
| 493 | - likelihood, obviating the need to propagate the errors if one is using | ||
| 494 | - the PowerLaw form. | 489 | + The ``UpperLimit`` and ``LowerLimit`` parameters are always treated as fixed |
| 490 | + and, as should be apparent from this definition, the flux given by the | ||
| 491 | + ``PhotonFlux`` parameter is over the range [``LowerLimit``, ``UpperLimit``]. | ||
| 492 | + Use of this model allows the errors on the integrated photon flux to be | ||
| 493 | + evaluated directly by likelihood, obviating the need to propagate the errors | ||
| 494 | + if one is using the PowerLaw form. | ||
| 495 | 495 | ||
| 496 | -Another alternative power law function is defined by the :doxy:`GModelSpectralPlawEnergyFlux` | ||
| 497 | -class that uses the integral energy flux as parameter rather than the | ||
| 498 | -Prefactor: | 496 | +Another alternative power law function is defined by the |
| 497 | +:doxy:`GModelSpectralPlawEnergyFlux` class that uses the integral energy flux | ||
| 498 | +as parameter rather than the ``Prefactor``: | ||
| 499 | 499 | ||
| 500 | .. math:: | 500 | .. math:: |
| 501 | \frac{dN}{dE} = \frac{F_{\rm E}(\gamma+2)E^{\gamma}} | 501 | \frac{dN}{dE} = \frac{F_{\rm E}(\gamma+2)E^{\gamma}} |
| @@ -514,20 +514,21 @@ is: | @@ -514,20 +514,21 @@ is: | ||
| 514 | .. code-block:: xml | 514 | .. code-block:: xml |
| 515 | 515 | ||
| 516 | <spectrum type="PowerLaw"> | 516 | <spectrum type="PowerLaw"> |
| 517 | - <parameter scale="1e-07" name="EnergyFlux" min="1e-07" max="1000.0" value="1.0" free="1"/> | ||
| 518 | - <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.0" free="1"/> | ||
| 519 | - <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> | 517 | + <parameter scale="1e-07" name="EnergyFlux" min="1e-07" max="1000.0" value="1.0" free="1"/> |
| 518 | + <parameter scale="1.0" name="Index" min="-5.0" max="+5.0" value="-2.0" free="1"/> | ||
| 519 | + <parameter scale="1.0" name="LowerLimit" min="10.0" max="1000000.0" value="100.0" free="0"/> | ||
| 520 | <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> | 520 | <parameter scale="1.0" name="UpperLimit" min="10.0" max="1000000.0" value="500000.0" free="0"/> |
| 521 | </spectrum> | 521 | </spectrum> |
| 522 | 522 | ||
| 523 | .. note:: | 523 | .. note:: |
| 524 | 524 | ||
| 525 | - The UpperLimit and LowerLimit parameters are always treated as fixed and, | ||
| 526 | - as should be apparent from this definition, the flux given by the EnergyFlux | ||
| 527 | - parameter is over the range (LowerLimit, UpperLimit). Use of this model | ||
| 528 | - allows the errors on the integrated energy flux to be evaluated directly by | ||
| 529 | - likelihood, obviating the need to propagate the errors if one is using | ||
| 530 | - the PowerLaw form. | 525 | + The ``UpperLimit`` and ``LowerLimit`` parameters are always treated as fixed |
| 526 | + and, as should be apparent from this definition, the flux given by the | ||
| 527 | + ``EnergyFlux`` parameter is over the range [``LowerLimit``, ``UpperLimit``]. | ||
| 528 | + Use of this model allows the errors on the integrated energy flux to be | ||
| 529 | + evaluated directly by likelihood, obviating the need to propagate the errors | ||
| 530 | + if one is using the PowerLaw form. | ||
| 531 | + | ||
| 531 | 532 | ||
| 532 | Exponentially cut-off power law | 533 | Exponentially cut-off power law |
| 533 | =============================== | 534 | =============================== |
include/GModelSpectralPlawEnergyFlux.hpp
| @@ -47,7 +47,7 @@ class GXmlElement; | @@ -47,7 +47,7 @@ class GXmlElement; | ||
| 47 | * This class implements a power law spectrum. The model is defined by | 47 | * This class implements a power law spectrum. The model is defined by |
| 48 | * | 48 | * |
| 49 | * \f[ | 49 | * \f[ |
| 50 | - * S_{\rm E}(E | t) = {\tt m\_energy\_flux} | 50 | + * S_{\rm E}(E | t) = {\tt m\_eflux} |
| 51 | * \frac{{\tt m\_index}+1} | 51 | * \frac{{\tt m\_index}+1} |
| 52 | * {{\tt e\_max}^{{\tt m\_index}+2} - | 52 | * {{\tt e\_max}^{{\tt m\_index}+2} - |
| 53 | * {\tt e\_min}^{{\tt m\_index}+2}} | 53 | * {\tt e\_min}^{{\tt m\_index}+2}} |
| @@ -58,7 +58,7 @@ class GXmlElement; | @@ -58,7 +58,7 @@ class GXmlElement; | ||
| 58 | * | 58 | * |
| 59 | * \f[ | 59 | * \f[ |
| 60 | * S_{\rm E}(E | t) = | 60 | * S_{\rm E}(E | t) = |
| 61 | - * \frac{{\tt m\_energy\_flux}} | 61 | + * \frac{{\tt m\_eflux}} |
| 62 | * {\log {\tt e\_max} - \log {\tt e\_min}} | 62 | * {\log {\tt e\_max} - \log {\tt e\_min}} |
| 63 | * E^{\tt m\_index} | 63 | * E^{\tt m\_index} |
| 64 | * \f] | 64 | * \f] |
| @@ -66,7 +66,7 @@ class GXmlElement; | @@ -66,7 +66,7 @@ class GXmlElement; | ||
| 66 | * for \f${\tt m\_index} = -2\f$, where | 66 | * for \f${\tt m\_index} = -2\f$, where |
| 67 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, | 67 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, |
| 68 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, | 68 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, |
| 69 | - * - \f${\tt m\_energy\_flux}\f$ is the energy flux between | 69 | + * - \f${\tt m\_eflux}\f$ is the energy flux between |
| 70 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and | 70 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and |
| 71 | * - \f${\tt m\_index}\f$ is the spectral index. | 71 | * - \f${\tt m\_index}\f$ is the spectral index. |
| 72 | ***************************************************************************/ | 72 | ***************************************************************************/ |
| @@ -76,14 +76,14 @@ public: | @@ -76,14 +76,14 @@ public: | ||
| 76 | // Constructors and destructors | 76 | // Constructors and destructors |
| 77 | GModelSpectralPlawEnergyFlux(void); | 77 | GModelSpectralPlawEnergyFlux(void); |
| 78 | GModelSpectralPlawEnergyFlux(const std::string& type, | 78 | GModelSpectralPlawEnergyFlux(const std::string& type, |
| 79 | - const std::string& energy_flux, | ||
| 80 | - const std::string& index, | ||
| 81 | - const std::string& emin, | ||
| 82 | - const std::string& emax); | 79 | + const std::string& eflux, |
| 80 | + const std::string& index, | ||
| 81 | + const std::string& emin, | ||
| 82 | + const std::string& emax); | ||
| 83 | explicit GModelSpectralPlawEnergyFlux(const double& eflux, | 83 | explicit GModelSpectralPlawEnergyFlux(const double& eflux, |
| 84 | - const double& index, | ||
| 85 | - const GEnergy& emin, | ||
| 86 | - const GEnergy& emax); | 84 | + const double& index, |
| 85 | + const GEnergy& emin, | ||
| 86 | + const GEnergy& emax); | ||
| 87 | explicit GModelSpectralPlawEnergyFlux(const GXmlElement& xml); | 87 | explicit GModelSpectralPlawEnergyFlux(const GXmlElement& xml); |
| 88 | GModelSpectralPlawEnergyFlux(const GModelSpectralPlawEnergyFlux& model); | 88 | GModelSpectralPlawEnergyFlux(const GModelSpectralPlawEnergyFlux& model); |
| 89 | virtual ~GModelSpectralPlawEnergyFlux(void); | 89 | virtual ~GModelSpectralPlawEnergyFlux(void); |
| @@ -92,29 +92,29 @@ public: | @@ -92,29 +92,29 @@ public: | ||
| 92 | virtual GModelSpectralPlawEnergyFlux& operator=(const GModelSpectralPlawEnergyFlux& model); | 92 | virtual GModelSpectralPlawEnergyFlux& operator=(const GModelSpectralPlawEnergyFlux& model); |
| 93 | 93 | ||
| 94 | // Implemented pure virtual base class methods | 94 | // Implemented pure virtual base class methods |
| 95 | - virtual void clear(void); | 95 | + virtual void clear(void); |
| 96 | virtual GModelSpectralPlawEnergyFlux* clone(void) const; | 96 | virtual GModelSpectralPlawEnergyFlux* clone(void) const; |
| 97 | - virtual std::string classname(void) const; | ||
| 98 | - virtual std::string type(void) const; | ||
| 99 | - virtual double eval(const GEnergy& srcEng, | ||
| 100 | - const GTime& srcTime = GTime()) const; | ||
| 101 | - virtual double eval_gradients(const GEnergy& srcEng, | ||
| 102 | - const GTime& srcTime = GTime()); | ||
| 103 | - virtual double flux(const GEnergy& emin, | ||
| 104 | - const GEnergy& emax) const; | ||
| 105 | - virtual double eflux(const GEnergy& emin, | ||
| 106 | - const GEnergy& emax) const; | ||
| 107 | - virtual GEnergy mc(const GEnergy& emin, | ||
| 108 | - const GEnergy& emax, | ||
| 109 | - const GTime& time, | ||
| 110 | - GRan& ran) const; | ||
| 111 | - virtual void read(const GXmlElement& xml); | ||
| 112 | - virtual void write(GXmlElement& xml) const; | ||
| 113 | - virtual std::string print(const GChatter& chatter = NORMAL) const; | 97 | + virtual std::string classname(void) const; |
| 98 | + virtual std::string type(void) const; | ||
| 99 | + virtual double eval(const GEnergy& srcEng, | ||
| 100 | + const GTime& srcTime = GTime()) const; | ||
| 101 | + virtual double eval_gradients(const GEnergy& srcEng, | ||
| 102 | + const GTime& srcTime = GTime()); | ||
| 103 | + virtual double flux(const GEnergy& emin, | ||
| 104 | + const GEnergy& emax) const; | ||
| 105 | + virtual double eflux(const GEnergy& emin, | ||
| 106 | + const GEnergy& emax) const; | ||
| 107 | + virtual GEnergy mc(const GEnergy& emin, | ||
| 108 | + const GEnergy& emax, | ||
| 109 | + const GTime& time, | ||
| 110 | + GRan& ran) const; | ||
| 111 | + virtual void read(const GXmlElement& xml); | ||
| 112 | + virtual void write(GXmlElement& xml) const; | ||
| 113 | + virtual std::string print(const GChatter& chatter = NORMAL) const; | ||
| 114 | 114 | ||
| 115 | // Other methods | 115 | // Other methods |
| 116 | - double energy_flux(void) const; | ||
| 117 | - void energy_flux(const double& energy_flux); | 116 | + double eflux(void) const; |
| 117 | + void eflux(const double& eflux); | ||
| 118 | double index(void) const; | 118 | double index(void) const; |
| 119 | void index(const double& index); | 119 | void index(const double& index); |
| 120 | GEnergy emin(void) const; | 120 | GEnergy emin(void) const; |
| @@ -131,7 +131,7 @@ protected: | @@ -131,7 +131,7 @@ protected: | ||
| 131 | 131 | ||
| 132 | // Protected members | 132 | // Protected members |
| 133 | std::string m_type; //!< Model type | 133 | std::string m_type; //!< Model type |
| 134 | - GModelPar m_energy_flux; //!< Energy flux | 134 | + GModelPar m_eflux; //!< Energy flux (erg/cm2/s) |
| 135 | GModelPar m_index; //!< Spectral index | 135 | GModelPar m_index; //!< Spectral index |
| 136 | GModelPar m_emin; //!< Lower energy limit (MeV) | 136 | GModelPar m_emin; //!< Lower energy limit (MeV) |
| 137 | GModelPar m_emax; //!< Upper energy limit (MeV) | 137 | GModelPar m_emax; //!< Upper energy limit (MeV) |
| @@ -144,14 +144,10 @@ protected: | @@ -144,14 +144,10 @@ protected: | ||
| 144 | mutable double m_norm; //!< Power-law normalization (for pivot energy 1 MeV) | 144 | mutable double m_norm; //!< Power-law normalization (for pivot energy 1 MeV) |
| 145 | mutable double m_g_norm; //!< Power-law normalization gradient | 145 | mutable double m_g_norm; //!< Power-law normalization gradient |
| 146 | mutable double m_power; //!< Power-law factor | 146 | mutable double m_power; //!< Power-law factor |
| 147 | - mutable double m_last_phflux; //!< Last energy flux | ||
| 148 | mutable double m_last_index; //!< Last spectral index (MeV) | 147 | mutable double m_last_index; //!< Last spectral index (MeV) |
| 149 | mutable GEnergy m_last_emin; //!< Last lower energy limit | 148 | mutable GEnergy m_last_emin; //!< Last lower energy limit |
| 150 | mutable GEnergy m_last_emax; //!< Last upper energy limit | 149 | mutable GEnergy m_last_emax; //!< Last upper energy limit |
| 151 | mutable GEnergy m_last_energy; //!< Last source energy | 150 | mutable GEnergy m_last_energy; //!< Last source energy |
| 152 | - mutable double m_last_value; //!< Last function value | ||
| 153 | - mutable double m_last_g_phflux; //!< Last energy flux gradient | ||
| 154 | - mutable double m_last_g_index; //!< Last spectral index gradient | ||
| 155 | }; | 151 | }; |
| 156 | 152 | ||
| 157 | 153 | ||
| @@ -189,23 +185,23 @@ std::string GModelSpectralPlawEnergyFlux::type(void) const | @@ -189,23 +185,23 @@ std::string GModelSpectralPlawEnergyFlux::type(void) const | ||
| 189 | * Returns the energy flux. | 185 | * Returns the energy flux. |
| 190 | ***************************************************************************/ | 186 | ***************************************************************************/ |
| 191 | inline | 187 | inline |
| 192 | -double GModelSpectralPlawEnergyFlux::energy_flux(void) const | 188 | +double GModelSpectralPlawEnergyFlux::eflux(void) const |
| 193 | { | 189 | { |
| 194 | - return (m_energy_flux.value()); | 190 | + return (m_eflux.value()); |
| 195 | } | 191 | } |
| 196 | 192 | ||
| 197 | 193 | ||
| 198 | /***********************************************************************//** | 194 | /***********************************************************************//** |
| 199 | * @brief Set energy flux | 195 | * @brief Set energy flux |
| 200 | * | 196 | * |
| 201 | - * @param[in] energy_flux Energy flux (erg/cm2/s). | 197 | + * @param[in] eflux Energy flux (erg/cm2/s). |
| 202 | * | 198 | * |
| 203 | * Sets the energy flux. | 199 | * Sets the energy flux. |
| 204 | ***************************************************************************/ | 200 | ***************************************************************************/ |
| 205 | inline | 201 | inline |
| 206 | -void GModelSpectralPlawEnergyFlux::energy_flux(const double& energy_flux) | 202 | +void GModelSpectralPlawEnergyFlux::eflux(const double& eflux) |
| 207 | { | 203 | { |
| 208 | - m_energy_flux.value(energy_flux); | 204 | + m_eflux.value(eflux); |
| 209 | return; | 205 | return; |
| 210 | } | 206 | } |
| 211 | 207 |
include/GModelSpectralPlawPhotonFlux.hpp
| @@ -47,7 +47,7 @@ class GXmlElement; | @@ -47,7 +47,7 @@ class GXmlElement; | ||
| 47 | * This class implements a power law spectrum. The model is defined by | 47 | * This class implements a power law spectrum. The model is defined by |
| 48 | * | 48 | * |
| 49 | * \f[ | 49 | * \f[ |
| 50 | - * S_{\rm E}(E | t) = {\tt m\_photon\_flux} | 50 | + * S_{\rm E}(E | t) = {\tt m\_flux} |
| 51 | * \frac{{\tt m\_index}+1} | 51 | * \frac{{\tt m\_index}+1} |
| 52 | * {{\tt e\_max}^{{\tt m\_index}+1} - | 52 | * {{\tt e\_max}^{{\tt m\_index}+1} - |
| 53 | * {\tt e\_min}^{{\tt m\_index}+1}} | 53 | * {\tt e\_min}^{{\tt m\_index}+1}} |
| @@ -58,7 +58,7 @@ class GXmlElement; | @@ -58,7 +58,7 @@ class GXmlElement; | ||
| 58 | * | 58 | * |
| 59 | * \f[ | 59 | * \f[ |
| 60 | * S_{\rm E}(E | t) = | 60 | * S_{\rm E}(E | t) = |
| 61 | - * \frac{{\tt m\_photon\_flux}} | 61 | + * \frac{{\tt m\_flux}} |
| 62 | * {\log {\tt e\_max} - \log {\tt e\_min}} | 62 | * {\log {\tt e\_max} - \log {\tt e\_min}} |
| 63 | * E^{\tt m\_index} | 63 | * E^{\tt m\_index} |
| 64 | * \f] | 64 | * \f] |
| @@ -66,7 +66,7 @@ class GXmlElement; | @@ -66,7 +66,7 @@ class GXmlElement; | ||
| 66 | * for \f${\tt m\_index} = -1\f$, where | 66 | * for \f${\tt m\_index} = -1\f$, where |
| 67 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, | 67 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, |
| 68 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, | 68 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, |
| 69 | - * - \f${\tt m\_photon\_flux}\f$ is the photon flux between | 69 | + * - \f${\tt m\_flux}\f$ is the photon flux between |
| 70 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and | 70 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and |
| 71 | * - \f${\tt m\_index}\f$ is the spectral index. | 71 | * - \f${\tt m\_index}\f$ is the spectral index. |
| 72 | ***************************************************************************/ | 72 | ***************************************************************************/ |
| @@ -76,14 +76,14 @@ public: | @@ -76,14 +76,14 @@ public: | ||
| 76 | // Constructors and destructors | 76 | // Constructors and destructors |
| 77 | GModelSpectralPlawPhotonFlux(void); | 77 | GModelSpectralPlawPhotonFlux(void); |
| 78 | GModelSpectralPlawPhotonFlux(const std::string& type, | 78 | GModelSpectralPlawPhotonFlux(const std::string& type, |
| 79 | - const std::string& integral, | ||
| 80 | - const std::string& index, | ||
| 81 | - const std::string& emin, | ||
| 82 | - const std::string& emax); | ||
| 83 | - GModelSpectralPlawPhotonFlux(const double& integral, | ||
| 84 | - const double& index, | ||
| 85 | - const GEnergy& emin, | ||
| 86 | - const GEnergy& emax); | 79 | + const std::string& flux, |
| 80 | + const std::string& index, | ||
| 81 | + const std::string& emin, | ||
| 82 | + const std::string& emax); | ||
| 83 | + GModelSpectralPlawPhotonFlux(const double& flux, | ||
| 84 | + const double& index, | ||
| 85 | + const GEnergy& emin, | ||
| 86 | + const GEnergy& emax); | ||
| 87 | explicit GModelSpectralPlawPhotonFlux(const GXmlElement& xml); | 87 | explicit GModelSpectralPlawPhotonFlux(const GXmlElement& xml); |
| 88 | GModelSpectralPlawPhotonFlux(const GModelSpectralPlawPhotonFlux& model); | 88 | GModelSpectralPlawPhotonFlux(const GModelSpectralPlawPhotonFlux& model); |
| 89 | virtual ~GModelSpectralPlawPhotonFlux(void); | 89 | virtual ~GModelSpectralPlawPhotonFlux(void); |
| @@ -92,29 +92,29 @@ public: | @@ -92,29 +92,29 @@ public: | ||
| 92 | virtual GModelSpectralPlawPhotonFlux& operator=(const GModelSpectralPlawPhotonFlux& model); | 92 | virtual GModelSpectralPlawPhotonFlux& operator=(const GModelSpectralPlawPhotonFlux& model); |
| 93 | 93 | ||
| 94 | // Implemented pure virtual base class methods | 94 | // Implemented pure virtual base class methods |
| 95 | - virtual void clear(void); | 95 | + virtual void clear(void); |
| 96 | virtual GModelSpectralPlawPhotonFlux* clone(void) const; | 96 | virtual GModelSpectralPlawPhotonFlux* clone(void) const; |
| 97 | - virtual std::string classname(void) const; | ||
| 98 | - virtual std::string type(void) const; | ||
| 99 | - virtual double eval(const GEnergy& srcEng, | ||
| 100 | - const GTime& srcTime = GTime()) const; | ||
| 101 | - virtual double eval_gradients(const GEnergy& srcEng, | ||
| 102 | - const GTime& srcTime = GTime()); | ||
| 103 | - virtual double flux(const GEnergy& emin, | ||
| 104 | - const GEnergy& emax) const; | ||
| 105 | - virtual double eflux(const GEnergy& emin, | ||
| 106 | - const GEnergy& emax) const; | ||
| 107 | - virtual GEnergy mc(const GEnergy& emin, | ||
| 108 | - const GEnergy& emax, | ||
| 109 | - const GTime& time, | ||
| 110 | - GRan& ran) const; | ||
| 111 | - virtual void read(const GXmlElement& xml); | ||
| 112 | - virtual void write(GXmlElement& xml) const; | ||
| 113 | - virtual std::string print(const GChatter& chatter = NORMAL) const; | 97 | + virtual std::string classname(void) const; |
| 98 | + virtual std::string type(void) const; | ||
| 99 | + virtual double eval(const GEnergy& srcEng, | ||
| 100 | + const GTime& srcTime = GTime()) const; | ||
| 101 | + virtual double eval_gradients(const GEnergy& srcEng, | ||
| 102 | + const GTime& srcTime = GTime()); | ||
| 103 | + virtual double flux(const GEnergy& emin, | ||
| 104 | + const GEnergy& emax) const; | ||
| 105 | + virtual double eflux(const GEnergy& emin, | ||
| 106 | + const GEnergy& emax) const; | ||
| 107 | + virtual GEnergy mc(const GEnergy& emin, | ||
| 108 | + const GEnergy& emax, | ||
| 109 | + const GTime& time, | ||
| 110 | + GRan& ran) const; | ||
| 111 | + virtual void read(const GXmlElement& xml); | ||
| 112 | + virtual void write(GXmlElement& xml) const; | ||
| 113 | + virtual std::string print(const GChatter& chatter = NORMAL) const; | ||
| 114 | 114 | ||
| 115 | // Other methods | 115 | // Other methods |
| 116 | - double photon_flux(void) const; | ||
| 117 | - void photon_flux(const double& photon_flux); | 116 | + double flux(void) const; |
| 117 | + void flux(const double& flux); | ||
| 118 | double index(void) const; | 118 | double index(void) const; |
| 119 | void index(const double& index); | 119 | void index(const double& index); |
| 120 | GEnergy emin(void) const; | 120 | GEnergy emin(void) const; |
| @@ -131,7 +131,7 @@ protected: | @@ -131,7 +131,7 @@ protected: | ||
| 131 | 131 | ||
| 132 | // Protected members | 132 | // Protected members |
| 133 | std::string m_type; //!< Model type | 133 | std::string m_type; //!< Model type |
| 134 | - GModelPar m_photon_flux; //!< Photon flux | 134 | + GModelPar m_flux; //!< Photon flux (ph/cm2/s) |
| 135 | GModelPar m_index; //!< Spectral index | 135 | GModelPar m_index; //!< Spectral index |
| 136 | GModelPar m_emin; //!< Lower energy limit (MeV) | 136 | GModelPar m_emin; //!< Lower energy limit (MeV) |
| 137 | GModelPar m_emax; //!< Upper energy limit (MeV) | 137 | GModelPar m_emax; //!< Upper energy limit (MeV) |
| @@ -144,14 +144,10 @@ protected: | @@ -144,14 +144,10 @@ protected: | ||
| 144 | mutable double m_norm; //!< Power-law normalization (for pivot energy 1 MeV) | 144 | mutable double m_norm; //!< Power-law normalization (for pivot energy 1 MeV) |
| 145 | mutable double m_g_norm; //!< Power-law normalization gradient | 145 | mutable double m_g_norm; //!< Power-law normalization gradient |
| 146 | mutable double m_power; //!< Power-law factor | 146 | mutable double m_power; //!< Power-law factor |
| 147 | - mutable double m_last_phflux; //!< Last photon flux | ||
| 148 | mutable double m_last_index; //!< Last spectral index (MeV) | 147 | mutable double m_last_index; //!< Last spectral index (MeV) |
| 149 | mutable GEnergy m_last_emin; //!< Last lower energy limit | 148 | mutable GEnergy m_last_emin; //!< Last lower energy limit |
| 150 | mutable GEnergy m_last_emax; //!< Last upper energy limit | 149 | mutable GEnergy m_last_emax; //!< Last upper energy limit |
| 151 | mutable GEnergy m_last_energy; //!< Last source energy | 150 | mutable GEnergy m_last_energy; //!< Last source energy |
| 152 | - mutable double m_last_value; //!< Last function value | ||
| 153 | - mutable double m_last_g_phflux; //!< Last photon flux gradient | ||
| 154 | - mutable double m_last_g_index; //!< Last spectral index gradient | ||
| 155 | }; | 151 | }; |
| 156 | 152 | ||
| 157 | 153 | ||
| @@ -189,23 +185,23 @@ std::string GModelSpectralPlawPhotonFlux::type(void) const | @@ -189,23 +185,23 @@ std::string GModelSpectralPlawPhotonFlux::type(void) const | ||
| 189 | * Returns the photon flux. | 185 | * Returns the photon flux. |
| 190 | ***************************************************************************/ | 186 | ***************************************************************************/ |
| 191 | inline | 187 | inline |
| 192 | -double GModelSpectralPlawPhotonFlux::photon_flux(void) const | 188 | +double GModelSpectralPlawPhotonFlux::flux(void) const |
| 193 | { | 189 | { |
| 194 | - return (m_photon_flux.value()); | 190 | + return (m_flux.value()); |
| 195 | } | 191 | } |
| 196 | 192 | ||
| 197 | 193 | ||
| 198 | /***********************************************************************//** | 194 | /***********************************************************************//** |
| 199 | * @brief Set photon flux | 195 | * @brief Set photon flux |
| 200 | * | 196 | * |
| 201 | - * @param[in] photon_flux Photon flux (ph/cm2/s). | 197 | + * @param[in] flux Photon flux (ph/cm2/s). |
| 202 | * | 198 | * |
| 203 | * Sets the photon flux. | 199 | * Sets the photon flux. |
| 204 | ***************************************************************************/ | 200 | ***************************************************************************/ |
| 205 | inline | 201 | inline |
| 206 | -void GModelSpectralPlawPhotonFlux::photon_flux(const double& photon_flux) | 202 | +void GModelSpectralPlawPhotonFlux::flux(const double& flux) |
| 207 | { | 203 | { |
| 208 | - m_photon_flux.value(photon_flux); | 204 | + m_flux.value(flux); |
| 209 | return; | 205 | return; |
| 210 | } | 206 | } |
| 211 | 207 |
include/GammaLib.hpp
| @@ -216,7 +216,7 @@ | @@ -216,7 +216,7 @@ | ||
| 216 | #include "GModelSpectralNodes.hpp" | 216 | #include "GModelSpectralNodes.hpp" |
| 217 | #include "GModelSpectralPlaw.hpp" | 217 | #include "GModelSpectralPlaw.hpp" |
| 218 | #include "GModelSpectralPlawPhotonFlux.hpp" | 218 | #include "GModelSpectralPlawPhotonFlux.hpp" |
| 219 | -#include "GModelSpectralPlawenergyFlux.hpp" | 219 | +#include "GModelSpectralPlawEnergyFlux.hpp" |
| 220 | #include "GModelTemporal.hpp" | 220 | #include "GModelTemporal.hpp" |
| 221 | #include "GModelTemporalRegistry.hpp" | 221 | #include "GModelTemporalRegistry.hpp" |
| 222 | #include "GModelTemporalConst.hpp" | 222 | #include "GModelTemporalConst.hpp" |
pyext/GModelSpectralPlawEnergyFlux.i
| @@ -39,41 +39,41 @@ public: | @@ -39,41 +39,41 @@ public: | ||
| 39 | // Constructors and destructors | 39 | // Constructors and destructors |
| 40 | GModelSpectralPlawEnergyFlux(void); | 40 | GModelSpectralPlawEnergyFlux(void); |
| 41 | GModelSpectralPlawEnergyFlux(const std::string& type, | 41 | GModelSpectralPlawEnergyFlux(const std::string& type, |
| 42 | - const std::string& energy_flux, | 42 | + const std::string& eflux, |
| 43 | const std::string& index, | 43 | const std::string& index, |
| 44 | const std::string& emin, | 44 | const std::string& emin, |
| 45 | const std::string& emax); | 45 | const std::string& emax); |
| 46 | - explicit GModelSpectralPlawEnergyFlux(const double& energy_flux, | ||
| 47 | - const double& index, | ||
| 48 | - const GEnergy& emin, | ||
| 49 | - const GEnergy& emax); | 46 | + explicit GModelSpectralPlawEnergyFlux(const double& eflux, |
| 47 | + const double& index, | ||
| 48 | + const GEnergy& emin, | ||
| 49 | + const GEnergy& emax); | ||
| 50 | explicit GModelSpectralPlawEnergyFlux(const GXmlElement& xml); | 50 | explicit GModelSpectralPlawEnergyFlux(const GXmlElement& xml); |
| 51 | GModelSpectralPlawEnergyFlux(const GModelSpectralPlawEnergyFlux& model); | 51 | GModelSpectralPlawEnergyFlux(const GModelSpectralPlawEnergyFlux& model); |
| 52 | virtual ~GModelSpectralPlawEnergyFlux(void); | 52 | virtual ~GModelSpectralPlawEnergyFlux(void); |
| 53 | 53 | ||
| 54 | - // Implemented pure virtual methods | ||
| 55 | - virtual void clear(void); | 54 | + // Implemented pure virtual base class methods |
| 55 | + virtual void clear(void); | ||
| 56 | virtual GModelSpectralPlawEnergyFlux* clone(void) const; | 56 | virtual GModelSpectralPlawEnergyFlux* clone(void) const; |
| 57 | - virtual std::string classname(void) const; | ||
| 58 | - virtual std::string type(void) const; | ||
| 59 | - virtual double eval(const GEnergy& srcEng, | ||
| 60 | - const GTime& srcTime = GTime()) const; | ||
| 61 | - virtual double eval_gradients(const GEnergy& srcEng, | ||
| 62 | - const GTime& srcTime = GTime()); | ||
| 63 | - virtual double flux(const GEnergy& emin, | ||
| 64 | - const GEnergy& emax) const; | ||
| 65 | - virtual double eflux(const GEnergy& emin, | ||
| 66 | - const GEnergy& emax) const; | ||
| 67 | - virtual GEnergy mc(const GEnergy& emin, | ||
| 68 | - const GEnergy& emax, | ||
| 69 | - const GTime& time, | ||
| 70 | - GRan& ran) const; | ||
| 71 | - virtual void read(const GXmlElement& xml); | ||
| 72 | - virtual void write(GXmlElement& xml) const; | 57 | + virtual std::string classname(void) const; |
| 58 | + virtual std::string type(void) const; | ||
| 59 | + virtual double eval(const GEnergy& srcEng, | ||
| 60 | + const GTime& srcTime = GTime()) const; | ||
| 61 | + virtual double eval_gradients(const GEnergy& srcEng, | ||
| 62 | + const GTime& srcTime = GTime()); | ||
| 63 | + virtual double flux(const GEnergy& emin, | ||
| 64 | + const GEnergy& emax) const; | ||
| 65 | + virtual double eflux(const GEnergy& emin, | ||
| 66 | + const GEnergy& emax) const; | ||
| 67 | + virtual GEnergy mc(const GEnergy& emin, | ||
| 68 | + const GEnergy& emax, | ||
| 69 | + const GTime& time, | ||
| 70 | + GRan& ran) const; | ||
| 71 | + virtual void read(const GXmlElement& xml); | ||
| 72 | + virtual void write(GXmlElement& xml) const; | ||
| 73 | 73 | ||
| 74 | // Other methods | 74 | // Other methods |
| 75 | - double energy_flux(void) const; | ||
| 76 | - void energy_flux(const double& energy_flux); | 75 | + double eflux(void) const; |
| 76 | + void eflux(const double& eflux); | ||
| 77 | double index(void) const; | 77 | double index(void) const; |
| 78 | void index(const double& index); | 78 | void index(const double& index); |
| 79 | GEnergy emin(void) const; | 79 | GEnergy emin(void) const; |
pyext/GModelSpectralPlawPhotonFlux.i
| @@ -39,41 +39,41 @@ public: | @@ -39,41 +39,41 @@ public: | ||
| 39 | // Constructors and destructors | 39 | // Constructors and destructors |
| 40 | GModelSpectralPlawPhotonFlux(void); | 40 | GModelSpectralPlawPhotonFlux(void); |
| 41 | GModelSpectralPlawPhotonFlux(const std::string& type, | 41 | GModelSpectralPlawPhotonFlux(const std::string& type, |
| 42 | - const std::string& photon_flux, | ||
| 43 | - const std::string& index, | ||
| 44 | - const std::string& emin, | ||
| 45 | - const std::string& emax); | ||
| 46 | - GModelSpectralPlawPhotonFlux(const double& photon_flux, | ||
| 47 | - const double& index, | ||
| 48 | - const GEnergy& emin, | ||
| 49 | - const GEnergy& emax); | 42 | + const std::string& flux, |
| 43 | + const std::string& index, | ||
| 44 | + const std::string& emin, | ||
| 45 | + const std::string& emax); | ||
| 46 | + GModelSpectralPlawPhotonFlux(const double& flux, | ||
| 47 | + const double& index, | ||
| 48 | + const GEnergy& emin, | ||
| 49 | + const GEnergy& emax); | ||
| 50 | explicit GModelSpectralPlawPhotonFlux(const GXmlElement& xml); | 50 | explicit GModelSpectralPlawPhotonFlux(const GXmlElement& xml); |
| 51 | GModelSpectralPlawPhotonFlux(const GModelSpectralPlawPhotonFlux& model); | 51 | GModelSpectralPlawPhotonFlux(const GModelSpectralPlawPhotonFlux& model); |
| 52 | virtual ~GModelSpectralPlawPhotonFlux(void); | 52 | virtual ~GModelSpectralPlawPhotonFlux(void); |
| 53 | 53 | ||
| 54 | // Implemented pure virtual methods | 54 | // Implemented pure virtual methods |
| 55 | - virtual void clear(void); | 55 | + virtual void clear(void); |
| 56 | virtual GModelSpectralPlawPhotonFlux* clone(void) const; | 56 | virtual GModelSpectralPlawPhotonFlux* clone(void) const; |
| 57 | - virtual std::string classname(void) const; | ||
| 58 | - virtual std::string type(void) const; | ||
| 59 | - virtual double eval(const GEnergy& srcEng, | ||
| 60 | - const GTime& srcTime = GTime()) const; | ||
| 61 | - virtual double eval_gradients(const GEnergy& srcEng, | ||
| 62 | - const GTime& srcTime = GTime()); | ||
| 63 | - virtual double flux(const GEnergy& emin, | ||
| 64 | - const GEnergy& emax) const; | ||
| 65 | - virtual double eflux(const GEnergy& emin, | ||
| 66 | - const GEnergy& emax) const; | ||
| 67 | - virtual GEnergy mc(const GEnergy& emin, | ||
| 68 | - const GEnergy& emax, | ||
| 69 | - const GTime& time, | ||
| 70 | - GRan& ran) const; | ||
| 71 | - virtual void read(const GXmlElement& xml); | ||
| 72 | - virtual void write(GXmlElement& xml) const; | 57 | + virtual std::string classname(void) const; |
| 58 | + virtual std::string type(void) const; | ||
| 59 | + virtual double eval(const GEnergy& srcEng, | ||
| 60 | + const GTime& srcTime = GTime()) const; | ||
| 61 | + virtual double eval_gradients(const GEnergy& srcEng, | ||
| 62 | + const GTime& srcTime = GTime()); | ||
| 63 | + virtual double flux(const GEnergy& emin, | ||
| 64 | + const GEnergy& emax) const; | ||
| 65 | + virtual double eflux(const GEnergy& emin, | ||
| 66 | + const GEnergy& emax) const; | ||
| 67 | + virtual GEnergy mc(const GEnergy& emin, | ||
| 68 | + const GEnergy& emax, | ||
| 69 | + const GTime& time, | ||
| 70 | + GRan& ran) const; | ||
| 71 | + virtual void read(const GXmlElement& xml); | ||
| 72 | + virtual void write(GXmlElement& xml) const; | ||
| 73 | 73 | ||
| 74 | // Other methods | 74 | // Other methods |
| 75 | - double photon_flux(void) const; | ||
| 76 | - void photon_flux(const double& photon_flux); | 75 | + double flux(void) const; |
| 76 | + void flux(const double& flux); | ||
| 77 | double index(void) const; | 77 | double index(void) const; |
| 78 | void index(const double& index); | 78 | void index(const double& index); |
| 79 | GEnergy emin(void) const; | 79 | GEnergy emin(void) const; |
src/model/GModelSpectralBrokenPlaw.cpp
| @@ -90,8 +90,9 @@ GModelSpectralBrokenPlaw::GModelSpectralBrokenPlaw(void) : GModelSpectral() | @@ -90,8 +90,9 @@ GModelSpectralBrokenPlaw::GModelSpectralBrokenPlaw(void) : GModelSpectral() | ||
| 90 | * | 90 | * |
| 91 | * @param[in] type Model type. | 91 | * @param[in] type Model type. |
| 92 | * @param[in] prefactor Name of prefactor parameter. | 92 | * @param[in] prefactor Name of prefactor parameter. |
| 93 | - * @param[in] index Name of index parameter. | ||
| 94 | - * @param[in] pivot Name of pivot parameter. | 93 | + * @param[in] index1 Name of index1 parameter. |
| 94 | + * @param[in] breakenergy Name of breakenergy parameter. | ||
| 95 | + * @param[in] index2 Name of index2 parameter. | ||
| 95 | ***************************************************************************/ | 96 | ***************************************************************************/ |
| 96 | GModelSpectralBrokenPlaw::GModelSpectralBrokenPlaw(const std::string& type, | 97 | GModelSpectralBrokenPlaw::GModelSpectralBrokenPlaw(const std::string& type, |
| 97 | const std::string& prefactor, | 98 | const std::string& prefactor, |
src/model/GModelSpectralPlawEnergyFlux.cpp
| @@ -39,19 +39,20 @@ | @@ -39,19 +39,20 @@ | ||
| 39 | /* __ Constants __________________________________________________________ */ | 39 | /* __ Constants __________________________________________________________ */ |
| 40 | 40 | ||
| 41 | /* __ Globals ____________________________________________________________ */ | 41 | /* __ Globals ____________________________________________________________ */ |
| 42 | -const GModelSpectralPlawEnergyFlux g_spectral_plaw_eflux_seed("PowerLaw", | ||
| 43 | - "EnergyFlux", | ||
| 44 | - "Index", | ||
| 45 | - "LowerLimit", | ||
| 46 | - "UpperLimit"); | ||
| 47 | -const GModelSpectralRegistry g_spectral_plaw_eflux_registry(&g_spectral_plaw_eflux_seed); | 42 | +const GModelSpectralPlawEnergyFlux g_spectral_plaw_eflux_seed("PowerLaw", |
| 43 | + "EnergyFlux", | ||
| 44 | + "Index", | ||
| 45 | + "LowerLimit", | ||
| 46 | + "UpperLimit"); | ||
| 47 | +const GModelSpectralRegistry g_spectral_plaw_eflux_registry(&g_spectral_plaw_eflux_seed); | ||
| 48 | 48 | ||
| 49 | /* __ Method name definitions ____________________________________________ */ | 49 | /* __ Method name definitions ____________________________________________ */ |
| 50 | -#define G_FLUX "GModelSpectralPlawEnergyFlux::flux(GEnergy&, GEnergy&)" | ||
| 51 | -#define G_EFLUX "GModelSpectralPlawEnergyFlux::eflux(GEnergy&, GEnergy&)" | ||
| 52 | -#define G_MC "GModelSpectralPlawEnergyFlux::mc(GEnergy&, GEnergy&, GTime&, GRan&)" | ||
| 53 | -#define G_READ "GModelSpectralPlawEnergyFlux::read(GXmlElement&)" | ||
| 54 | -#define G_WRITE "GModelSpectralPlawEnergyFlux::write(GXmlElement&)" | 50 | +#define G_FLUX "GModelSpectralPlawEnergyFlux::flux(GEnergy&, GEnergy&)" |
| 51 | +#define G_EFLUX "GModelSpectralPlawEnergyFlux::eflux(GEnergy&, GEnergy&)" | ||
| 52 | +#define G_MC "GModelSpectralPlawEnergyFlux::mc(GEnergy&, GEnergy&, GTime&, "\ | ||
| 53 | + "GRan&)" | ||
| 54 | +#define G_READ "GModelSpectralPlawEnergyFlux::read(GXmlElement&)" | ||
| 55 | +#define G_WRITE "GModelSpectralPlawEnergyFlux::write(GXmlElement&)" | ||
| 55 | 56 | ||
| 56 | /* __ Macros _____________________________________________________________ */ | 57 | /* __ Macros _____________________________________________________________ */ |
| 57 | 58 | ||
| @@ -69,7 +70,8 @@ const GModelSpectralRegistry g_spectral_plaw_eflux_registry(&g_spectral_plaw_efl | @@ -69,7 +70,8 @@ const GModelSpectralRegistry g_spectral_plaw_eflux_registry(&g_spectral_plaw_efl | ||
| 69 | /***********************************************************************//** | 70 | /***********************************************************************//** |
| 70 | * @brief Void constructor | 71 | * @brief Void constructor |
| 71 | ***************************************************************************/ | 72 | ***************************************************************************/ |
| 72 | -GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(void) : GModelSpectral() | 73 | +GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(void) : |
| 74 | + GModelSpectral() | ||
| 73 | { | 75 | { |
| 74 | // Initialise members | 76 | // Initialise members |
| 75 | init_members(); | 77 | init_members(); |
| @@ -83,17 +85,17 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(void) : GModelSpectra | @@ -83,17 +85,17 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(void) : GModelSpectra | ||
| 83 | * @brief Model type and parameter name constructor | 85 | * @brief Model type and parameter name constructor |
| 84 | * | 86 | * |
| 85 | * @param[in] type Model type. | 87 | * @param[in] type Model type. |
| 86 | - * @param[in] energy_flux Name of energy flux parameter. | 88 | + * @param[in] eflux Name of energy flux parameter. |
| 87 | * @param[in] index Name of index parameter. | 89 | * @param[in] index Name of index parameter. |
| 88 | * @param[in] emin Name of emin parameter. | 90 | * @param[in] emin Name of emin parameter. |
| 89 | * @param[in] emax Name of emax parameter. | 91 | * @param[in] emax Name of emax parameter. |
| 90 | ***************************************************************************/ | 92 | ***************************************************************************/ |
| 91 | GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const std::string& type, | 93 | GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const std::string& type, |
| 92 | - const std::string& energy_flux, | ||
| 93 | - const std::string& index, | ||
| 94 | - const std::string& emin, | ||
| 95 | - const std::string& emax) : | ||
| 96 | - GModelSpectral() | 94 | + const std::string& eflux, |
| 95 | + const std::string& index, | ||
| 96 | + const std::string& emin, | ||
| 97 | + const std::string& emax) : | ||
| 98 | + GModelSpectral() | ||
| 97 | { | 99 | { |
| 98 | // Initialise members | 100 | // Initialise members |
| 99 | init_members(); | 101 | init_members(); |
| @@ -102,7 +104,7 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const std::string& ty | @@ -102,7 +104,7 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const std::string& ty | ||
| 102 | m_type = type; | 104 | m_type = type; |
| 103 | 105 | ||
| 104 | // Set parameter names | 106 | // Set parameter names |
| 105 | - m_energy_flux.name(energy_flux); | 107 | + m_eflux.name(eflux); |
| 106 | m_index.name(index); | 108 | m_index.name(index); |
| 107 | m_emin.name(emin); | 109 | m_emin.name(emin); |
| 108 | m_emax.name(emax); | 110 | m_emax.name(emax); |
| @@ -115,7 +117,7 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const std::string& ty | @@ -115,7 +117,7 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const std::string& ty | ||
| 115 | /***********************************************************************//** | 117 | /***********************************************************************//** |
| 116 | * @brief Constructor | 118 | * @brief Constructor |
| 117 | * | 119 | * |
| 118 | - * @param[in] energy_flux Energy flux (erg/cm2/s). | 120 | + * @param[in] eflux Energy flux (erg/cm2/s). |
| 119 | * @param[in] index Power law index. | 121 | * @param[in] index Power law index. |
| 120 | * @param[in] emin Minimum energy. | 122 | * @param[in] emin Minimum energy. |
| 121 | * @param[in] emax Maximum energy. | 123 | * @param[in] emax Maximum energy. |
| @@ -126,17 +128,17 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const std::string& ty | @@ -126,17 +128,17 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const std::string& ty | ||
| 126 | * - minimum energy and | 128 | * - minimum energy and |
| 127 | * - maximum energy. | 129 | * - maximum energy. |
| 128 | ***************************************************************************/ | 130 | ***************************************************************************/ |
| 129 | -GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const double& energy_flux, | ||
| 130 | - const double& index, | ||
| 131 | - const GEnergy& emin, | ||
| 132 | - const GEnergy& emax) : | ||
| 133 | - GModelSpectral() | 131 | +GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const double& eflux, |
| 132 | + const double& index, | ||
| 133 | + const GEnergy& emin, | ||
| 134 | + const GEnergy& emax) : | ||
| 135 | + GModelSpectral() | ||
| 134 | { | 136 | { |
| 135 | // Initialise members | 137 | // Initialise members |
| 136 | init_members(); | 138 | init_members(); |
| 137 | 139 | ||
| 138 | // Set parameters | 140 | // Set parameters |
| 139 | - m_energy_flux.value(energy_flux); | 141 | + m_eflux.value(eflux); |
| 140 | m_index.value(index); | 142 | m_index.value(index); |
| 141 | m_emin.value(emin.MeV()); | 143 | m_emin.value(emin.MeV()); |
| 142 | m_emax.value(emax.MeV()); | 144 | m_emax.value(emax.MeV()); |
| @@ -152,11 +154,10 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const double& energy | @@ -152,11 +154,10 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const double& energy | ||
| 152 | * @param[in] xml XML element. | 154 | * @param[in] xml XML element. |
| 153 | * | 155 | * |
| 154 | * Constructs energy flux normalized power law spectral model by extracting | 156 | * Constructs energy flux normalized power law spectral model by extracting |
| 155 | - * information from an XML element. See the read() method for more | ||
| 156 | - * information about the expected structure of the XML element. | 157 | + * information from an XML element. |
| 157 | ***************************************************************************/ | 158 | ***************************************************************************/ |
| 158 | GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const GXmlElement& xml) : | 159 | GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const GXmlElement& xml) : |
| 159 | - GModelSpectral() | 160 | + GModelSpectral() |
| 160 | { | 161 | { |
| 161 | // Initialise members | 162 | // Initialise members |
| 162 | init_members(); | 163 | init_members(); |
| @@ -175,7 +176,7 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const GXmlElement& xm | @@ -175,7 +176,7 @@ GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const GXmlElement& xm | ||
| 175 | * @param[in] model Spectral power law model. | 176 | * @param[in] model Spectral power law model. |
| 176 | ***************************************************************************/ | 177 | ***************************************************************************/ |
| 177 | GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const GModelSpectralPlawEnergyFlux& model) : | 178 | GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(const GModelSpectralPlawEnergyFlux& model) : |
| 178 | - GModelSpectral(model) | 179 | + GModelSpectral(model) |
| 179 | { | 180 | { |
| 180 | // Initialise members | 181 | // Initialise members |
| 181 | init_members(); | 182 | init_members(); |
| @@ -283,7 +284,7 @@ GModelSpectralPlawEnergyFlux* GModelSpectralPlawEnergyFlux::clone(void) const | @@ -283,7 +284,7 @@ GModelSpectralPlawEnergyFlux* GModelSpectralPlawEnergyFlux::clone(void) const | ||
| 283 | * Computes | 284 | * Computes |
| 284 | * | 285 | * |
| 285 | * \f[ | 286 | * \f[ |
| 286 | - * S_{\rm E}(E | t) = {\tt m\_energy\_flux} | 287 | + * S_{\rm E}(E | t) = {\tt m\_eflux} |
| 287 | * \frac{{\tt m\_index}+2} | 288 | * \frac{{\tt m\_index}+2} |
| 288 | * {{\tt e\_max}^{{\tt m\_index}+2} - | 289 | * {{\tt e\_max}^{{\tt m\_index}+2} - |
| 289 | * {\tt e\_min}^{{\tt m\_index}+2}} | 290 | * {\tt e\_min}^{{\tt m\_index}+2}} |
| @@ -294,7 +295,7 @@ GModelSpectralPlawEnergyFlux* GModelSpectralPlawEnergyFlux::clone(void) const | @@ -294,7 +295,7 @@ GModelSpectralPlawEnergyFlux* GModelSpectralPlawEnergyFlux::clone(void) const | ||
| 294 | * | 295 | * |
| 295 | * \f[ | 296 | * \f[ |
| 296 | * S_{\rm E}(E | t) = | 297 | * S_{\rm E}(E | t) = |
| 297 | - * \frac{{\tt m\_energy\_flux}} | 298 | + * \frac{{\tt m\_eflux}} |
| 298 | * {\log {\tt e\_max} - \log {\tt e\_min}} | 299 | * {\log {\tt e\_max} - \log {\tt e\_min}} |
| 299 | * E^{\tt m\_index} | 300 | * E^{\tt m\_index} |
| 300 | * \f] | 301 | * \f] |
| @@ -302,18 +303,18 @@ GModelSpectralPlawEnergyFlux* GModelSpectralPlawEnergyFlux::clone(void) const | @@ -302,18 +303,18 @@ GModelSpectralPlawEnergyFlux* GModelSpectralPlawEnergyFlux::clone(void) const | ||
| 302 | * for \f${\tt m\_index} = -2\f$, where | 303 | * for \f${\tt m\_index} = -2\f$, where |
| 303 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, | 304 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, |
| 304 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, | 305 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, |
| 305 | - * - \f${\tt m\_energy\_flux}\f$ is the energy flux between | 306 | + * - \f${\tt m\_eflux}\f$ is the energy flux between |
| 306 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and | 307 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and |
| 307 | * - \f${\tt m\_index}\f$ is the spectral index. | 308 | * - \f${\tt m\_index}\f$ is the spectral index. |
| 308 | ***************************************************************************/ | 309 | ***************************************************************************/ |
| 309 | double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | 310 | double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, |
| 310 | - const GTime& srcTime) const | 311 | + const GTime& srcTime) const |
| 311 | { | 312 | { |
| 312 | // Update precomputed values | 313 | // Update precomputed values |
| 313 | update(srcEng); | 314 | update(srcEng); |
| 314 | 315 | ||
| 315 | // Compute function value | 316 | // Compute function value |
| 316 | - double value = m_energy_flux.value() * gammalib::erg2MeV * m_norm * m_power; | 317 | + double value = m_eflux.value() * gammalib::erg2MeV * m_norm * m_power; |
| 317 | 318 | ||
| 318 | // Compile option: Check for NaN/Inf | 319 | // Compile option: Check for NaN/Inf |
| 319 | #if defined(G_NAN_CHECK) | 320 | #if defined(G_NAN_CHECK) |
| @@ -323,7 +324,7 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | @@ -323,7 +324,7 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | ||
| 323 | std::cout << ", srcTime=" << srcTime << "):"; | 324 | std::cout << ", srcTime=" << srcTime << "):"; |
| 324 | std::cout << " NaN/Inf encountered"; | 325 | std::cout << " NaN/Inf encountered"; |
| 325 | std::cout << " (value=" << value; | 326 | std::cout << " (value=" << value; |
| 326 | - std::cout << ", energy flux=" << energy_flux(); | 327 | + std::cout << ", eflux=" << eflux(); |
| 327 | std::cout << ", m_norm=" << m_norm; | 328 | std::cout << ", m_norm=" << m_norm; |
| 328 | std::cout << ", m_power=" << m_power; | 329 | std::cout << ", m_power=" << m_power; |
| 329 | std::cout << ")" << std::endl; | 330 | std::cout << ")" << std::endl; |
| @@ -345,7 +346,7 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | @@ -345,7 +346,7 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | ||
| 345 | * Computes | 346 | * Computes |
| 346 | * | 347 | * |
| 347 | * \f[ | 348 | * \f[ |
| 348 | - * S_{\rm E}(E | t) = {\tt m\_energy\_flux} | 349 | + * S_{\rm E}(E | t) = {\tt m\_eflux} |
| 349 | * \frac{{\tt m\_index}+2} | 350 | * \frac{{\tt m\_index}+2} |
| 350 | * {{\tt e\_max}^{{\tt m\_index}+2} - | 351 | * {{\tt e\_max}^{{\tt m\_index}+2} - |
| 351 | * {\tt e\_min}^{{\tt m\_index}+2}} | 352 | * {\tt e\_min}^{{\tt m\_index}+2}} |
| @@ -356,7 +357,7 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | @@ -356,7 +357,7 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | ||
| 356 | * | 357 | * |
| 357 | * \f[ | 358 | * \f[ |
| 358 | * S_{\rm E}(E | t) = | 359 | * S_{\rm E}(E | t) = |
| 359 | - * \frac{{\tt m\_energy\_flux}} | 360 | + * \frac{{\tt m\_eflux}} |
| 360 | * {\log {\tt e\_max} - \log {\tt e\_min}} | 361 | * {\log {\tt e\_max} - \log {\tt e\_min}} |
| 361 | * E^{\tt m\_index} | 362 | * E^{\tt m\_index} |
| 362 | * \f] | 363 | * \f] |
| @@ -364,7 +365,7 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | @@ -364,7 +365,7 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | ||
| 364 | * for \f${\tt m\_index} = -2\f$, where | 365 | * for \f${\tt m\_index} = -2\f$, where |
| 365 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, | 366 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, |
| 366 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, | 367 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, |
| 367 | - * - \f${\tt m\_energy\_flux}\f$ is the energy flux between | 368 | + * - \f${\tt m\_eflux}\f$ is the energy flux between |
| 368 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and | 369 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and |
| 369 | * - \f${\tt m\_index}\f$ is the spectral index. | 370 | * - \f${\tt m\_index}\f$ is the spectral index. |
| 370 | * | 371 | * |
| @@ -372,8 +373,8 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | @@ -372,8 +373,8 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | ||
| 372 | * respect to the parameters using | 373 | * respect to the parameters using |
| 373 | * | 374 | * |
| 374 | * \f[ | 375 | * \f[ |
| 375 | - * \frac{\delta S_{\rm E}(E | t)}{\delta {\tt m\_energy\_flux}} = | ||
| 376 | - * \frac{S_{\rm E}(E | t)}{{\tt m\_energy\_flux}} | 376 | + * \frac{\delta S_{\rm E}(E | t)}{\delta {\tt m\_eflux}} = |
| 377 | + * \frac{S_{\rm E}(E | t)}{{\tt m\_eflux}} | ||
| 377 | * \f] | 378 | * \f] |
| 378 | * | 379 | * |
| 379 | * \f[ | 380 | * \f[ |
| @@ -399,21 +400,21 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | @@ -399,21 +400,21 @@ double GModelSpectralPlawEnergyFlux::eval(const GEnergy& srcEng, | ||
| 399 | * No partial derivatives are supported for the energy boundaries. | 400 | * No partial derivatives are supported for the energy boundaries. |
| 400 | ***************************************************************************/ | 401 | ***************************************************************************/ |
| 401 | double GModelSpectralPlawEnergyFlux::eval_gradients(const GEnergy& srcEng, | 402 | double GModelSpectralPlawEnergyFlux::eval_gradients(const GEnergy& srcEng, |
| 402 | - const GTime& srcTime) | 403 | + const GTime& srcTime) |
| 403 | { | 404 | { |
| 404 | // Initialise gradients | 405 | // Initialise gradients |
| 405 | - double g_energy_flux = 0.0; | ||
| 406 | - double g_index = 0.0; | 406 | + double g_eflux = 0.0; |
| 407 | + double g_index = 0.0; | ||
| 407 | 408 | ||
| 408 | // Update precomputed values | 409 | // Update precomputed values |
| 409 | update(srcEng); | 410 | update(srcEng); |
| 410 | 411 | ||
| 411 | // Compute function value | 412 | // Compute function value |
| 412 | - double value = m_energy_flux.value() * gammalib::erg2MeV * m_norm * m_power; | 413 | + double value = m_eflux.value() * gammalib::erg2MeV * m_norm * m_power; |
| 413 | 414 | ||
| 414 | // Integral flux gradient | 415 | // Integral flux gradient |
| 415 | - if (m_energy_flux.is_free() && m_energy_flux.factor_value() > 0.0) { | ||
| 416 | - g_energy_flux = value / m_energy_flux.factor_value(); | 416 | + if (m_eflux.is_free() && m_eflux.factor_value() > 0.0) { |
| 417 | + g_eflux = value / m_eflux.factor_value(); | ||
| 417 | } | 418 | } |
| 418 | 419 | ||
| 419 | // Index gradient | 420 | // Index gradient |
| @@ -423,7 +424,7 @@ double GModelSpectralPlawEnergyFlux::eval_gradients(const GEnergy& srcEng, | @@ -423,7 +424,7 @@ double GModelSpectralPlawEnergyFlux::eval_gradients(const GEnergy& srcEng, | ||
| 423 | } | 424 | } |
| 424 | 425 | ||
| 425 | // Set gradients | 426 | // Set gradients |
| 426 | - m_energy_flux.factor_gradient(g_energy_flux); | 427 | + m_eflux.factor_gradient(g_eflux); |
| 427 | m_index.factor_gradient(g_index); | 428 | m_index.factor_gradient(g_index); |
| 428 | 429 | ||
| 429 | // Compile option: Check for NaN/Inf | 430 | // Compile option: Check for NaN/Inf |
| @@ -434,10 +435,10 @@ double GModelSpectralPlawEnergyFlux::eval_gradients(const GEnergy& srcEng, | @@ -434,10 +435,10 @@ double GModelSpectralPlawEnergyFlux::eval_gradients(const GEnergy& srcEng, | ||
| 434 | std::cout << ", srcTime=" << srcTime << "):"; | 435 | std::cout << ", srcTime=" << srcTime << "):"; |
| 435 | std::cout << " NaN/Inf encountered"; | 436 | std::cout << " NaN/Inf encountered"; |
| 436 | std::cout << " (value=" << value; | 437 | std::cout << " (value=" << value; |
| 437 | - std::cout << ", energy flux=" << energy_flux(); | 438 | + std::cout << ", eflux=" << eflux(); |
| 438 | std::cout << ", m_norm=" << m_norm; | 439 | std::cout << ", m_norm=" << m_norm; |
| 439 | std::cout << ", m_power=" << m_power; | 440 | std::cout << ", m_power=" << m_power; |
| 440 | - std::cout << ", g_energy_flux=" << g_energy_flux; | 441 | + std::cout << ", g_eflux=" << g_eflux; |
| 441 | std::cout << ", g_index=" << g_index; | 442 | std::cout << ", g_index=" << g_index; |
| 442 | std::cout << ")" << std::endl; | 443 | std::cout << ")" << std::endl; |
| 443 | } | 444 | } |
| @@ -466,7 +467,7 @@ double GModelSpectralPlawEnergyFlux::eval_gradients(const GEnergy& srcEng, | @@ -466,7 +467,7 @@ double GModelSpectralPlawEnergyFlux::eval_gradients(const GEnergy& srcEng, | ||
| 466 | * - \f$S_{\rm E}(E | t)\f$ is the spectral model (ph/cm2/s/MeV). | 467 | * - \f$S_{\rm E}(E | t)\f$ is the spectral model (ph/cm2/s/MeV). |
| 467 | ***************************************************************************/ | 468 | ***************************************************************************/ |
| 468 | double GModelSpectralPlawEnergyFlux::flux(const GEnergy& emin, | 469 | double GModelSpectralPlawEnergyFlux::flux(const GEnergy& emin, |
| 469 | - const GEnergy& emax) const | 470 | + const GEnergy& emax) const |
| 470 | { | 471 | { |
| 471 | // Initialise flux | 472 | // Initialise flux |
| 472 | double flux = 0.0; | 473 | double flux = 0.0; |
| @@ -480,12 +481,12 @@ double GModelSpectralPlawEnergyFlux::flux(const GEnergy& emin, | @@ -480,12 +481,12 @@ double GModelSpectralPlawEnergyFlux::flux(const GEnergy& emin, | ||
| 480 | double gamma = m_index.value() + 2.0; | 481 | double gamma = m_index.value() + 2.0; |
| 481 | double pow_ref_emin = std::pow(this->emin().MeV(), gamma); | 482 | double pow_ref_emin = std::pow(this->emin().MeV(), gamma); |
| 482 | double pow_ref_emax = std::pow(this->emax().MeV(), gamma); | 483 | double pow_ref_emax = std::pow(this->emax().MeV(), gamma); |
| 483 | - norm = m_energy_flux.value() * gammalib::erg2MeV * gamma / (pow_ref_emax - pow_ref_emin); | 484 | + norm = m_eflux.value() * gammalib::erg2MeV * gamma / (pow_ref_emax - pow_ref_emin); |
| 484 | } | 485 | } |
| 485 | else { | 486 | else { |
| 486 | double log_ref_emin = std::log(this->emin().MeV()); | 487 | double log_ref_emin = std::log(this->emin().MeV()); |
| 487 | double log_ref_emax = std::log(this->emax().MeV()); | 488 | double log_ref_emax = std::log(this->emax().MeV()); |
| 488 | - norm = m_energy_flux.value() * gammalib::erg2MeV / (log_ref_emax - log_ref_emin); | 489 | + norm = m_eflux.value() * gammalib::erg2MeV / (log_ref_emax - log_ref_emin); |
| 489 | } | 490 | } |
| 490 | 491 | ||
| 491 | // Compute photon flux | 492 | // Compute photon flux |
| @@ -528,7 +529,7 @@ double GModelSpectralPlawEnergyFlux::flux(const GEnergy& emin, | @@ -528,7 +529,7 @@ double GModelSpectralPlawEnergyFlux::flux(const GEnergy& emin, | ||
| 528 | * - \f$S_{\rm E}(E | t)\f$ is the spectral model (ph/cm2/s/MeV). | 529 | * - \f$S_{\rm E}(E | t)\f$ is the spectral model (ph/cm2/s/MeV). |
| 529 | ***************************************************************************/ | 530 | ***************************************************************************/ |
| 530 | double GModelSpectralPlawEnergyFlux::eflux(const GEnergy& emin, | 531 | double GModelSpectralPlawEnergyFlux::eflux(const GEnergy& emin, |
| 531 | - const GEnergy& emax) const | 532 | + const GEnergy& emax) const |
| 532 | { | 533 | { |
| 533 | // Initialise flux | 534 | // Initialise flux |
| 534 | double eflux = 0.0; | 535 | double eflux = 0.0; |
| @@ -546,7 +547,7 @@ double GModelSpectralPlawEnergyFlux::eflux(const GEnergy& emin, | @@ -546,7 +547,7 @@ double GModelSpectralPlawEnergyFlux::eflux(const GEnergy& emin, | ||
| 546 | double pow_emax = std::pow(emax.MeV(), gamma); | 547 | double pow_emax = std::pow(emax.MeV(), gamma); |
| 547 | double factor = (pow_emax - pow_emin) / | 548 | double factor = (pow_emax - pow_emin) / |
| 548 | (pow_ref_emax - pow_ref_emin); | 549 | (pow_ref_emax - pow_ref_emin); |
| 549 | - eflux = m_energy_flux.value() * factor; | 550 | + eflux = m_eflux.value() * factor; |
| 550 | } | 551 | } |
| 551 | else { | 552 | else { |
| 552 | double log_emin = std::log(emin.MeV()); | 553 | double log_emin = std::log(emin.MeV()); |
| @@ -555,7 +556,7 @@ double GModelSpectralPlawEnergyFlux::eflux(const GEnergy& emin, | @@ -555,7 +556,7 @@ double GModelSpectralPlawEnergyFlux::eflux(const GEnergy& emin, | ||
| 555 | double log_ref_emax = std::log(this->emax().MeV()); | 556 | double log_ref_emax = std::log(this->emax().MeV()); |
| 556 | double factor = (log_emax - log_emin) / | 557 | double factor = (log_emax - log_emin) / |
| 557 | (log_ref_emax - log_ref_emin); | 558 | (log_ref_emax - log_ref_emin); |
| 558 | - eflux = m_energy_flux.value() * factor; | 559 | + eflux = m_eflux.value() * factor; |
| 559 | } | 560 | } |
| 560 | 561 | ||
| 561 | } // endif: integration range was valid | 562 | } // endif: integration range was valid |
| @@ -580,9 +581,9 @@ double GModelSpectralPlawEnergyFlux::eflux(const GEnergy& emin, | @@ -580,9 +581,9 @@ double GModelSpectralPlawEnergyFlux::eflux(const GEnergy& emin, | ||
| 580 | * Returns Monte Carlo energy by randomly drawing from a power law. | 581 | * Returns Monte Carlo energy by randomly drawing from a power law. |
| 581 | ***************************************************************************/ | 582 | ***************************************************************************/ |
| 582 | GEnergy GModelSpectralPlawEnergyFlux::mc(const GEnergy& emin, | 583 | GEnergy GModelSpectralPlawEnergyFlux::mc(const GEnergy& emin, |
| 583 | - const GEnergy& emax, | ||
| 584 | - const GTime& time, | ||
| 585 | - GRan& ran) const | 584 | + const GEnergy& emax, |
| 585 | + const GTime& time, | ||
| 586 | + GRan& ran) const | ||
| 586 | { | 587 | { |
| 587 | // Throw an exception if energy range is invalid | 588 | // Throw an exception if energy range is invalid |
| 588 | if (emin >= emax) { | 589 | if (emin >= emax) { |
| @@ -629,13 +630,13 @@ GEnergy GModelSpectralPlawEnergyFlux::mc(const GEnergy& emin, | @@ -629,13 +630,13 @@ GEnergy GModelSpectralPlawEnergyFlux::mc(const GEnergy& emin, | ||
| 629 | void GModelSpectralPlawEnergyFlux::read(const GXmlElement& xml) | 630 | void GModelSpectralPlawEnergyFlux::read(const GXmlElement& xml) |
| 630 | { | 631 | { |
| 631 | // Get parameter pointers | 632 | // Get parameter pointers |
| 632 | - const GXmlElement* eflux = gammalib::xml_get_par(G_READ, xml, m_energy_flux.name()); | 633 | + const GXmlElement* eflux = gammalib::xml_get_par(G_READ, xml, m_eflux.name()); |
| 633 | const GXmlElement* index = gammalib::xml_get_par(G_READ, xml, m_index.name()); | 634 | const GXmlElement* index = gammalib::xml_get_par(G_READ, xml, m_index.name()); |
| 634 | const GXmlElement* emin = gammalib::xml_get_par(G_READ, xml, m_emin.name()); | 635 | const GXmlElement* emin = gammalib::xml_get_par(G_READ, xml, m_emin.name()); |
| 635 | const GXmlElement* emax = gammalib::xml_get_par(G_READ, xml, m_emax.name()); | 636 | const GXmlElement* emax = gammalib::xml_get_par(G_READ, xml, m_emax.name()); |
| 636 | 637 | ||
| 637 | // Read parameters | 638 | // Read parameters |
| 638 | - m_energy_flux.read(*eflux); | 639 | + m_eflux.read(*eflux); |
| 639 | m_index.read(*index); | 640 | m_index.read(*index); |
| 640 | m_emin.read(*emin); | 641 | m_emin.read(*emin); |
| 641 | m_emax.read(*emax); | 642 | m_emax.read(*emax); |
| @@ -669,13 +670,13 @@ void GModelSpectralPlawEnergyFlux::write(GXmlElement& xml) const | @@ -669,13 +670,13 @@ void GModelSpectralPlawEnergyFlux::write(GXmlElement& xml) const | ||
| 669 | } | 670 | } |
| 670 | 671 | ||
| 671 | // Get XML parameters | 672 | // Get XML parameters |
| 672 | - GXmlElement* eflux = gammalib::xml_need_par(G_WRITE, xml, m_energy_flux.name()); | 673 | + GXmlElement* eflux = gammalib::xml_need_par(G_WRITE, xml, m_eflux.name()); |
| 673 | GXmlElement* index = gammalib::xml_need_par(G_WRITE, xml, m_index.name()); | 674 | GXmlElement* index = gammalib::xml_need_par(G_WRITE, xml, m_index.name()); |
| 674 | GXmlElement* emin = gammalib::xml_need_par(G_WRITE, xml, m_emin.name()); | 675 | GXmlElement* emin = gammalib::xml_need_par(G_WRITE, xml, m_emin.name()); |
| 675 | GXmlElement* emax = gammalib::xml_need_par(G_WRITE, xml, m_emax.name()); | 676 | GXmlElement* emax = gammalib::xml_need_par(G_WRITE, xml, m_emax.name()); |
| 676 | 677 | ||
| 677 | // Write parameters | 678 | // Write parameters |
| 678 | - m_energy_flux.write(*eflux); | 679 | + m_eflux.write(*eflux); |
| 679 | m_index.write(*index); | 680 | m_index.write(*index); |
| 680 | m_emin.write(*emin); | 681 | m_emin.write(*emin); |
| 681 | m_emax.write(*emax); | 682 | m_emax.write(*emax); |
| @@ -688,7 +689,7 @@ void GModelSpectralPlawEnergyFlux::write(GXmlElement& xml) const | @@ -688,7 +689,7 @@ void GModelSpectralPlawEnergyFlux::write(GXmlElement& xml) const | ||
| 688 | /***********************************************************************//** | 689 | /***********************************************************************//** |
| 689 | * @brief Print power law information | 690 | * @brief Print power law information |
| 690 | * | 691 | * |
| 691 | - * @param[in] chatter Chattiness (defaults to NORMAL). | 692 | + * @param[in] chatter Chattiness. |
| 692 | * @return String containing power law information. | 693 | * @return String containing power law information. |
| 693 | ***************************************************************************/ | 694 | ***************************************************************************/ |
| 694 | std::string GModelSpectralPlawEnergyFlux::print(const GChatter& chatter) const | 695 | std::string GModelSpectralPlawEnergyFlux::print(const GChatter& chatter) const |
| @@ -731,15 +732,15 @@ void GModelSpectralPlawEnergyFlux::init_members(void) | @@ -731,15 +732,15 @@ void GModelSpectralPlawEnergyFlux::init_members(void) | ||
| 731 | m_type = "PowerLaw"; | 732 | m_type = "PowerLaw"; |
| 732 | 733 | ||
| 733 | // Initialise energy flux | 734 | // Initialise energy flux |
| 734 | - m_energy_flux.clear(); | ||
| 735 | - m_energy_flux.name("EnergyFlux"); | ||
| 736 | - m_energy_flux.unit("erg/cm2/s"); | ||
| 737 | - m_energy_flux.scale(1.0); | ||
| 738 | - m_energy_flux.value(1.0); // default: 1.0 | ||
| 739 | - m_energy_flux.range(0.0, 10.0); // range: [0,10] | ||
| 740 | - m_energy_flux.free(); | ||
| 741 | - m_energy_flux.gradient(0.0); | ||
| 742 | - m_energy_flux.has_grad(true); | 735 | + m_eflux.clear(); |
| 736 | + m_eflux.name("EnergyFlux"); | ||
| 737 | + m_eflux.unit("erg/cm2/s"); | ||
| 738 | + m_eflux.scale(1.0); | ||
| 739 | + m_eflux.value(1.0); // default: 1.0 | ||
| 740 | + m_eflux.range(0.0, 10.0); // range: [0,10] | ||
| 741 | + m_eflux.free(); | ||
| 742 | + m_eflux.gradient(0.0); | ||
| 743 | + m_eflux.has_grad(true); | ||
| 743 | 744 | ||
| 744 | // Initialise powerlaw index | 745 | // Initialise powerlaw index |
| 745 | m_index.clear(); | 746 | m_index.clear(); |
| @@ -775,24 +776,22 @@ void GModelSpectralPlawEnergyFlux::init_members(void) | @@ -775,24 +776,22 @@ void GModelSpectralPlawEnergyFlux::init_members(void) | ||
| 775 | 776 | ||
| 776 | // Set parameter pointer(s) | 777 | // Set parameter pointer(s) |
| 777 | m_pars.clear(); | 778 | m_pars.clear(); |
| 778 | - m_pars.push_back(&m_energy_flux); | 779 | + m_pars.push_back(&m_eflux); |
| 779 | m_pars.push_back(&m_index); | 780 | m_pars.push_back(&m_index); |
| 780 | m_pars.push_back(&m_emin); | 781 | m_pars.push_back(&m_emin); |
| 781 | m_pars.push_back(&m_emax); | 782 | m_pars.push_back(&m_emax); |
| 782 | 783 | ||
| 783 | // Initialise last parameters (for fast computation) | 784 | // Initialise last parameters (for fast computation) |
| 784 | - m_log_emin = 0.0; | ||
| 785 | - m_log_emax = 0.0; | ||
| 786 | - m_pow_emin = 0.0; | ||
| 787 | - m_pow_emax = 0.0; | ||
| 788 | - m_norm = 0.0; | ||
| 789 | - m_power = 0.0; | ||
| 790 | - m_last_index = 1000.0; | 785 | + m_log_emin = 0.0; |
| 786 | + m_log_emax = 0.0; | ||
| 787 | + m_pow_emin = 0.0; | ||
| 788 | + m_pow_emax = 0.0; | ||
| 789 | + m_norm = 0.0; | ||
| 790 | + m_power = 0.0; | ||
| 791 | + m_last_index = 1000.0; | ||
| 791 | m_last_emin.MeV(0.0); | 792 | m_last_emin.MeV(0.0); |
| 792 | m_last_emax.MeV(0.0); | 793 | m_last_emax.MeV(0.0); |
| 793 | m_last_energy.MeV(0.0); | 794 | m_last_energy.MeV(0.0); |
| 794 | - m_last_value = 0.0; | ||
| 795 | - m_last_g_index = 0.0; | ||
| 796 | 795 | ||
| 797 | // Return | 796 | // Return |
| 798 | return; | 797 | return; |
| @@ -807,15 +806,15 @@ void GModelSpectralPlawEnergyFlux::init_members(void) | @@ -807,15 +806,15 @@ void GModelSpectralPlawEnergyFlux::init_members(void) | ||
| 807 | void GModelSpectralPlawEnergyFlux::copy_members(const GModelSpectralPlawEnergyFlux& model) | 806 | void GModelSpectralPlawEnergyFlux::copy_members(const GModelSpectralPlawEnergyFlux& model) |
| 808 | { | 807 | { |
| 809 | // Copy members | 808 | // Copy members |
| 810 | - m_type = model.m_type; | ||
| 811 | - m_energy_flux = model.m_energy_flux; | ||
| 812 | - m_index = model.m_index; | ||
| 813 | - m_emin = model.m_emin; | ||
| 814 | - m_emax = model.m_emax; | 809 | + m_type = model.m_type; |
| 810 | + m_eflux = model.m_eflux; | ||
| 811 | + m_index = model.m_index; | ||
| 812 | + m_emin = model.m_emin; | ||
| 813 | + m_emax = model.m_emax; | ||
| 815 | 814 | ||
| 816 | // Set parameter pointer(s) | 815 | // Set parameter pointer(s) |
| 817 | m_pars.clear(); | 816 | m_pars.clear(); |
| 818 | - m_pars.push_back(&m_energy_flux); | 817 | + m_pars.push_back(&m_eflux); |
| 819 | m_pars.push_back(&m_index); | 818 | m_pars.push_back(&m_index); |
| 820 | m_pars.push_back(&m_emin); | 819 | m_pars.push_back(&m_emin); |
| 821 | m_pars.push_back(&m_emax); | 820 | m_pars.push_back(&m_emax); |
| @@ -831,8 +830,6 @@ void GModelSpectralPlawEnergyFlux::copy_members(const GModelSpectralPlawEnergyFl | @@ -831,8 +830,6 @@ void GModelSpectralPlawEnergyFlux::copy_members(const GModelSpectralPlawEnergyFl | ||
| 831 | m_last_emin = model.m_last_emin; | 830 | m_last_emin = model.m_last_emin; |
| 832 | m_last_emax = model.m_last_emax; | 831 | m_last_emax = model.m_last_emax; |
| 833 | m_last_energy = model.m_last_energy; | 832 | m_last_energy = model.m_last_energy; |
| 834 | - m_last_value = model.m_last_value; | ||
| 835 | - m_last_g_index = model.m_last_g_index; | ||
| 836 | 833 | ||
| 837 | // Return | 834 | // Return |
| 838 | return; | 835 | return; |
src/model/GModelSpectralPlawPhotonFlux.cpp
| @@ -39,27 +39,28 @@ | @@ -39,27 +39,28 @@ | ||
| 39 | /* __ Constants __________________________________________________________ */ | 39 | /* __ Constants __________________________________________________________ */ |
| 40 | 40 | ||
| 41 | /* __ Globals ____________________________________________________________ */ | 41 | /* __ Globals ____________________________________________________________ */ |
| 42 | -const GModelSpectralPlawPhotonFlux g_spectral_plaw_phflux_seed1("PowerLaw", | ||
| 43 | - "PhotonFlux", | ||
| 44 | - "Index", | ||
| 45 | - "LowerLimit", | ||
| 46 | - "UpperLimit"); | ||
| 47 | -const GModelSpectralRegistry g_spectral_plaw_phflux_registry1(&g_spectral_plaw_phflux_seed1); | 42 | +const GModelSpectralPlawPhotonFlux g_spectral_plaw_phflux_seed1("PowerLaw", |
| 43 | + "PhotonFlux", | ||
| 44 | + "Index", | ||
| 45 | + "LowerLimit", | ||
| 46 | + "UpperLimit"); | ||
| 47 | +const GModelSpectralRegistry g_spectral_plaw_phflux_registry1(&g_spectral_plaw_phflux_seed1); | ||
| 48 | #if defined(G_LEGACY_XML_FORMAT) | 48 | #if defined(G_LEGACY_XML_FORMAT) |
| 49 | -const GModelSpectralPlawPhotonFlux g_spectral_plaw_phflux_seed2("PowerLaw2", | ||
| 50 | - "Integral", | ||
| 51 | - "Index", | ||
| 52 | - "LowerLimit", | ||
| 53 | - "UpperLimit"); | ||
| 54 | -const GModelSpectralRegistry g_spectral_plaw_phflux_registry2(&g_spectral_plaw_phflux_seed2); | 49 | +const GModelSpectralPlawPhotonFlux g_spectral_plaw_phflux_seed2("PowerLaw2", |
| 50 | + "Integral", | ||
| 51 | + "Index", | ||
| 52 | + "LowerLimit", | ||
| 53 | + "UpperLimit"); | ||
| 54 | +const GModelSpectralRegistry g_spectral_plaw_phflux_registry2(&g_spectral_plaw_phflux_seed2); | ||
| 55 | #endif | 55 | #endif |
| 56 | 56 | ||
| 57 | /* __ Method name definitions ____________________________________________ */ | 57 | /* __ Method name definitions ____________________________________________ */ |
| 58 | -#define G_FLUX "GModelSpectralPlawPhotonFlux::flux(GEnergy&, GEnergy&)" | ||
| 59 | -#define G_EFLUX "GModelSpectralPlawPhotonFlux::eflux(GEnergy&, GEnergy&)" | ||
| 60 | -#define G_MC "GModelSpectralPlawPhotonFlux::mc(GEnergy&, GEnergy&, GTime&, GRan&)" | ||
| 61 | -#define G_READ "GModelSpectralPlawPhotonFlux::read(GXmlElement&)" | ||
| 62 | -#define G_WRITE "GModelSpectralPlawPhotonFlux::write(GXmlElement&)" | 58 | +#define G_FLUX "GModelSpectralPlawPhotonFlux::flux(GEnergy&, GEnergy&)" |
| 59 | +#define G_EFLUX "GModelSpectralPlawPhotonFlux::eflux(GEnergy&, GEnergy&)" | ||
| 60 | +#define G_MC "GModelSpectralPlawPhotonFlux::mc(GEnergy&, GEnergy&, GTime&, "\ | ||
| 61 | + "GRan&)" | ||
| 62 | +#define G_READ "GModelSpectralPlawPhotonFlux::read(GXmlElement&)" | ||
| 63 | +#define G_WRITE "GModelSpectralPlawPhotonFlux::write(GXmlElement&)" | ||
| 63 | 64 | ||
| 64 | /* __ Macros _____________________________________________________________ */ | 65 | /* __ Macros _____________________________________________________________ */ |
| 65 | 66 | ||
| @@ -79,7 +80,8 @@ const GModelSpectralRegistry g_spectral_plaw_phflux_registry2(&g_spectral_plaw_p | @@ -79,7 +80,8 @@ const GModelSpectralRegistry g_spectral_plaw_phflux_registry2(&g_spectral_plaw_p | ||
| 79 | * | 80 | * |
| 80 | * Constructs empty power law photon flux model. | 81 | * Constructs empty power law photon flux model. |
| 81 | ***************************************************************************/ | 82 | ***************************************************************************/ |
| 82 | -GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(void) : GModelSpectral() | 83 | +GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(void) : |
| 84 | + GModelSpectral() | ||
| 83 | { | 85 | { |
| 84 | // Initialise members | 86 | // Initialise members |
| 85 | init_members(); | 87 | init_members(); |
| @@ -93,17 +95,17 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(void) : GModelSpectra | @@ -93,17 +95,17 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(void) : GModelSpectra | ||
| 93 | * @brief Model type and parameter name constructor | 95 | * @brief Model type and parameter name constructor |
| 94 | * | 96 | * |
| 95 | * @param[in] type Model type. | 97 | * @param[in] type Model type. |
| 96 | - * @param[in] photon_flux Name of photon flux parameter. | 98 | + * @param[in] flux Name of photon flux parameter. |
| 97 | * @param[in] index Name of index parameter. | 99 | * @param[in] index Name of index parameter. |
| 98 | * @param[in] emin Name of emin parameter. | 100 | * @param[in] emin Name of emin parameter. |
| 99 | * @param[in] emax Name of emax parameter. | 101 | * @param[in] emax Name of emax parameter. |
| 100 | ***************************************************************************/ | 102 | ***************************************************************************/ |
| 101 | GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const std::string& type, | 103 | GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const std::string& type, |
| 102 | - const std::string& photon_flux, | ||
| 103 | - const std::string& index, | ||
| 104 | - const std::string& emin, | ||
| 105 | - const std::string& emax) : | ||
| 106 | - GModelSpectral() | 104 | + const std::string& flux, |
| 105 | + const std::string& index, | ||
| 106 | + const std::string& emin, | ||
| 107 | + const std::string& emax) : | ||
| 108 | + GModelSpectral() | ||
| 107 | { | 109 | { |
| 108 | // Initialise members | 110 | // Initialise members |
| 109 | init_members(); | 111 | init_members(); |
| @@ -112,7 +114,7 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const std::string& ty | @@ -112,7 +114,7 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const std::string& ty | ||
| 112 | m_type = type; | 114 | m_type = type; |
| 113 | 115 | ||
| 114 | // Set parameter names | 116 | // Set parameter names |
| 115 | - m_photon_flux.name(photon_flux); | 117 | + m_flux.name(flux); |
| 116 | m_index.name(index); | 118 | m_index.name(index); |
| 117 | m_emin.name(emin); | 119 | m_emin.name(emin); |
| 118 | m_emax.name(emax); | 120 | m_emax.name(emax); |
| @@ -125,7 +127,7 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const std::string& ty | @@ -125,7 +127,7 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const std::string& ty | ||
| 125 | /***********************************************************************//** | 127 | /***********************************************************************//** |
| 126 | * @brief Constructor | 128 | * @brief Constructor |
| 127 | * | 129 | * |
| 128 | - * @param[in] photon_flux Photon flux (ph/cm2/s). | 130 | + * @param[in] flux Photon flux (ph/cm2/s). |
| 129 | * @param[in] index Power law index. | 131 | * @param[in] index Power law index. |
| 130 | * @param[in] emin Minimum energy. | 132 | * @param[in] emin Minimum energy. |
| 131 | * @param[in] emax Maximum energy. | 133 | * @param[in] emax Maximum energy. |
| @@ -136,17 +138,17 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const std::string& ty | @@ -136,17 +138,17 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const std::string& ty | ||
| 136 | * - minimum energy and | 138 | * - minimum energy and |
| 137 | * - maximum energy. | 139 | * - maximum energy. |
| 138 | ***************************************************************************/ | 140 | ***************************************************************************/ |
| 139 | -GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const double& photon_flux, | ||
| 140 | - const double& index, | ||
| 141 | - const GEnergy& emin, | ||
| 142 | - const GEnergy& emax) : | ||
| 143 | - GModelSpectral() | 141 | +GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const double& flux, |
| 142 | + const double& index, | ||
| 143 | + const GEnergy& emin, | ||
| 144 | + const GEnergy& emax) : | ||
| 145 | + GModelSpectral() | ||
| 144 | { | 146 | { |
| 145 | // Initialise members | 147 | // Initialise members |
| 146 | init_members(); | 148 | init_members(); |
| 147 | 149 | ||
| 148 | // Set parameters | 150 | // Set parameters |
| 149 | - m_photon_flux.value(photon_flux); | 151 | + m_flux.value(flux); |
| 150 | m_index.value(index); | 152 | m_index.value(index); |
| 151 | m_emin.value(emin.MeV()); | 153 | m_emin.value(emin.MeV()); |
| 152 | m_emax.value(emax.MeV()); | 154 | m_emax.value(emax.MeV()); |
| @@ -162,11 +164,10 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const double& photon_ | @@ -162,11 +164,10 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const double& photon_ | ||
| 162 | * @param[in] xml XML element. | 164 | * @param[in] xml XML element. |
| 163 | * | 165 | * |
| 164 | * Constructs flux normalized power law spectral model by extracting | 166 | * Constructs flux normalized power law spectral model by extracting |
| 165 | - * information from an XML element. See the read() method for more | ||
| 166 | - * information about the expected structure of the XML element. | 167 | + * information from an XML element. |
| 167 | ***************************************************************************/ | 168 | ***************************************************************************/ |
| 168 | GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const GXmlElement& xml) : | 169 | GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const GXmlElement& xml) : |
| 169 | - GModelSpectral() | 170 | + GModelSpectral() |
| 170 | { | 171 | { |
| 171 | // Initialise members | 172 | // Initialise members |
| 172 | init_members(); | 173 | init_members(); |
| @@ -185,7 +186,7 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const GXmlElement& xm | @@ -185,7 +186,7 @@ GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const GXmlElement& xm | ||
| 185 | * @param[in] model Spectral power law model. | 186 | * @param[in] model Spectral power law model. |
| 186 | ***************************************************************************/ | 187 | ***************************************************************************/ |
| 187 | GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const GModelSpectralPlawPhotonFlux& model) : | 188 | GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(const GModelSpectralPlawPhotonFlux& model) : |
| 188 | - GModelSpectral(model) | 189 | + GModelSpectral(model) |
| 189 | { | 190 | { |
| 190 | // Initialise members | 191 | // Initialise members |
| 191 | init_members(); | 192 | init_members(); |
| @@ -293,7 +294,7 @@ GModelSpectralPlawPhotonFlux* GModelSpectralPlawPhotonFlux::clone(void) const | @@ -293,7 +294,7 @@ GModelSpectralPlawPhotonFlux* GModelSpectralPlawPhotonFlux::clone(void) const | ||
| 293 | * Computes | 294 | * Computes |
| 294 | * | 295 | * |
| 295 | * \f[ | 296 | * \f[ |
| 296 | - * S_{\rm E}(E | t) = {\tt m\_photon\_flux} | 297 | + * S_{\rm E}(E | t) = {\tt m\_flux} |
| 297 | * \frac{{\tt m\_index}+1} | 298 | * \frac{{\tt m\_index}+1} |
| 298 | * {{\tt e\_max}^{{\tt m\_index}+1} - | 299 | * {{\tt e\_max}^{{\tt m\_index}+1} - |
| 299 | * {\tt e\_min}^{{\tt m\_index}+1}} | 300 | * {\tt e\_min}^{{\tt m\_index}+1}} |
| @@ -304,7 +305,7 @@ GModelSpectralPlawPhotonFlux* GModelSpectralPlawPhotonFlux::clone(void) const | @@ -304,7 +305,7 @@ GModelSpectralPlawPhotonFlux* GModelSpectralPlawPhotonFlux::clone(void) const | ||
| 304 | * | 305 | * |
| 305 | * \f[ | 306 | * \f[ |
| 306 | * S_{\rm E}(E | t) = | 307 | * S_{\rm E}(E | t) = |
| 307 | - * \frac{{\tt m\_photon\_flux}} | 308 | + * \frac{{\tt m\_flux}} |
| 308 | * {\log {\tt e\_max} - \log {\tt e\_min}} | 309 | * {\log {\tt e\_max} - \log {\tt e\_min}} |
| 309 | * E^{\tt m\_index} | 310 | * E^{\tt m\_index} |
| 310 | * \f] | 311 | * \f] |
| @@ -312,18 +313,18 @@ GModelSpectralPlawPhotonFlux* GModelSpectralPlawPhotonFlux::clone(void) const | @@ -312,18 +313,18 @@ GModelSpectralPlawPhotonFlux* GModelSpectralPlawPhotonFlux::clone(void) const | ||
| 312 | * for \f${\tt m\_index} = -1\f$, where | 313 | * for \f${\tt m\_index} = -1\f$, where |
| 313 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, | 314 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, |
| 314 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, | 315 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, |
| 315 | - * - \f${\tt m\_photon\_flux}\f$ is the photon flux flux between | 316 | + * - \f${\tt m\_flux}\f$ is the photon flux between |
| 316 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and | 317 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and |
| 317 | * - \f${\tt m\_index}\f$ is the spectral index. | 318 | * - \f${\tt m\_index}\f$ is the spectral index. |
| 318 | ***************************************************************************/ | 319 | ***************************************************************************/ |
| 319 | double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | 320 | double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, |
| 320 | - const GTime& srcTime) const | 321 | + const GTime& srcTime) const |
| 321 | { | 322 | { |
| 322 | // Update precomputed values | 323 | // Update precomputed values |
| 323 | update(srcEng); | 324 | update(srcEng); |
| 324 | 325 | ||
| 325 | // Compute function value | 326 | // Compute function value |
| 326 | - double value = m_photon_flux.value() * m_norm * m_power; | 327 | + double value = m_flux.value() * m_norm * m_power; |
| 327 | 328 | ||
| 328 | // Compile option: Check for NaN/Inf | 329 | // Compile option: Check for NaN/Inf |
| 329 | #if defined(G_NAN_CHECK) | 330 | #if defined(G_NAN_CHECK) |
| @@ -333,7 +334,7 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | @@ -333,7 +334,7 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | ||
| 333 | std::cout << ", srcTime=" << srcTime << "):"; | 334 | std::cout << ", srcTime=" << srcTime << "):"; |
| 334 | std::cout << " NaN/Inf encountered"; | 335 | std::cout << " NaN/Inf encountered"; |
| 335 | std::cout << " (value=" << value; | 336 | std::cout << " (value=" << value; |
| 336 | - std::cout << ", photon_flux=" << photon_flux(); | 337 | + std::cout << ", flux=" << flux(); |
| 337 | std::cout << ", m_norm=" << m_norm; | 338 | std::cout << ", m_norm=" << m_norm; |
| 338 | std::cout << ", m_power=" << m_power; | 339 | std::cout << ", m_power=" << m_power; |
| 339 | std::cout << ")" << std::endl; | 340 | std::cout << ")" << std::endl; |
| @@ -355,7 +356,7 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | @@ -355,7 +356,7 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | ||
| 355 | * Computes | 356 | * Computes |
| 356 | * | 357 | * |
| 357 | * \f[ | 358 | * \f[ |
| 358 | - * S_{\rm E}(E | t) = {\tt m\_photon\_flux} | 359 | + * S_{\rm E}(E | t) = {\tt m\_flux} |
| 359 | * \frac{{\tt m\_index}+1} | 360 | * \frac{{\tt m\_index}+1} |
| 360 | * {{\tt e\_max}^{{\tt m\_index}+1} - | 361 | * {{\tt e\_max}^{{\tt m\_index}+1} - |
| 361 | * {\tt e\_min}^{{\tt m\_index}+1}} | 362 | * {\tt e\_min}^{{\tt m\_index}+1}} |
| @@ -366,7 +367,7 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | @@ -366,7 +367,7 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | ||
| 366 | * | 367 | * |
| 367 | * \f[ | 368 | * \f[ |
| 368 | * S_{\rm E}(E | t) = | 369 | * S_{\rm E}(E | t) = |
| 369 | - * \frac{{\ttm\_photon\_flux}} | 370 | + * \frac{{\tt m\_flux}} |
| 370 | * {\log {\tt e\_max} - \log {\tt e\_min}} | 371 | * {\log {\tt e\_max} - \log {\tt e\_min}} |
| 371 | * E^{\tt m\_index} | 372 | * E^{\tt m\_index} |
| 372 | * \f] | 373 | * \f] |
| @@ -374,7 +375,7 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | @@ -374,7 +375,7 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | ||
| 374 | * for \f${\tt m\_index} = -1\f$, where | 375 | * for \f${\tt m\_index} = -1\f$, where |
| 375 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, | 376 | * - \f${\tt e\_min}\f$ is the minimum energy of an interval, |
| 376 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, | 377 | * - \f${\tt e\_max}\f$ is the maximum energy of an interval, |
| 377 | - * - \f${\tt m\_photon\_flux}\f$ is the photon flux between | 378 | + * - \f${\tt m\_flux}\f$ is the photon flux between |
| 378 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and | 379 | * \f${\tt e\_min}\f$ and \f${\tt e\_max}\f$, and |
| 379 | * - \f${\tt m\_index}\f$ is the spectral index. | 380 | * - \f${\tt m\_index}\f$ is the spectral index. |
| 380 | * | 381 | * |
| @@ -382,8 +383,8 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | @@ -382,8 +383,8 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | ||
| 382 | * respect to the parameters using | 383 | * respect to the parameters using |
| 383 | * | 384 | * |
| 384 | * \f[ | 385 | * \f[ |
| 385 | - * \frac{\delta S_{\rm E}(E | t)}{\delta {\tt m\_photon\_flux}} = | ||
| 386 | - * \frac{S_{\rm E}(E | t)}{{\tt m\_photon\_flux}} | 386 | + * \frac{\delta S_{\rm E}(E | t)}{\delta {\tt m\_flux}} = |
| 387 | + * \frac{S_{\rm E}(E | t)}{{\tt m\_flux}} | ||
| 387 | * \f] | 388 | * \f] |
| 388 | * | 389 | * |
| 389 | * \f[ | 390 | * \f[ |
| @@ -409,21 +410,21 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | @@ -409,21 +410,21 @@ double GModelSpectralPlawPhotonFlux::eval(const GEnergy& srcEng, | ||
| 409 | * No partial derivatives are supported for the energy boundaries. | 410 | * No partial derivatives are supported for the energy boundaries. |
| 410 | ***************************************************************************/ | 411 | ***************************************************************************/ |
| 411 | double GModelSpectralPlawPhotonFlux::eval_gradients(const GEnergy& srcEng, | 412 | double GModelSpectralPlawPhotonFlux::eval_gradients(const GEnergy& srcEng, |
| 412 | - const GTime& srcTime) | 413 | + const GTime& srcTime) |
| 413 | { | 414 | { |
| 414 | // Initialise gradients | 415 | // Initialise gradients |
| 415 | - double g_photon_flux = 0.0; | ||
| 416 | - double g_index = 0.0; | 416 | + double g_flux = 0.0; |
| 417 | + double g_index = 0.0; | ||
| 417 | 418 | ||
| 418 | // Update precomputed values | 419 | // Update precomputed values |
| 419 | update(srcEng); | 420 | update(srcEng); |
| 420 | 421 | ||
| 421 | // Compute function value | 422 | // Compute function value |
| 422 | - double value = m_photon_flux.value() * m_norm * m_power; | 423 | + double value = m_flux.value() * m_norm * m_power; |
| 423 | 424 | ||
| 424 | // Photon flux gradient | 425 | // Photon flux gradient |
| 425 | - if (m_photon_flux.is_free() && m_photon_flux.factor_value() > 0.0) { | ||
| 426 | - g_photon_flux = value / m_photon_flux.factor_value(); | 426 | + if (m_flux.is_free() && m_flux.factor_value() > 0.0) { |
| 427 | + g_flux = value / m_flux.factor_value(); | ||
| 427 | } | 428 | } |
| 428 | 429 | ||
| 429 | // Index gradient | 430 | // Index gradient |
| @@ -433,7 +434,7 @@ double GModelSpectralPlawPhotonFlux::eval_gradients(const GEnergy& srcEng, | @@ -433,7 +434,7 @@ double GModelSpectralPlawPhotonFlux::eval_gradients(const GEnergy& srcEng, | ||
| 433 | } | 434 | } |
| 434 | 435 | ||
| 435 | // Set gradients | 436 | // Set gradients |
| 436 | - m_photon_flux.factor_gradient(g_photon_flux); | 437 | + m_flux.factor_gradient(g_flux); |
| 437 | m_index.factor_gradient(g_index); | 438 | m_index.factor_gradient(g_index); |
| 438 | 439 | ||
| 439 | // Compile option: Check for NaN/Inf | 440 | // Compile option: Check for NaN/Inf |
| @@ -444,10 +445,10 @@ double GModelSpectralPlawPhotonFlux::eval_gradients(const GEnergy& srcEng, | @@ -444,10 +445,10 @@ double GModelSpectralPlawPhotonFlux::eval_gradients(const GEnergy& srcEng, | ||
| 444 | std::cout << ", srcTime=" << srcTime << "):"; | 445 | std::cout << ", srcTime=" << srcTime << "):"; |
| 445 | std::cout << " NaN/Inf encountered"; | 446 | std::cout << " NaN/Inf encountered"; |
| 446 | std::cout << " (value=" << value; | 447 | std::cout << " (value=" << value; |
| 447 | - std::cout << ", photon_flux=" << photon_flux(); | 448 | + std::cout << ", flux=" << flux(); |
| 448 | std::cout << ", m_norm=" << m_norm; | 449 | std::cout << ", m_norm=" << m_norm; |
| 449 | std::cout << ", m_power=" << m_power; | 450 | std::cout << ", m_power=" << m_power; |
| 450 | - std::cout << ", g_photon_flux=" << g_photon_flux; | 451 | + std::cout << ", g_flux=" << g_flux; |
| 451 | std::cout << ", g_index=" << g_index; | 452 | std::cout << ", g_index=" << g_index; |
| 452 | std::cout << ")" << std::endl; | 453 | std::cout << ")" << std::endl; |
| 453 | } | 454 | } |
| @@ -476,7 +477,7 @@ double GModelSpectralPlawPhotonFlux::eval_gradients(const GEnergy& srcEng, | @@ -476,7 +477,7 @@ double GModelSpectralPlawPhotonFlux::eval_gradients(const GEnergy& srcEng, | ||
| 476 | * - \f$S_{\rm E}(E | t)\f$ is the spectral model (ph/cm2/s/MeV). | 477 | * - \f$S_{\rm E}(E | t)\f$ is the spectral model (ph/cm2/s/MeV). |
| 477 | ***************************************************************************/ | 478 | ***************************************************************************/ |
| 478 | double GModelSpectralPlawPhotonFlux::flux(const GEnergy& emin, | 479 | double GModelSpectralPlawPhotonFlux::flux(const GEnergy& emin, |
| 479 | - const GEnergy& emax) const | 480 | + const GEnergy& emax) const |
| 480 | { | 481 | { |
| 481 | // Initialise flux | 482 | // Initialise flux |
| 482 | double flux = 0.0; | 483 | double flux = 0.0; |
| @@ -493,7 +494,7 @@ double GModelSpectralPlawPhotonFlux::flux(const GEnergy& emin, | @@ -493,7 +494,7 @@ double GModelSpectralPlawPhotonFlux::flux(const GEnergy& emin, | ||
| 493 | double pow_ref_emax = std::pow(this->emax().MeV(), gamma); | 494 | double pow_ref_emax = std::pow(this->emax().MeV(), gamma); |
| 494 | double factor = (pow_emax - pow_emin) / | 495 | double factor = (pow_emax - pow_emin) / |
| 495 | (pow_ref_emax - pow_ref_emin); | 496 | (pow_ref_emax - pow_ref_emin); |
| 496 | - flux = m_photon_flux.value() * factor; | 497 | + flux = m_flux.value() * factor; |
| 497 | } | 498 | } |
| 498 | 499 | ||
| 499 | // Case B: Index is -1 | 500 | // Case B: Index is -1 |
| @@ -504,7 +505,7 @@ double GModelSpectralPlawPhotonFlux::flux(const GEnergy& emin, | @@ -504,7 +505,7 @@ double GModelSpectralPlawPhotonFlux::flux(const GEnergy& emin, | ||
| 504 | double log_ref_emax = std::log(this->emax().MeV()); | 505 | double log_ref_emax = std::log(this->emax().MeV()); |
| 505 | double factor = (log_emax - log_emin) / | 506 | double factor = (log_emax - log_emin) / |
| 506 | (log_ref_emax - log_ref_emin); | 507 | (log_ref_emax - log_ref_emin); |
| 507 | - flux = m_photon_flux.value() * factor; | 508 | + flux = m_flux.value() * factor; |
| 508 | } | 509 | } |
| 509 | 510 | ||
| 510 | } // endif: integration range was valid | 511 | } // endif: integration range was valid |
| @@ -515,11 +516,11 @@ double GModelSpectralPlawPhotonFlux::flux(const GEnergy& emin, | @@ -515,11 +516,11 @@ double GModelSpectralPlawPhotonFlux::flux(const GEnergy& emin, | ||
| 515 | 516 | ||
| 516 | 517 | ||
| 517 | /***********************************************************************//** | 518 | /***********************************************************************//** |
| 518 | - * @brief Returns model energy flux between [emin, emax] (units: ph/cm2/s) | 519 | + * @brief Returns model energy flux between [emin, emax] (units: erg/cm2/s) |
| 519 | * | 520 | * |
| 520 | * @param[in] emin Minimum photon energy. | 521 | * @param[in] emin Minimum photon energy. |
| 521 | * @param[in] emax Minimum photon energy. | 522 | * @param[in] emax Minimum photon energy. |
| 522 | - * @return Photon flux (ph/cm2/s). | 523 | + * @return Energy flux (erg/cm2/s). |
| 523 | * | 524 | * |
| 524 | * Computes | 525 | * Computes |
| 525 | * | 526 | * |
| @@ -532,7 +533,7 @@ double GModelSpectralPlawPhotonFlux::flux(const GEnergy& emin, | @@ -532,7 +533,7 @@ double GModelSpectralPlawPhotonFlux::flux(const GEnergy& emin, | ||
| 532 | * - \f$S_{\rm E}(E | t)\f$ is the spectral model (ph/cm2/s/MeV). | 533 | * - \f$S_{\rm E}(E | t)\f$ is the spectral model (ph/cm2/s/MeV). |
| 533 | ***************************************************************************/ | 534 | ***************************************************************************/ |
| 534 | double GModelSpectralPlawPhotonFlux::eflux(const GEnergy& emin, | 535 | double GModelSpectralPlawPhotonFlux::eflux(const GEnergy& emin, |
| 535 | - const GEnergy& emax) const | 536 | + const GEnergy& emax) const |
| 536 | { | 537 | { |
| 537 | // Initialise flux | 538 | // Initialise flux |
| 538 | double eflux = 0.0; | 539 | double eflux = 0.0; |
| @@ -546,12 +547,12 @@ double GModelSpectralPlawPhotonFlux::eflux(const GEnergy& emin, | @@ -546,12 +547,12 @@ double GModelSpectralPlawPhotonFlux::eflux(const GEnergy& emin, | ||
| 546 | double gamma = m_index.value() + 1.0; | 547 | double gamma = m_index.value() + 1.0; |
| 547 | double pow_ref_emin = std::pow(this->emin().MeV(), gamma); | 548 | double pow_ref_emin = std::pow(this->emin().MeV(), gamma); |
| 548 | double pow_ref_emax = std::pow(this->emax().MeV(), gamma); | 549 | double pow_ref_emax = std::pow(this->emax().MeV(), gamma); |
| 549 | - norm = m_photon_flux.value() * gamma / (pow_ref_emax - pow_ref_emin); | 550 | + norm = m_flux.value() * gamma / (pow_ref_emax - pow_ref_emin); |
| 550 | } | 551 | } |
| 551 | else { | 552 | else { |
| 552 | double log_ref_emin = std::log(this->emin().MeV()); | 553 | double log_ref_emin = std::log(this->emin().MeV()); |
| 553 | double log_ref_emax = std::log(this->emax().MeV()); | 554 | double log_ref_emax = std::log(this->emax().MeV()); |
| 554 | - norm = m_photon_flux.value() / (log_ref_emax - log_ref_emin); | 555 | + norm = m_flux.value() / (log_ref_emax - log_ref_emin); |
| 555 | } | 556 | } |
| 556 | 557 | ||
| 557 | // Compute energy flux | 558 | // Compute energy flux |
| @@ -594,9 +595,9 @@ double GModelSpectralPlawPhotonFlux::eflux(const GEnergy& emin, | @@ -594,9 +595,9 @@ double GModelSpectralPlawPhotonFlux::eflux(const GEnergy& emin, | ||
| 594 | * Returns Monte Carlo energy by randomly drawing from a power law. | 595 | * Returns Monte Carlo energy by randomly drawing from a power law. |
| 595 | ***************************************************************************/ | 596 | ***************************************************************************/ |
| 596 | GEnergy GModelSpectralPlawPhotonFlux::mc(const GEnergy& emin, | 597 | GEnergy GModelSpectralPlawPhotonFlux::mc(const GEnergy& emin, |
| 597 | - const GEnergy& emax, | ||
| 598 | - const GTime& time, | ||
| 599 | - GRan& ran) const | 598 | + const GEnergy& emax, |
| 599 | + const GTime& time, | ||
| 600 | + GRan& ran) const | ||
| 600 | { | 601 | { |
| 601 | // Throw an exception if energy range is invalid | 602 | // Throw an exception if energy range is invalid |
| 602 | if (emin >= emax) { | 603 | if (emin >= emax) { |
| @@ -643,13 +644,13 @@ GEnergy GModelSpectralPlawPhotonFlux::mc(const GEnergy& emin, | @@ -643,13 +644,13 @@ GEnergy GModelSpectralPlawPhotonFlux::mc(const GEnergy& emin, | ||
| 643 | void GModelSpectralPlawPhotonFlux::read(const GXmlElement& xml) | 644 | void GModelSpectralPlawPhotonFlux::read(const GXmlElement& xml) |
| 644 | { | 645 | { |
| 645 | // Get parameter pointers | 646 | // Get parameter pointers |
| 646 | - const GXmlElement* phflux = gammalib::xml_get_par(G_READ, xml, m_photon_flux.name()); | ||
| 647 | - const GXmlElement* index = gammalib::xml_get_par(G_READ, xml, m_index.name()); | ||
| 648 | - const GXmlElement* emin = gammalib::xml_get_par(G_READ, xml, m_emin.name()); | ||
| 649 | - const GXmlElement* emax = gammalib::xml_get_par(G_READ, xml, m_emax.name()); | 647 | + const GXmlElement* flux = gammalib::xml_get_par(G_READ, xml, m_flux.name()); |
| 648 | + const GXmlElement* index = gammalib::xml_get_par(G_READ, xml, m_index.name()); | ||
| 649 | + const GXmlElement* emin = gammalib::xml_get_par(G_READ, xml, m_emin.name()); | ||
| 650 | + const GXmlElement* emax = gammalib::xml_get_par(G_READ, xml, m_emax.name()); | ||
| 650 | 651 | ||
| 651 | // Read parameters | 652 | // Read parameters |
| 652 | - m_photon_flux.read(*phflux); | 653 | + m_flux.read(*flux); |
| 653 | m_index.read(*index); | 654 | m_index.read(*index); |
| 654 | m_emin.read(*emin); | 655 | m_emin.read(*emin); |
| 655 | m_emax.read(*emax); | 656 | m_emax.read(*emax); |
| @@ -683,13 +684,13 @@ void GModelSpectralPlawPhotonFlux::write(GXmlElement& xml) const | @@ -683,13 +684,13 @@ void GModelSpectralPlawPhotonFlux::write(GXmlElement& xml) const | ||
| 683 | } | 684 | } |
| 684 | 685 | ||
| 685 | // Get XML parameters | 686 | // Get XML parameters |
| 686 | - GXmlElement* phflux = gammalib::xml_need_par(G_WRITE, xml, m_photon_flux.name()); | ||
| 687 | - GXmlElement* index = gammalib::xml_need_par(G_WRITE, xml, m_index.name()); | ||
| 688 | - GXmlElement* emin = gammalib::xml_need_par(G_WRITE, xml, m_emin.name()); | ||
| 689 | - GXmlElement* emax = gammalib::xml_need_par(G_WRITE, xml, m_emax.name()); | 687 | + GXmlElement* flux = gammalib::xml_need_par(G_WRITE, xml, m_flux.name()); |
| 688 | + GXmlElement* index = gammalib::xml_need_par(G_WRITE, xml, m_index.name()); | ||
| 689 | + GXmlElement* emin = gammalib::xml_need_par(G_WRITE, xml, m_emin.name()); | ||
| 690 | + GXmlElement* emax = gammalib::xml_need_par(G_WRITE, xml, m_emax.name()); | ||
| 690 | 691 | ||
| 691 | // Write parameters | 692 | // Write parameters |
| 692 | - m_photon_flux.write(*phflux); | 693 | + m_flux.write(*flux); |
| 693 | m_index.write(*index); | 694 | m_index.write(*index); |
| 694 | m_emin.write(*emin); | 695 | m_emin.write(*emin); |
| 695 | m_emax.write(*emax); | 696 | m_emax.write(*emax); |
| @@ -702,7 +703,7 @@ void GModelSpectralPlawPhotonFlux::write(GXmlElement& xml) const | @@ -702,7 +703,7 @@ void GModelSpectralPlawPhotonFlux::write(GXmlElement& xml) const | ||
| 702 | /***********************************************************************//** | 703 | /***********************************************************************//** |
| 703 | * @brief Print power law information | 704 | * @brief Print power law information |
| 704 | * | 705 | * |
| 705 | - * @param[in] chatter Chattiness (defaults to NORMAL). | 706 | + * @param[in] chatter Chattiness. |
| 706 | * @return String containing power law information. | 707 | * @return String containing power law information. |
| 707 | ***************************************************************************/ | 708 | ***************************************************************************/ |
| 708 | std::string GModelSpectralPlawPhotonFlux::print(const GChatter& chatter) const | 709 | std::string GModelSpectralPlawPhotonFlux::print(const GChatter& chatter) const |
| @@ -745,15 +746,15 @@ void GModelSpectralPlawPhotonFlux::init_members(void) | @@ -745,15 +746,15 @@ void GModelSpectralPlawPhotonFlux::init_members(void) | ||
| 745 | m_type = "PowerLaw"; | 746 | m_type = "PowerLaw"; |
| 746 | 747 | ||
| 747 | // Initialise photon flux | 748 | // Initialise photon flux |
| 748 | - m_photon_flux.clear(); | ||
| 749 | - m_photon_flux.name("PhotonFlux"); | ||
| 750 | - m_photon_flux.unit("ph/cm2/s"); | ||
| 751 | - m_photon_flux.scale(1.0); | ||
| 752 | - m_photon_flux.value(1.0); // default: 1.0 | ||
| 753 | - m_photon_flux.range(0.0, 10.0); // range: [0,10] | ||
| 754 | - m_photon_flux.free(); | ||
| 755 | - m_photon_flux.gradient(0.0); | ||
| 756 | - m_photon_flux.has_grad(true); | 749 | + m_flux.clear(); |
| 750 | + m_flux.name("PhotonFlux"); | ||
| 751 | + m_flux.unit("ph/cm2/s"); | ||
| 752 | + m_flux.scale(1.0); | ||
| 753 | + m_flux.value(1.0); // default: 1.0 | ||
| 754 | + m_flux.range(0.0, 10.0); // range: [0,10] | ||
| 755 | + m_flux.free(); | ||
| 756 | + m_flux.gradient(0.0); | ||
| 757 | + m_flux.has_grad(true); | ||
| 757 | 758 | ||
| 758 | // Initialise powerlaw index | 759 | // Initialise powerlaw index |
| 759 | m_index.clear(); | 760 | m_index.clear(); |
| @@ -789,26 +790,22 @@ void GModelSpectralPlawPhotonFlux::init_members(void) | @@ -789,26 +790,22 @@ void GModelSpectralPlawPhotonFlux::init_members(void) | ||
| 789 | 790 | ||
| 790 | // Set parameter pointer(s) | 791 | // Set parameter pointer(s) |
| 791 | m_pars.clear(); | 792 | m_pars.clear(); |
| 792 | - m_pars.push_back(&m_photon_flux); | 793 | + m_pars.push_back(&m_flux); |
| 793 | m_pars.push_back(&m_index); | 794 | m_pars.push_back(&m_index); |
| 794 | m_pars.push_back(&m_emin); | 795 | m_pars.push_back(&m_emin); |
| 795 | m_pars.push_back(&m_emax); | 796 | m_pars.push_back(&m_emax); |
| 796 | 797 | ||
| 797 | // Initialise last parameters (for fast computation) | 798 | // Initialise last parameters (for fast computation) |
| 798 | - m_log_emin = 0.0; | ||
| 799 | - m_log_emax = 0.0; | ||
| 800 | - m_pow_emin = 0.0; | ||
| 801 | - m_pow_emax = 0.0; | ||
| 802 | - m_norm = 0.0; | ||
| 803 | - m_power = 0.0; | ||
| 804 | - m_last_phflux = 0.0; | ||
| 805 | - m_last_index = 1000.0; | 799 | + m_log_emin = 0.0; |
| 800 | + m_log_emax = 0.0; | ||
| 801 | + m_pow_emin = 0.0; | ||
| 802 | + m_pow_emax = 0.0; | ||
| 803 | + m_norm = 0.0; | ||
| 804 | + m_power = 0.0; | ||
| 805 | + m_last_index = 1000.0; | ||
| 806 | m_last_emin.MeV(0.0); | 806 | m_last_emin.MeV(0.0); |
| 807 | m_last_emax.MeV(0.0); | 807 | m_last_emax.MeV(0.0); |
| 808 | m_last_energy.MeV(0.0); | 808 | m_last_energy.MeV(0.0); |
| 809 | - m_last_value = 0.0; | ||
| 810 | - m_last_g_phflux = 0.0; | ||
| 811 | - m_last_g_index = 0.0; | ||
| 812 | 809 | ||
| 813 | // Return | 810 | // Return |
| 814 | return; | 811 | return; |
| @@ -823,34 +820,30 @@ void GModelSpectralPlawPhotonFlux::init_members(void) | @@ -823,34 +820,30 @@ void GModelSpectralPlawPhotonFlux::init_members(void) | ||
| 823 | void GModelSpectralPlawPhotonFlux::copy_members(const GModelSpectralPlawPhotonFlux& model) | 820 | void GModelSpectralPlawPhotonFlux::copy_members(const GModelSpectralPlawPhotonFlux& model) |
| 824 | { | 821 | { |
| 825 | // Copy members | 822 | // Copy members |
| 826 | - m_type = model.m_type; | ||
| 827 | - m_photon_flux = model.m_photon_flux; | ||
| 828 | - m_index = model.m_index; | ||
| 829 | - m_emin = model.m_emin; | ||
| 830 | - m_emax = model.m_emax; | 823 | + m_type = model.m_type; |
| 824 | + m_flux = model.m_flux; | ||
| 825 | + m_index = model.m_index; | ||
| 826 | + m_emin = model.m_emin; | ||
| 827 | + m_emax = model.m_emax; | ||
| 831 | 828 | ||
| 832 | // Set parameter pointer(s) | 829 | // Set parameter pointer(s) |
| 833 | m_pars.clear(); | 830 | m_pars.clear(); |
| 834 | - m_pars.push_back(&m_photon_flux); | 831 | + m_pars.push_back(&m_flux); |
| 835 | m_pars.push_back(&m_index); | 832 | m_pars.push_back(&m_index); |
| 836 | m_pars.push_back(&m_emin); | 833 | m_pars.push_back(&m_emin); |
| 837 | m_pars.push_back(&m_emax); | 834 | m_pars.push_back(&m_emax); |
| 838 | 835 | ||
| 839 | // Copy bookkeeping information | 836 | // Copy bookkeeping information |
| 840 | - m_log_emin = model.m_log_emin; | ||
| 841 | - m_log_emax = model.m_log_emax; | ||
| 842 | - m_pow_emin = model.m_pow_emin; | ||
| 843 | - m_pow_emax = model.m_pow_emax; | ||
| 844 | - m_norm = model.m_norm; | ||
| 845 | - m_power = model.m_power; | ||
| 846 | - m_last_phflux = model.m_last_phflux; | ||
| 847 | - m_last_index = model.m_last_index; | ||
| 848 | - m_last_emin = model.m_last_emin; | ||
| 849 | - m_last_emax = model.m_last_emax; | ||
| 850 | - m_last_energy = model.m_last_energy; | ||
| 851 | - m_last_value = model.m_last_value; | ||
| 852 | - m_last_g_phflux = model.m_last_g_phflux; | ||
| 853 | - m_last_g_index = model.m_last_g_index; | 837 | + m_log_emin = model.m_log_emin; |
| 838 | + m_log_emax = model.m_log_emax; | ||
| 839 | + m_pow_emin = model.m_pow_emin; | ||
| 840 | + m_pow_emax = model.m_pow_emax; | ||
| 841 | + m_norm = model.m_norm; | ||
| 842 | + m_power = model.m_power; | ||
| 843 | + m_last_index = model.m_last_index; | ||
| 844 | + m_last_emin = model.m_last_emin; | ||
| 845 | + m_last_emax = model.m_last_emax; | ||
| 846 | + m_last_energy = model.m_last_energy; | ||
| 854 | 847 | ||
| 855 | // Return | 848 | // Return |
| 856 | return; | 849 | return; |
test/test_GModel.cpp
| @@ -1563,26 +1563,27 @@ void TestGModel::test_plaw_phflux(void) | @@ -1563,26 +1563,27 @@ void TestGModel::test_plaw_phflux(void) | ||
| 1563 | test_value(model1.type(), "PowerLaw", "Check type of void model"); | 1563 | test_value(model1.type(), "PowerLaw", "Check type of void model"); |
| 1564 | 1564 | ||
| 1565 | // Test value constructor | 1565 | // Test value constructor |
| 1566 | - GModelSpectralPlawPhotonFlux model2(2.0, -2.1, GEnergy(10.0, "MeV"), GEnergy(100.0, "MeV")); | ||
| 1567 | - test_value(model2.photon_flux(), 2.0); | 1566 | + GModelSpectralPlawPhotonFlux model2(2.0, -2.1, GEnergy(10.0, "MeV"), |
| 1567 | + GEnergy(100.0, "MeV")); | ||
| 1568 | + test_value(model2.flux(), 2.0); | ||
| 1568 | test_value(model2.index(), -2.1); | 1569 | test_value(model2.index(), -2.1); |
| 1569 | test_value(model2.emin().MeV(), 10.0); | 1570 | test_value(model2.emin().MeV(), 10.0); |
| 1570 | test_value(model2.emax().MeV(), 100.0); | 1571 | test_value(model2.emax().MeV(), 100.0); |
| 1571 | 1572 | ||
| 1572 | // Test XML constructor and value | 1573 | // Test XML constructor and value |
| 1573 | - GXml xml(m_xml_model_point_plaw_phflux); | ||
| 1574 | - GXmlElement* element = xml.element(0)->element(0)->element("spectrum", 0); | 1574 | + GXml xml(m_xml_model_point_plaw_phflux); |
| 1575 | + GXmlElement* element = xml.element(0)->element(0)->element("spectrum", 0); | ||
| 1575 | GModelSpectralPlawPhotonFlux model3(*element); | 1576 | GModelSpectralPlawPhotonFlux model3(*element); |
| 1576 | test_value(model3.size(), 4); | 1577 | test_value(model3.size(), 4); |
| 1577 | test_value(model3.type(), "PowerLaw", "Check model type"); | 1578 | test_value(model3.type(), "PowerLaw", "Check model type"); |
| 1578 | - test_value(model3.photon_flux(), 1.0e-7); | 1579 | + test_value(model3.flux(), 1.0e-7); |
| 1579 | test_value(model3.index(), -2.0); | 1580 | test_value(model3.index(), -2.0); |
| 1580 | test_value(model3.emin().MeV(), 100.0); | 1581 | test_value(model3.emin().MeV(), 100.0); |
| 1581 | test_value(model3.emax().MeV(), 500000.0); | 1582 | test_value(model3.emax().MeV(), 500000.0); |
| 1582 | 1583 | ||
| 1583 | // Test integral method | 1584 | // Test integral method |
| 1584 | - model3.photon_flux(2.1e-7); | ||
| 1585 | - test_value(model3.photon_flux(), 2.1e-7); | 1585 | + model3.flux(2.1e-7); |
| 1586 | + test_value(model3.flux(), 2.1e-7); | ||
| 1586 | 1587 | ||
| 1587 | // Test index method | 1588 | // Test index method |
| 1588 | model3.index(-2.3); | 1589 | model3.index(-2.3); |
| @@ -1624,26 +1625,27 @@ void TestGModel::test_plaw_eflux(void) | @@ -1624,26 +1625,27 @@ void TestGModel::test_plaw_eflux(void) | ||
| 1624 | test_value(model1.type(), "PowerLaw", "Check type of void model"); | 1625 | test_value(model1.type(), "PowerLaw", "Check type of void model"); |
| 1625 | 1626 | ||
| 1626 | // Test value constructor | 1627 | // Test value constructor |
| 1627 | - GModelSpectralPlawEnergyFlux model2(2.0, -2.1, GEnergy(10.0, "MeV"), GEnergy(100.0, "MeV")); | ||
| 1628 | - test_value(model2.energy_flux(), 2.0); | 1628 | + GModelSpectralPlawEnergyFlux model2(2.0, -2.1, GEnergy(10.0, "MeV"), |
| 1629 | + GEnergy(100.0, "MeV")); | ||
| 1630 | + test_value(model2.eflux(), 2.0); | ||
| 1629 | test_value(model2.index(), -2.1); | 1631 | test_value(model2.index(), -2.1); |
| 1630 | test_value(model2.emin().MeV(), 10.0); | 1632 | test_value(model2.emin().MeV(), 10.0); |
| 1631 | test_value(model2.emax().MeV(), 100.0); | 1633 | test_value(model2.emax().MeV(), 100.0); |
| 1632 | 1634 | ||
| 1633 | // Test XML constructor and value | 1635 | // Test XML constructor and value |
| 1634 | - GXml xml(m_xml_model_point_plaw_eflux); | ||
| 1635 | - GXmlElement* element = xml.element(0)->element(0)->element("spectrum", 0); | 1636 | + GXml xml(m_xml_model_point_plaw_eflux); |
| 1637 | + GXmlElement* element = xml.element(0)->element(0)->element("spectrum", 0); | ||
| 1636 | GModelSpectralPlawEnergyFlux model3(*element); | 1638 | GModelSpectralPlawEnergyFlux model3(*element); |
| 1637 | test_value(model3.size(), 4); | 1639 | test_value(model3.size(), 4); |
| 1638 | test_value(model3.type(), "PowerLaw", "Check model type"); | 1640 | test_value(model3.type(), "PowerLaw", "Check model type"); |
| 1639 | - test_value(model3.energy_flux(), 1.0e-7); | 1641 | + test_value(model3.eflux(), 1.0e-7); |
| 1640 | test_value(model3.index(), -2.0); | 1642 | test_value(model3.index(), -2.0); |
| 1641 | test_value(model3.emin().MeV(), 100.0); | 1643 | test_value(model3.emin().MeV(), 100.0); |
| 1642 | test_value(model3.emax().MeV(), 500000.0); | 1644 | test_value(model3.emax().MeV(), 500000.0); |
| 1643 | 1645 | ||
| 1644 | // Test integral method | 1646 | // Test integral method |
| 1645 | - model3.energy_flux(2.1e-7); | ||
| 1646 | - test_value(model3.energy_flux(), 2.1e-7); | 1647 | + model3.eflux(2.1e-7); |
| 1648 | + test_value(model3.eflux(), 2.1e-7); | ||
| 1647 | 1649 | ||
| 1648 | // Test index method | 1650 | // Test index method |
| 1649 | model3.index(-2.3); | 1651 | model3.index(-2.3); |
| @@ -2894,7 +2896,7 @@ void TestGModel::test_legacy_model_point_plaw2(void) | @@ -2894,7 +2896,7 @@ void TestGModel::test_legacy_model_point_plaw2(void) | ||
| 2894 | 2896 | ||
| 2895 | // Test model values | 2897 | // Test model values |
| 2896 | test_value(spectral->type(), "PowerLaw2", "Check model type"); | 2898 | test_value(spectral->type(), "PowerLaw2", "Check model type"); |
| 2897 | - test_value(spectral->photon_flux(), 1.0e-7, 1.0e-7, "Check integral photon flux"); | 2899 | + test_value(spectral->flux(), 1.0e-7, 1.0e-7, "Check integral photon flux"); |
| 2898 | test_value(spectral->index(), -2.0, 1.0e-7, "Check index"); | 2900 | test_value(spectral->index(), -2.0, 1.0e-7, "Check index"); |
| 2899 | test_value(spectral->emin().MeV(), 100.0, 1.0e-7, "Check minimum energy"); | 2901 | test_value(spectral->emin().MeV(), 100.0, 1.0e-7, "Check minimum energy"); |
| 2900 | test_value(spectral->emax().MeV(), 500000.0, 1.0e-7, "Check maximum energy"); | 2902 | test_value(spectral->emax().MeV(), 500000.0, 1.0e-7, "Check maximum energy"); |
| @@ -2910,7 +2912,7 @@ void TestGModel::test_legacy_model_point_plaw2(void) | @@ -2910,7 +2912,7 @@ void TestGModel::test_legacy_model_point_plaw2(void) | ||
| 2910 | 2912 | ||
| 2911 | // Re-test model values | 2913 | // Re-test model values |
| 2912 | test_value(spectral->type(), "PowerLaw2", "Check model type"); | 2914 | test_value(spectral->type(), "PowerLaw2", "Check model type"); |
| 2913 | - test_value(spectral->photon_flux(), 1.0e-7, 1.0e-7, "Check integral photon flux"); | 2915 | + test_value(spectral->flux(), 1.0e-7, 1.0e-7, "Check integral photon flux"); |
| 2914 | test_value(spectral->index(), -2.0, 1.0e-7, "Check index"); | 2916 | test_value(spectral->index(), -2.0, 1.0e-7, "Check index"); |
| 2915 | test_value(spectral->emin().MeV(), 100.0, 1.0e-7, "Check minimum energy"); | 2917 | test_value(spectral->emin().MeV(), 100.0, 1.0e-7, "Check minimum energy"); |
| 2916 | test_value(spectral->emax().MeV(), 500000.0, 1.0e-7, "Check maximum energy"); | 2918 | test_value(spectral->emax().MeV(), 500000.0, 1.0e-7, "Check maximum energy"); |