Commit 2d80fdb138ccc8ecdfdcfe30d44fd71608cf3f20

Authored by Jürgen Knödlseder
2 parents 13844fca 53181887

Merge branch 'pull-request-1862_butterfly' into integration

# Conflicts:
#	ChangeLog
#	NEWS
ChangeLog
1 -2017-04-06 1 +2017-04-10
2 2
3 * Version 1.3.0 released 3 * Version 1.3.0 released
4 ======================== 4 ========================
5 5
6 Use correct ROOT histograms in csroot2caldb 6 Use correct ROOT histograms in csroot2caldb
7 Implement regression scheme in cssens and remove num_avg parameter (#1989) 7 Implement regression scheme in cssens and remove num_avg parameter (#1989)
  8 + Implement Gaussian error propagation in ctbutterfly (#1862)
8 Copy cscripts into bin directory instead of creating a symbolic links (#1987) 9 Copy cscripts into bin directory instead of creating a symbolic links (#1987)
9 If code originates from Git, always compile the Python bindings (#1985) 10 If code originates from Git, always compile the Python bindings (#1985)
10 Raise exception instead of exiting with return code in Python tests (#1983) 11 Raise exception instead of exiting with return code in Python tests (#1983)
1 New Features and Important Changes in ctools 1.3.0.dev1 1 New Features and Important Changes in ctools 1.3.0.dev1
2 2
3 -6 April 2017 3 +10 April 2017
4 4
5 5
6 Introduction 6 Introduction
@@ -113,7 +113,11 @@ None @@ -113,7 +113,11 @@ None
113 113
114 ctbutterfly - Generate butterfly diagrams 114 ctbutterfly - Generate butterfly diagrams
115 ----------------------------------------- 115 -----------------------------------------
116 -None 116 +The tool now uses Gaussian error propagation as the standard method for the
  117 +computation of the butterfly diagram. The envelope method that existed before
  118 +is still available for power law spectral models as an option. The "method"
  119 +parameter has been added to allow the selection of the computation method
  120 +(#1862).
117 121
118 122
119 ctulimit - Compute upper limit 123 ctulimit - Compute upper limit
doc/source/users/reference_manual/ctbutterfly.rst
@@ -3,21 +3,25 @@ @@ -3,21 +3,25 @@
3 ctbutterfly 3 ctbutterfly
4 =========== 4 ===========
5 5
6 -Computes butterfly diagram for a power law model. 6 +Computes butterfly diagram for a given spectral model.
7 7
8 8
9 Synopsis 9 Synopsis
10 -------- 10 --------
11 11
12 -This tool calculates a butterfly diagram for a specific source with power law  
13 -spectral model. The butterfly diagram is the envelope of all power law models  
14 -that are within a given confidence limit compatible with the data. By default  
15 -a confidence level of 68% is used, but the level can be adjusted using the  
16 -hidden ``confidence`` parameter. ctbutterfly computes this envelope by  
17 -evaluating for each energy the minimum and maximum intensity of all power law  
18 -models that fall within the error ellipse of the prefactor and index parameters.  
19 -The error ellipse is derived from the covariance matrix of a maximum likelihood  
20 -fit. 12 +This tool calculates a butterfly diagram for a specific source according to
  13 +its spectral model. The butterfly diagram is the envelope of all spectral
  14 +models that are within a given confidence limit compatible with the data.
  15 +The default method used for the calculation is Gaussian error propagation
  16 +using the covariance matrix from a maximum likelihood fit. By default a
  17 +confidence level of 68% is used, but the level can be adjusted using the
  18 +hidden ``confidence`` parameter. For power law models, an alternative
  19 +calculation method can be specified by setting the hidden parameter
  20 +``method=ENVELOPE``. By using this method, the envelope is computed by
  21 +evaluating for each energy the minimum and maximum intensity of all power
  22 +law models that fall within the error ellipse of the prefactor and index
  23 +parameters. The error ellipse is derived from the covariance matrix of a
  24 +maximum likelihood fit.
21 25
22 ctbutterfly assumes that the input model (parameter ``inmodel``) has been 26 ctbutterfly assumes that the input model (parameter ``inmodel``) has been
23 adjusted using :doc:`ctlike` to the data, but if this is not the case you 27 adjusted using :doc:`ctlike` to the data, but if this is not the case you
@@ -68,11 +72,14 @@ General parameters @@ -68,11 +72,14 @@ General parameters
68 72
69 ``outfile [file]`` 73 ``outfile [file]``
70 Output butterfly ASCII file name. 74 Output butterfly ASCII file name.
71 - 75 +
72 ``(fit = no) [boolean]`` 76 ``(fit = no) [boolean]``
73 Performs maximum likelihood fitting of input model ignoring any provided 77 Performs maximum likelihood fitting of input model ignoring any provided
74 covariance matrix. 78 covariance matrix.
75 - 79 +
  80 +``(method = "GAUSSIAN") <GAUSSIAN|ENVELOPE> [string]``
  81 + Computation method.
  82 +
76 ``(confidence = 0.68) [real]`` 83 ``(confidence = 0.68) [real]``
77 Confidence level for error computation. 84 Confidence level for error computation.
78 85
src/ctbin/ctbin.cpp
@@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
55 * 55 *
56 * Constructs an empty event binning tool. 56 * Constructs an empty event binning tool.
57 ***************************************************************************/ 57 ***************************************************************************/
58 -ctbin::ctbin(void) : ctobservation(CTBIN_NAME, CTBIN_VERSION) 58 +ctbin::ctbin(void) : ctobservation(CTBIN_NAME, VERSION)
59 { 59 {
60 // Initialise members 60 // Initialise members
61 init_members(); 61 init_members();
@@ -73,7 +73,7 @@ ctbin::ctbin(void) : ctobservation(CTBIN_NAME, CTBIN_VERSION) @@ -73,7 +73,7 @@ ctbin::ctbin(void) : ctobservation(CTBIN_NAME, CTBIN_VERSION)
73 * Constructs event binning tool from an observation container. 73 * Constructs event binning tool from an observation container.
74 ***************************************************************************/ 74 ***************************************************************************/
75 ctbin::ctbin(const GObservations& obs) : 75 ctbin::ctbin(const GObservations& obs) :
76 - ctobservation(CTBIN_NAME, CTBIN_VERSION, obs) 76 + ctobservation(CTBIN_NAME, VERSION, obs)
77 { 77 {
78 // Initialise members 78 // Initialise members
79 init_members(); 79 init_members();
@@ -94,7 +94,7 @@ ctbin::ctbin(const GObservations&amp; obs) : @@ -94,7 +94,7 @@ ctbin::ctbin(const GObservations&amp; obs) :
94 * parameter setting. 94 * parameter setting.
95 ***************************************************************************/ 95 ***************************************************************************/
96 ctbin::ctbin(int argc, char *argv[]) : 96 ctbin::ctbin(int argc, char *argv[]) :
97 - ctobservation(CTBIN_NAME, CTBIN_VERSION, argc, argv) 97 + ctobservation(CTBIN_NAME, VERSION, argc, argv)
98 { 98 {
99 // Initialise members 99 // Initialise members
100 init_members(); 100 init_members();
src/ctbin/ctbin.hpp
@@ -31,8 +31,7 @@ @@ -31,8 +31,7 @@
31 #include "ctobservation.hpp" 31 #include "ctobservation.hpp"
32 32
33 /* __Definitions _________________________________________________________ */ 33 /* __Definitions _________________________________________________________ */
34 -#define CTBIN_NAME "ctbin"  
35 -#define CTBIN_VERSION "1.2.0" 34 +#define CTBIN_NAME "ctbin"
36 35
37 36
38 /***********************************************************************//** 37 /***********************************************************************//**
src/ctbkgcube/ctbkgcube.cpp
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 /***********************************************************************//** 50 /***********************************************************************//**
51 * @brief Void constructor 51 * @brief Void constructor
52 ***************************************************************************/ 52 ***************************************************************************/
53 -ctbkgcube::ctbkgcube(void) : ctobservation(CTBKGCUBE_NAME, CTBKGCUBE_VERSION) 53 +ctbkgcube::ctbkgcube(void) : ctobservation(CTBKGCUBE_NAME, VERSION)
54 { 54 {
55 // Initialise members 55 // Initialise members
56 init_members(); 56 init_members();
@@ -69,7 +69,7 @@ ctbkgcube::ctbkgcube(void) : ctobservation(CTBKGCUBE_NAME, CTBKGCUBE_VERSION) @@ -69,7 +69,7 @@ ctbkgcube::ctbkgcube(void) : ctobservation(CTBKGCUBE_NAME, CTBKGCUBE_VERSION)
69 * observations container. 69 * observations container.
70 ***************************************************************************/ 70 ***************************************************************************/
71 ctbkgcube::ctbkgcube(const GObservations& obs) : 71 ctbkgcube::ctbkgcube(const GObservations& obs) :
72 - ctobservation(CTBKGCUBE_NAME, CTBKGCUBE_VERSION, obs) 72 + ctobservation(CTBKGCUBE_NAME, VERSION, obs)
73 { 73 {
74 // Initialise members 74 // Initialise members
75 init_members(); 75 init_members();
@@ -87,7 +87,7 @@ ctbkgcube::ctbkgcube(const GObservations&amp; obs) : @@ -87,7 +87,7 @@ ctbkgcube::ctbkgcube(const GObservations&amp; obs) :
87 * @param[in] argv Array of command line arguments. 87 * @param[in] argv Array of command line arguments.
88 ***************************************************************************/ 88 ***************************************************************************/
89 ctbkgcube::ctbkgcube(int argc, char *argv[]) : 89 ctbkgcube::ctbkgcube(int argc, char *argv[]) :
90 - ctobservation(CTBKGCUBE_NAME, CTBKGCUBE_VERSION, argc, argv) 90 + ctobservation(CTBKGCUBE_NAME, VERSION, argc, argv)
91 { 91 {
92 // Initialise members 92 // Initialise members
93 init_members(); 93 init_members();
src/ctbkgcube/ctbkgcube.hpp
@@ -33,8 +33,7 @@ @@ -33,8 +33,7 @@
33 #include "ctobservation.hpp" 33 #include "ctobservation.hpp"
34 34
35 /* __Definitions _________________________________________________________ */ 35 /* __Definitions _________________________________________________________ */
36 -#define CTBKGCUBE_NAME "ctbkgcube"  
37 -#define CTBKGCUBE_VERSION "1.1.0" 36 +#define CTBKGCUBE_NAME "ctbkgcube"
38 37
39 38
40 /***********************************************************************//** 39 /***********************************************************************//**
src/ctbutterfly/ctbutterfly.cpp
1 /*************************************************************************** 1 /***************************************************************************
2 * ctbutterfly - butterfly calculation tool * 2 * ctbutterfly - butterfly calculation tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2014-2016 by Michael Mayer * 4 + * copyright (C) 2014-2017 by Michael Mayer *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 /***********************************************************************//** 52 /***********************************************************************//**
53 * @brief Void constructor 53 * @brief Void constructor
54 ***************************************************************************/ 54 ***************************************************************************/
55 -ctbutterfly::ctbutterfly(void) : ctlikelihood(CTBUTTERFLY_NAME, CTBUTTERFLY_VERSION) 55 +ctbutterfly::ctbutterfly(void) : ctlikelihood(CTBUTTERFLY_NAME, VERSION)
56 { 56 {
57 // Initialise members 57 // Initialise members
58 init_members(); 58 init_members();
@@ -71,7 +71,7 @@ ctbutterfly::ctbutterfly(void) : ctlikelihood(CTBUTTERFLY_NAME, CTBUTTERFLY_VERS @@ -71,7 +71,7 @@ ctbutterfly::ctbutterfly(void) : ctlikelihood(CTBUTTERFLY_NAME, CTBUTTERFLY_VERS
71 * observations container. 71 * observations container.
72 ***************************************************************************/ 72 ***************************************************************************/
73 ctbutterfly::ctbutterfly(const GObservations& obs) : 73 ctbutterfly::ctbutterfly(const GObservations& obs) :
74 - ctlikelihood(CTBUTTERFLY_NAME, CTBUTTERFLY_VERSION, obs) 74 + ctlikelihood(CTBUTTERFLY_NAME, VERSION, obs)
75 { 75 {
76 // Initialise members 76 // Initialise members
77 init_members(); 77 init_members();
@@ -89,7 +89,7 @@ ctbutterfly::ctbutterfly(const GObservations&amp; obs) : @@ -89,7 +89,7 @@ ctbutterfly::ctbutterfly(const GObservations&amp; obs) :
89 * @param[in] argv Array of command line arguments. 89 * @param[in] argv Array of command line arguments.
90 ***************************************************************************/ 90 ***************************************************************************/
91 ctbutterfly::ctbutterfly(int argc, char *argv[]) : 91 ctbutterfly::ctbutterfly(int argc, char *argv[]) :
92 - ctlikelihood(CTBUTTERFLY_NAME, CTBUTTERFLY_VERSION, argc, argv) 92 + ctlikelihood(CTBUTTERFLY_NAME, VERSION, argc, argv)
93 { 93 {
94 // Initialise members 94 // Initialise members
95 init_members(); 95 init_members();
@@ -243,11 +243,14 @@ void ctbutterfly::run(void) @@ -243,11 +243,14 @@ void ctbutterfly::run(void)
243 m_obs.optimize(m_opt); 243 m_obs.optimize(m_opt);
244 m_obs.errors(m_opt); 244 m_obs.errors(m_opt);
245 245
246 - // Get covariance matrix by inverting the curvature matrix. Note that  
247 - // the curvature matrix is for the unscaled parameters, hence we have  
248 - // to scale them before we can proceed. 246 + // Get covariance matrix.
249 GObservations::likelihood likelihood = m_obs.function(); 247 GObservations::likelihood likelihood = m_obs.function();
250 - m_covariance = likelihood.curvature()->invert(); 248 + if (m_method == "GAUSSIAN") {
  249 + m_covariance = likelihood.curvature()->invert();
  250 + }
  251 + else {
  252 + m_covariance = likelihood.covariance();
  253 + }
251 254
252 // Write optimizer, optimised model and covariance matrix into logger 255 // Write optimizer, optimised model and covariance matrix into logger
253 log_string(NORMAL, m_opt.print(m_chatter)); 256 log_string(NORMAL, m_opt.print(m_chatter));
@@ -271,157 +274,26 @@ void ctbutterfly::run(void) @@ -271,157 +274,26 @@ void ctbutterfly::run(void)
271 GObservations::likelihood likelihood = m_obs.function(); 274 GObservations::likelihood likelihood = m_obs.function();
272 likelihood.eval(pars); 275 likelihood.eval(pars);
273 276
274 - // Get covariance matrix by inverting the curvature matrix. Note that  
275 - // the curvature matrix is for the unscaled parameters, hence we have  
276 - // to scale them before we can proceed.  
277 - m_covariance = likelihood.curvature()->invert(); 277 + // Get covariance matrix.
  278 + if (m_method == "GAUSSIAN") {
  279 + m_covariance = likelihood.curvature()->invert();
  280 + }
  281 + else {
  282 + m_covariance = likelihood.covariance();
  283 + }
278 284
279 // Write covariance matrix into logger 285 // Write covariance matrix into logger
280 log_string(EXPLICIT, m_covariance.print(m_chatter)); 286 log_string(EXPLICIT, m_covariance.print(m_chatter));
281 287
282 } // endif: covariance computation needed 288 } // endif: covariance computation needed
283 289
284 - // Write header into logger  
285 - log_header1(TERSE, "Prepare butterfly computation");  
286 -  
287 - // Find parameter indices. We do this by the memory location of the  
288 - // model parameters.  
289 - GModelSky* skymodel = dynamic_cast<GModelSky*>(models[m_srcname]);  
290 - GModelPar* par_prefactor = &(*skymodel)["Prefactor"];  
291 - GModelPar* par_index = &(*skymodel)["Index"];  
292 - int inx_prefactor = -1;  
293 - int inx_index = -1;  
294 - for (int i = 0; i < models.npars(); ++i) {  
295 - if (models.pars()[i] == par_prefactor) {  
296 - inx_prefactor = i;  
297 - }  
298 - if (models.pars()[i] == par_index) {  
299 - inx_index = i;  
300 - } 290 + // Compute butterfly depending on selected method
  291 + if (m_method == "GAUSSIAN") {
  292 + gaussian_error_propagation(models);
  293 + }
  294 + else {
  295 + ellipsoid_boundary(models);
301 } 296 }
302 -  
303 - // Store model values and scales  
304 - double prefactor_mean = (*skymodel)["Prefactor"].value();  
305 - double index_mean = (*skymodel)["Index"].value();  
306 - double pivot_mean = (*skymodel)["PivotEnergy"].value();  
307 - double prefactor_scale = (*skymodel)["Prefactor"].scale();  
308 - double index_scale = (*skymodel)["Index"].scale();  
309 - GEnergy pivot(pivot_mean, "MeV");  
310 -  
311 - // Write parameter indices into logger  
312 - log_value(NORMAL, "Prefactor", gammalib::str(prefactor_mean)+  
313 - " ph/cm2/s/MeV ("+gammalib::str(inx_prefactor)+")");  
314 - log_value(NORMAL, "Index", gammalib::str(index_mean)+  
315 - " ("+gammalib::str(inx_index)+")");  
316 - log_value(NORMAL, "Pivot energy", pivot.print());  
317 -  
318 - // Extract covariance elements  
319 - double cov_pp = m_covariance(inx_prefactor,inx_prefactor);  
320 - double cov_pg = m_covariance(inx_prefactor,inx_index);  
321 - double cov_gg = m_covariance(inx_index,inx_index);  
322 -  
323 - // Compute eigenvectors and eigenvalues  
324 - double lambda1;  
325 - double lambda2;  
326 - GVector vector1(2);  
327 - GVector vector2(2);  
328 - eigenvectors(cov_pp, cov_pg, cov_pg, cov_gg,  
329 - &lambda1, &lambda2, &vector1, &vector2);  
330 -  
331 - // Write eigenvectors and eigenvalues into logger  
332 - log_value(NORMAL, "Eigenvalue 1", lambda1);  
333 - log_value(NORMAL, "Eigenvalue 2", lambda2);  
334 - log_value(NORMAL, "Eigenvector 1", vector1.print());  
335 - log_value(NORMAL, "Eigenvector 2", vector2.print());  
336 -  
337 - // Confidence scaling  
338 - double sigma = gammalib::erfinv(m_confidence) * gammalib::sqrt_two;  
339 - double scale = (sigma*sigma);  
340 -  
341 - // Write confidence level information into logger  
342 - log_value(NORMAL, "Confidence level", m_confidence);  
343 - log_value(NORMAL, "Corresponding scaling", scale);  
344 -  
345 - // Compute minor and major axes of error ellipse  
346 - double major = scale*std::sqrt(lambda1);  
347 - double minor = scale*std::sqrt(lambda2);  
348 -  
349 - // Write header into logger  
350 - log_header1(TERSE, "Generate butterfly");  
351 -  
352 - // Initialise result arrays  
353 - m_energies.assign(m_ebounds.size(), 0.0);  
354 - m_intensities.assign(m_ebounds.size(), 0.0);  
355 - m_min_intensities.assign(m_ebounds.size(), 1e30);  
356 - m_max_intensities.assign(m_ebounds.size(), 0.0);  
357 -  
358 - // Walk around the error ellipse  
359 - int nt = 360;  
360 - double dt = gammalib::twopi/double(nt);  
361 - double t = 0.0;  
362 - for (int i = 0; i < nt; ++i, t += dt) {  
363 -  
364 - // Pre-compute sin and cosine  
365 - double sin_t = std::sin(t);  
366 - double cos_t = std::cos(t);  
367 -  
368 - // Compute prefactor and index  
369 - double prefactor = (major * cos_t * vector1[0] +  
370 - minor * sin_t * vector2[0]) * prefactor_scale +  
371 - prefactor_mean;  
372 - double index = (major * cos_t * vector1[1] +  
373 - minor * sin_t * vector2[1]) * index_scale +  
374 - index_mean;  
375 -  
376 - // Write prefactor and index into logger  
377 - log_value(EXPLICIT, "Angle "+gammalib::str(t*gammalib::rad2deg),  
378 - gammalib::str(prefactor)+" ph/cm2/s/MeV; "+  
379 - gammalib::str(index));  
380 -  
381 - // Setup power law model  
382 - GModelSpectralPlaw plaw(prefactor, index, pivot);  
383 -  
384 - // Evaluate power law at each energy and extract minimum and  
385 - // maximum intensity  
386 - for (int k = 0; k < m_ebounds.size(); ++k) {  
387 -  
388 - // Get the energy of current bin  
389 - GTime time;  
390 - GEnergy energy = m_ebounds.elogmean(k);  
391 -  
392 - // Evaluate power law  
393 - double intensity = plaw.eval(energy, time);  
394 -  
395 - // Get extremes  
396 - if (intensity < m_min_intensities[k]) {  
397 - m_min_intensities[k] = intensity;  
398 - }  
399 - if (intensity > m_max_intensities[k]) {  
400 - m_max_intensities[k] = intensity;  
401 - }  
402 -  
403 - } // endfor: looped over all energies  
404 -  
405 - } // endfor: looped over all angles  
406 -  
407 - // Setup power law model for mean prefactor and index  
408 - GModelSpectralPlaw plaw(prefactor_mean, index_mean, pivot);  
409 -  
410 - // Compute energy and intensity vectors for mean power law  
411 - for (int k = 0; k < m_ebounds.size(); ++k) {  
412 -  
413 - // Get the energy of current bin  
414 - GTime time;  
415 - GEnergy energy = m_ebounds.elogmean(k);  
416 -  
417 - // Evaluate power law  
418 - double intensity = plaw.eval(energy, time);  
419 -  
420 - // Store results  
421 - m_energies[k] = energy.MeV();  
422 - m_intensities[k] = intensity;  
423 -  
424 - } // endfor: looped over energies  
425 297
426 // Write header into logger 298 // Write header into logger
427 log_header1(TERSE, "Results"); 299 log_header1(TERSE, "Results");
@@ -431,11 +303,11 @@ void ctbutterfly::run(void) @@ -431,11 +303,11 @@ void ctbutterfly::run(void)
431 303
432 // Write results into logger 304 // Write results into logger
433 log_value(NORMAL, "Intensity at "+gammalib::str(m_energies[k])+" MeV", 305 log_value(NORMAL, "Intensity at "+gammalib::str(m_energies[k])+" MeV",
434 - gammalib::str(m_intensities[k])+" ("+  
435 - gammalib::str(m_min_intensities[k])+", "+  
436 - gammalib::str(m_max_intensities[k])+") ph/cm2/s/MeV"); 306 + gammalib::str(m_intensities[k])+" ("+
  307 + gammalib::str(m_min_intensities[k])+", "+
  308 + gammalib::str(m_max_intensities[k])+") ph/cm2/s/MeV");
437 309
438 - } // endfor: looped over energies 310 + } //endfor: loop over energy bin
439 311
440 // Restore energy dispersion flag for all CTA observations 312 // Restore energy dispersion flag for all CTA observations
441 for (int i = 0; i < m_obs.size(); ++i) { 313 for (int i = 0; i < m_obs.size(); ++i) {
@@ -504,6 +376,7 @@ void ctbutterfly::init_members(void) @@ -504,6 +376,7 @@ void ctbutterfly::init_members(void)
504 { 376 {
505 // Initialise members 377 // Initialise members
506 m_srcname.clear(); 378 m_srcname.clear();
  379 + m_method.clear();
507 m_confidence = 0.68; 380 m_confidence = 0.68;
508 m_max_iter = 50; 381 m_max_iter = 50;
509 m_apply_edisp = false; 382 m_apply_edisp = false;
@@ -537,6 +410,7 @@ void ctbutterfly::copy_members(const ctbutterfly&amp; app) @@ -537,6 +410,7 @@ void ctbutterfly::copy_members(const ctbutterfly&amp; app)
537 { 410 {
538 // Copy attributes 411 // Copy attributes
539 m_srcname = app.m_srcname; 412 m_srcname = app.m_srcname;
  413 + m_method = app.m_method;
540 m_confidence = app.m_confidence; 414 m_confidence = app.m_confidence;
541 m_max_iter = app.m_max_iter; 415 m_max_iter = app.m_max_iter;
542 m_apply_edisp = app.m_apply_edisp; 416 m_apply_edisp = app.m_apply_edisp;
@@ -544,7 +418,7 @@ void ctbutterfly::copy_members(const ctbutterfly&amp; app) @@ -544,7 +418,7 @@ void ctbutterfly::copy_members(const ctbutterfly&amp; app)
544 m_chatter = app.m_chatter; 418 m_chatter = app.m_chatter;
545 m_ebounds = app.m_ebounds; 419 m_ebounds = app.m_ebounds;
546 m_outfile = app.m_outfile; 420 m_outfile = app.m_outfile;
547 - 421 +
548 // Copy protected members 422 // Copy protected members
549 m_covariance = app.m_covariance; 423 m_covariance = app.m_covariance;
550 m_energies = app.m_energies; 424 m_energies = app.m_energies;
@@ -583,16 +457,13 @@ void ctbutterfly::get_parameters(void) @@ -583,16 +457,13 @@ void ctbutterfly::get_parameters(void)
583 { 457 {
584 // Setup observations from "inobs" parameter 458 // Setup observations from "inobs" parameter
585 setup_observations(m_obs); 459 setup_observations(m_obs);
586 - 460 +
587 // Setup models from "inmodel" parameter 461 // Setup models from "inmodel" parameter
588 setup_models(m_obs, (*this)["srcname"].string()); 462 setup_models(m_obs, (*this)["srcname"].string());
589 463
590 // Get name of test source 464 // Get name of test source
591 m_srcname = (*this)["srcname"].string(); 465 m_srcname = (*this)["srcname"].string();
592 466
593 - // Check model name and type  
594 - check_model();  
595 -  
596 // Create energy boundaries from user parameters 467 // Create energy boundaries from user parameters
597 m_ebounds = create_ebounds(); 468 m_ebounds = create_ebounds();
598 469
@@ -600,18 +471,22 @@ void ctbutterfly::get_parameters(void) @@ -600,18 +471,22 @@ void ctbutterfly::get_parameters(void)
600 std::string matrixfilename = (*this)["matrix"].filename(); 471 std::string matrixfilename = (*this)["matrix"].filename();
601 if (matrixfilename != "NONE") { 472 if (matrixfilename != "NONE") {
602 std::string msg = "Loading of matrix from file not implemented yet. " 473 std::string msg = "Loading of matrix from file not implemented yet. "
603 - "Use filename = \"NONE\" to induce a recomputation of "  
604 - "the matrix internally."; 474 + "Use filename = \"NONE\" to induce a recomputation of "
  475 + "the matrix internally.";
605 throw GException::feature_not_implemented(G_GET_PARAMETERS, msg); 476 throw GException::feature_not_implemented(G_GET_PARAMETERS, msg);
606 // m_covariance.load(matrixfilename); 477 // m_covariance.load(matrixfilename);
607 } 478 }
608 479
609 // Get remaining parameters 480 // Get remaining parameters
610 m_apply_edisp = (*this)["edisp"].boolean(); 481 m_apply_edisp = (*this)["edisp"].boolean();
  482 + m_method = (*this)["method"].string();
611 m_confidence = (*this)["confidence"].real(); 483 m_confidence = (*this)["confidence"].real();
612 m_fit = (*this)["fit"].boolean(); 484 m_fit = (*this)["fit"].boolean();
613 m_chatter = static_cast<GChatter>((*this)["chatter"].integer()); 485 m_chatter = static_cast<GChatter>((*this)["chatter"].integer());
614 486
  487 + // Check model name and type
  488 + check_model();
  489 +
615 // Optionally read ahead parameters so that they get correctly 490 // Optionally read ahead parameters so that they get correctly
616 // dumped into the log file 491 // dumped into the log file
617 if (read_ahead()) { 492 if (read_ahead()) {
@@ -627,6 +502,273 @@ void ctbutterfly::get_parameters(void) @@ -627,6 +502,273 @@ void ctbutterfly::get_parameters(void)
627 502
628 503
629 /***********************************************************************//** 504 /***********************************************************************//**
  505 + * @brief Compute butterfly using the ellipsoid boundary method
  506 + ***************************************************************************/
  507 +void ctbutterfly::ellipsoid_boundary(GModels& models)
  508 +{
  509 + // Write header into logger
  510 + log_header1(TERSE, "Prepare butterfly computation");
  511 +
  512 + // Find parameter indices. We do this by the memory location of the
  513 + // model parameters.
  514 + GModelSky* skymodel = dynamic_cast<GModelSky*>(models[m_srcname]);
  515 + GModelPar* par_prefactor = &(*skymodel)["Prefactor"];
  516 + GModelPar* par_index = &(*skymodel)["Index"];
  517 + int inx_prefactor = -1;
  518 + int inx_index = -1;
  519 + for (int i = 0; i < models.npars(); ++i) {
  520 + if (models.pars()[i] == par_prefactor) {
  521 + inx_prefactor = i;
  522 + }
  523 + if (models.pars()[i] == par_index) {
  524 + inx_index = i;
  525 + }
  526 + }
  527 +
  528 + // Store model values
  529 + double prefactor_mean = (*skymodel)["Prefactor"].value();
  530 + double index_mean = (*skymodel)["Index"].value();
  531 + double pivot_mean = (*skymodel)["PivotEnergy"].value();
  532 + double prefactor_scale = (*skymodel)["Prefactor"].scale();
  533 + double index_scale = (*skymodel)["Index"].scale();
  534 + GEnergy pivot(pivot_mean, "MeV");
  535 +
  536 + // Write parameter indices into logger
  537 + log_value(NORMAL, "Prefactor", gammalib::str(prefactor_mean)+
  538 + " ph/cm2/s/MeV ("+
  539 + gammalib::str(inx_prefactor)+")");
  540 + log_value(NORMAL, "Index", gammalib::str(index_mean)+
  541 + " ("+gammalib::str(inx_index)+")");
  542 + log_value(NORMAL, "Pivot energy", pivot.print());
  543 +
  544 + // Extract covariance elements
  545 + double cov_pp = m_covariance(inx_prefactor,inx_prefactor);
  546 + double cov_pg = m_covariance(inx_prefactor,inx_index);
  547 + double cov_gg = m_covariance(inx_index,inx_index);
  548 +
  549 + // Compute eigenvectors and eigenvalues
  550 + double lambda1;
  551 + double lambda2;
  552 + GVector vector1(2);
  553 + GVector vector2(2);
  554 + eigenvectors(cov_pp, cov_pg, cov_pg, cov_gg,
  555 + &lambda1, &lambda2, &vector1, &vector2);
  556 +
  557 + // Write eigenvectors and eigenvalues into logger
  558 + log_value(NORMAL, "Eigenvalue 1", lambda1);
  559 + log_value(NORMAL, "Eigenvalue 2", lambda2);
  560 + log_value(NORMAL, "Eigenvector 1", vector1.print());
  561 + log_value(NORMAL, "Eigenvector 2", vector2.print());
  562 +
  563 + // Confidence scaling, calculated from a Chi-Sqr.
  564 + // distribution with 2 dof
  565 + double scale = std::sqrt( -2. * std::log(1.-m_confidence) );
  566 +
  567 + // Write confidence level information into logger
  568 + log_value(NORMAL, "Confidence level", m_confidence);
  569 + log_value(NORMAL, "Corresponding scaling", scale);
  570 +
  571 + // Compute minor and major axes of error ellipse
  572 + double major = scale*std::sqrt(lambda1);
  573 + double minor = scale*std::sqrt(lambda2);
  574 +
  575 + // Write header into logger
  576 + log_header1(TERSE, "Generate butterfly");
  577 +
  578 + // Initialise result arrays
  579 + m_energies.assign(m_ebounds.size(), 0.0);
  580 + m_intensities.assign(m_ebounds.size(), 0.0);
  581 + m_min_intensities.assign(m_ebounds.size(), 1e30);
  582 + m_max_intensities.assign(m_ebounds.size(), 0.0);
  583 +
  584 + // Walk around the error ellipse
  585 + int nt = 360;
  586 + double dt = gammalib::twopi/double(nt);
  587 + double t = 0.0;
  588 + for (int i = 0; i < nt; ++i, t += dt) {
  589 +
  590 + // Pre-compute sin and cosine
  591 + double sin_t = std::sin(t);
  592 + double cos_t = std::cos(t);
  593 +
  594 + // Compute prefactor and index
  595 + double prefactor = (major * cos_t * vector1[0] +
  596 + minor * sin_t * vector2[0]) * prefactor_scale +
  597 + prefactor_mean;
  598 + double index = (major * cos_t * vector1[1] +
  599 + minor * sin_t * vector2[1]) * index_scale +
  600 + index_mean;
  601 +
  602 + // Write prefactor and index into logger
  603 + log_value(EXPLICIT, "Angle "+gammalib::str(t*gammalib::rad2deg),
  604 + gammalib::str(prefactor)+" ph/cm2/s/MeV; "+
  605 + gammalib::str(index));
  606 +
  607 + // Setup power law model
  608 + GModelSpectralPlaw plaw(prefactor, index, pivot);
  609 +
  610 + // Evaluate power law at each energy and extract minimum and
  611 + // maximum intensity
  612 + for (int k = 0; k < m_ebounds.size(); ++k) {
  613 +
  614 + // Get the energy of current bin
  615 + GTime time;
  616 + GEnergy energy = m_ebounds.elogmean(k);
  617 +
  618 + // Evaluate power law
  619 + double intensity = plaw.eval(energy, time);
  620 +
  621 + // Get extremes
  622 + if (intensity < m_min_intensities[k]) {
  623 + m_min_intensities[k] = intensity;
  624 + }
  625 + if (intensity > m_max_intensities[k]) {
  626 + m_max_intensities[k] = intensity;
  627 + }
  628 +
  629 + } // endfor: looped over all energies
  630 +
  631 + } // endfor: looped over all angles
  632 +
  633 + // Setup power law model for mean prefactor and index
  634 + GModelSpectralPlaw plaw(prefactor_mean, index_mean, pivot);
  635 +
  636 + // Compute energy and intensity vectors for mean power law
  637 + for (int k = 0; k < m_ebounds.size(); ++k) {
  638 +
  639 + // Get the energy of current bin
  640 + GTime time;
  641 + GEnergy energy = m_ebounds.elogmean(k);
  642 +
  643 + // Evaluate power law
  644 + double intensity = plaw.eval(energy, time);
  645 +
  646 + // Store results
  647 + m_energies[k] = energy.MeV();
  648 + m_intensities[k] = intensity;
  649 +
  650 + } // endfor: looped over energies
  651 +
  652 + // Return
  653 + return;
  654 +}
  655 +
  656 +
  657 +/***********************************************************************//**
  658 + * @brief Compute butterfly using Gaussian error propagation
  659 + *
  660 + * Computes the butterfly diagram using Gaussian error propagation. This
  661 + * works for any kind of model.
  662 + ***************************************************************************/
  663 +void ctbutterfly::gaussian_error_propagation(GModels& models)
  664 +{
  665 + // Write header into logger
  666 + log_header1(TERSE, "Prepare butterfly computation");
  667 +
  668 + // Confidence scaling
  669 + double scale = gammalib::erfinv(m_confidence) * gammalib::sqrt_two;
  670 +
  671 + // Write confidence level information into logger
  672 + log_value(NORMAL, "Confidence level", m_confidence);
  673 + log_value(NORMAL, "Corresponding scaling", scale);
  674 +
  675 + // Write header into logger
  676 + log_header1(TERSE, "Generate butterfly");
  677 +
  678 + // Initialise dummy time to evaluate spectral model
  679 + GTime time = GTime();
  680 +
  681 + // Initialise vector of gradients
  682 + GVector grad = GVector(m_obs.models().npars());
  683 +
  684 + // Loop over energy bins
  685 + for (int i = 0; i < m_ebounds.size(); ++i) {
  686 +
  687 + // Initialise number of gradients
  688 + int num_gradient = 0;
  689 +
  690 + // Get the mean logarithmic energy of current bin
  691 + GEnergy energy = m_ebounds.elogmean(i);
  692 +
  693 + // Initialise model flux value
  694 + double model_flux = 0.0;
  695 +
  696 + // Loop over models
  697 + for (int j = 0; j < models.size(); ++j) {
  698 +
  699 + // Check wether model is a skymodel
  700 + GModelSky* skymodel = dynamic_cast<GModelSky*>(models[j]);
  701 +
  702 + // Yes ...
  703 + if (skymodel != NULL) {
  704 +
  705 + // Set flux value of source of interest, evaluate gradients
  706 + if (skymodel->name() == m_srcname) {
  707 +
  708 + // Get spectral component of model
  709 + GModelSpectral *spectral = skymodel->spectral();
  710 +
  711 + // Get model flux
  712 + model_flux = spectral->eval(energy, time, true);
  713 +
  714 + // Loop over all model parameters
  715 + for (int k = 0; k < skymodel->size(); ++k) {
  716 +
  717 + // Set gradient if we deal with spectral component
  718 + bool parIsSpectral = false;
  719 + for (int l = 0; l < spectral->size(); ++l) {
  720 + if ((&((*spectral)[l])) == (&((*skymodel)[k]))) {
  721 + grad[num_gradient] = (*spectral)[l].gradient();
  722 + num_gradient++;
  723 + parIsSpectral = true;
  724 + break;
  725 + }
  726 + } // endfor: looped over spectral parameters
  727 +
  728 + // If parameter is spatial or temporal, count up
  729 + if (!parIsSpectral) {
  730 + num_gradient++;
  731 + }
  732 +
  733 + } // endfor: looped over all model parameters
  734 +
  735 + } // endif: model was source of interest
  736 + else {
  737 + num_gradient += skymodel->size();
  738 + }
  739 +
  740 + } // endif: model was sky model
  741 +
  742 + // Skip other models (e.g. GModelData instances)
  743 + else {
  744 + num_gradient += models[j]->size();
  745 + }
  746 +
  747 + } // endfor: Looped over models
  748 +
  749 + // Multiply covariance to the gradient vector
  750 + GVector vector = m_covariance * grad;
  751 +
  752 + // Get the error from the scalar product
  753 + double error = std::sqrt(grad * vector);
  754 +
  755 + // Multiply with confidence scaling
  756 + error *= scale;
  757 +
  758 + // Store flux, value and energy for saving
  759 + m_intensities.push_back(model_flux);
  760 + m_energies.push_back(energy.MeV());
  761 + m_min_intensities.push_back(model_flux-error);
  762 + m_max_intensities.push_back(model_flux+error);
  763 +
  764 + } // endfor: Looped over energy bins
  765 +
  766 + // Return
  767 + return;
  768 +}
  769 +
  770 +
  771 +/***********************************************************************//**
630 * @brief Check if sky model is valid 772 * @brief Check if sky model is valid
631 * 773 *
632 * @exception GException::invalid_value 774 * @exception GException::invalid_value
@@ -645,17 +787,22 @@ void ctbutterfly::check_model(void) @@ -645,17 +787,22 @@ void ctbutterfly::check_model(void)
645 GModelSky* model = dynamic_cast<GModelSky*>(models[m_srcname]); 787 GModelSky* model = dynamic_cast<GModelSky*>(models[m_srcname]);
646 if (model == NULL) { 788 if (model == NULL) {
647 std::string msg = "Source \""+m_srcname+"\" is not a sky model. " 789 std::string msg = "Source \""+m_srcname+"\" is not a sky model. "
648 - "Please specify the name of a sky model for "  
649 - "butterfly computation."; 790 + "Please specify the name of a sky model for "
  791 + "butterfly computation.";
650 throw GException::invalid_value(G_CHECK_MODEL, msg); 792 throw GException::invalid_value(G_CHECK_MODEL, msg);
651 } 793 }
652 794
653 - // Check that the spectral model is a power law  
654 - if (model->spectral()->type() != "PowerLaw") {  
655 - std::string msg = "\""+model->spectral()->type()+"\" cannot be "  
656 - "used as spectral model for an butterfly "  
657 - "computation. Please specify a power law model.";  
658 - throw GException::invalid_value(G_CHECK_MODEL, msg); 795 + // Check that the spectral model is a power law for the "ENVELOPE"
  796 + // method
  797 + if (m_method == "ENVELOPE") {
  798 + if (model->spectral()->type() != "PowerLaw") {
  799 + std::string msg = "\""+model->spectral()->type()+"\" cannot be "
  800 + "used as spectral model for an butterfly "
  801 + "computation with method=ENVELOPE. Please "
  802 + "specify a power law model or switch to "
  803 + "method=GAUSSIAN.";
  804 + throw GException::invalid_value(G_CHECK_MODEL, msg);
  805 + }
659 } 806 }
660 807
661 } // endif: source model existed 808 } // endif: source model existed
@@ -663,8 +810,8 @@ void ctbutterfly::check_model(void) @@ -663,8 +810,8 @@ void ctbutterfly::check_model(void)
663 // Otherwise throw an exception 810 // Otherwise throw an exception
664 else { 811 else {
665 std::string msg = "Source \""+m_srcname+"\" not found in model " 812 std::string msg = "Source \""+m_srcname+"\" not found in model "
666 - "container. Please add a source with that name "  
667 - "or check for possible typos."; 813 + "container. Please add a source with that name "
  814 + "or check for possible typos.";
668 throw GException::invalid_value(G_CHECK_MODEL, msg); 815 throw GException::invalid_value(G_CHECK_MODEL, msg);
669 } 816 }
670 817
@@ -689,13 +836,13 @@ void ctbutterfly::check_model(void) @@ -689,13 +836,13 @@ void ctbutterfly::check_model(void)
689 * http://www.math.harvard.edu/archive/21b_fall_04/exhibits/2dmatrices/index.html 836 * http://www.math.harvard.edu/archive/21b_fall_04/exhibits/2dmatrices/index.html
690 ***************************************************************************/ 837 ***************************************************************************/
691 void ctbutterfly::eigenvectors(const double& a, 838 void ctbutterfly::eigenvectors(const double& a,
692 - const double& b,  
693 - const double& c,  
694 - const double& d,  
695 - double* lambda1,  
696 - double* lambda2,  
697 - GVector* vector1,  
698 - GVector* vector2) 839 + const double& b,
  840 + const double& c,
  841 + const double& d,
  842 + double* lambda1,
  843 + double* lambda2,
  844 + GVector* vector1,
  845 + GVector* vector2)
699 { 846 {
700 // Compute trace and determinant 847 // Compute trace and determinant
701 double trace = a + d; 848 double trace = a + d;
@@ -730,7 +877,7 @@ void ctbutterfly::eigenvectors(const double&amp; a, @@ -730,7 +877,7 @@ void ctbutterfly::eigenvectors(const double&amp; a,
730 // Normalize eigenvectors 877 // Normalize eigenvectors
731 *vector1 /= norm(*vector1); 878 *vector1 /= norm(*vector1);
732 *vector2 /= norm(*vector2); 879 *vector2 /= norm(*vector2);
733 - 880 +
734 // Return 881 // Return
735 return; 882 return;
736 } 883 }
src/ctbutterfly/ctbutterfly.hpp
1 /*************************************************************************** 1 /***************************************************************************
2 * ctbutterfly - butterfly calculation tool * 2 * ctbutterfly - butterfly calculation tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2014-2016 by Michael Mayer * 4 + * copyright (C) 2014-2017 by Michael Mayer *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -33,8 +33,7 @@ @@ -33,8 +33,7 @@
33 #include "ctlikelihood.hpp" 33 #include "ctlikelihood.hpp"
34 34
35 /* __Definitions _________________________________________________________ */ 35 /* __Definitions _________________________________________________________ */
36 -#define CTBUTTERFLY_NAME "ctbutterfly"  
37 -#define CTBUTTERFLY_VERSION "1.1.0" 36 +#define CTBUTTERFLY_NAME "ctbutterfly"
38 37
39 38
40 /***********************************************************************//** 39 /***********************************************************************//**
@@ -77,6 +76,10 @@ protected: @@ -77,6 +76,10 @@ protected:
77 void copy_members(const ctbutterfly& app); 76 void copy_members(const ctbutterfly& app);
78 void free_members(void); 77 void free_members(void);
79 void get_parameters(void); 78 void get_parameters(void);
  79 + void gaussian_error_propagation(GModels& models);
  80 + void ellipsoid_boundary(GModels& models);
  81 +
  82 +
80 void check_model(void); 83 void check_model(void);
81 void eigenvectors(const double& a, 84 void eigenvectors(const double& a,
82 const double& b, 85 const double& b,
@@ -89,6 +92,7 @@ protected: @@ -89,6 +92,7 @@ protected:
89 92
90 // User parameters 93 // User parameters
91 std::string m_srcname; //!< Name of source to compute butterfly 94 std::string m_srcname; //!< Name of source to compute butterfly
  95 + std::string m_method; //!< Computation method
92 double m_confidence; //!< Confidence level 96 double m_confidence; //!< Confidence level
93 int m_max_iter; //!< Maximum number of iterations 97 int m_max_iter; //!< Maximum number of iterations
94 bool m_apply_edisp; //!< Apply energy dispersion? 98 bool m_apply_edisp; //!< Apply energy dispersion?
src/ctbutterfly/ctbutterfly.par
@@ -27,6 +27,7 @@ caldb, s, a, &quot;prod2&quot;,,, &quot;Calibration database&quot; @@ -27,6 +27,7 @@ caldb, s, a, &quot;prod2&quot;,,, &quot;Calibration database&quot;
27 irf, s, a, "South_0.5h",,, "Instrument response function" 27 irf, s, a, "South_0.5h",,, "Instrument response function"
28 edisp, b, h, no,,, "Apply energy dispersion?" 28 edisp, b, h, no,,, "Apply energy dispersion?"
29 outfile, f, a, "butterfly.txt",,, "Output ASCII file" 29 outfile, f, a, "butterfly.txt",,, "Output ASCII file"
  30 +method, s, h, GAUSSIAN, GAUSSIAN|ENVELOPE,,"Butterfly computation method"
30 31
31 # 32 #
32 # Butterfly parameters 33 # Butterfly parameters
src/ctcubemask/ctcubemask.cpp
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 /***********************************************************************//** 51 /***********************************************************************//**
52 * @brief Void constructor 52 * @brief Void constructor
53 ***************************************************************************/ 53 ***************************************************************************/
54 -ctcubemask::ctcubemask(void) : ctobservation(CTCUBEMASK_NAME, CTCUBEMASK_VERSION) 54 +ctcubemask::ctcubemask(void) : ctobservation(CTCUBEMASK_NAME, VERSION)
55 { 55 {
56 // Initialise members 56 // Initialise members
57 init_members(); 57 init_members();
@@ -70,7 +70,7 @@ ctcubemask::ctcubemask(void) : ctobservation(CTCUBEMASK_NAME, CTCUBEMASK_VERSION @@ -70,7 +70,7 @@ ctcubemask::ctcubemask(void) : ctobservation(CTCUBEMASK_NAME, CTCUBEMASK_VERSION
70 * an observation container. 70 * an observation container.
71 ***************************************************************************/ 71 ***************************************************************************/
72 ctcubemask::ctcubemask(const GObservations& obs) : 72 ctcubemask::ctcubemask(const GObservations& obs) :
73 - ctobservation(CTCUBEMASK_NAME, CTCUBEMASK_VERSION, obs) 73 + ctobservation(CTCUBEMASK_NAME, VERSION, obs)
74 { 74 {
75 // Initialise members 75 // Initialise members
76 init_members(); 76 init_members();
@@ -89,7 +89,7 @@ ctcubemask::ctcubemask(const GObservations&amp; obs) : @@ -89,7 +89,7 @@ ctcubemask::ctcubemask(const GObservations&amp; obs) :
89 * @param[in] argv Array of command line arguments. 89 * @param[in] argv Array of command line arguments.
90 ***************************************************************************/ 90 ***************************************************************************/
91 ctcubemask::ctcubemask(int argc, char *argv[]) : 91 ctcubemask::ctcubemask(int argc, char *argv[]) :
92 - ctobservation(CTCUBEMASK_NAME, CTCUBEMASK_VERSION, argc, argv) 92 + ctobservation(CTCUBEMASK_NAME, VERSION, argc, argv)
93 { 93 {
94 // Initialise members 94 // Initialise members
95 init_members(); 95 init_members();
src/ctcubemask/ctcubemask.hpp
@@ -35,8 +35,7 @@ @@ -35,8 +35,7 @@
35 #include "ctobservation.hpp" 35 #include "ctobservation.hpp"
36 36
37 /* __Definitions _________________________________________________________ */ 37 /* __Definitions _________________________________________________________ */
38 -#define CTCUBEMASK_NAME "ctcubemask"  
39 -#define CTCUBEMASK_VERSION "1.2.0" 38 +#define CTCUBEMASK_NAME "ctcubemask"
40 39
41 40
42 /***********************************************************************//** 41 /***********************************************************************//**
src/ctedispcube/ctedispcube.cpp
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 * 52 *
53 * Constructs an empty energy dispersion tool. 53 * Constructs an empty energy dispersion tool.
54 ***************************************************************************/ 54 ***************************************************************************/
55 -ctedispcube::ctedispcube(void) : ctobservation(CTEDISPCUBE_NAME, CTEDISPCUBE_VERSION) 55 +ctedispcube::ctedispcube(void) : ctobservation(CTEDISPCUBE_NAME, VERSION)
56 { 56 {
57 // Initialise members 57 // Initialise members
58 init_members(); 58 init_members();
@@ -71,7 +71,7 @@ ctedispcube::ctedispcube(void) : ctobservation(CTEDISPCUBE_NAME, CTEDISPCUBE_VER @@ -71,7 +71,7 @@ ctedispcube::ctedispcube(void) : ctobservation(CTEDISPCUBE_NAME, CTEDISPCUBE_VER
71 * in an observation container @p obs. 71 * in an observation container @p obs.
72 ***************************************************************************/ 72 ***************************************************************************/
73 ctedispcube::ctedispcube(const GObservations& obs) : 73 ctedispcube::ctedispcube(const GObservations& obs) :
74 - ctobservation(CTEDISPCUBE_NAME, CTEDISPCUBE_VERSION, obs) 74 + ctobservation(CTEDISPCUBE_NAME, VERSION, obs)
75 { 75 {
76 // Initialise members 76 // Initialise members
77 init_members(); 77 init_members();
@@ -92,7 +92,7 @@ ctedispcube::ctedispcube(const GObservations&amp; obs) : @@ -92,7 +92,7 @@ ctedispcube::ctedispcube(const GObservations&amp; obs) :
92 * on the command line. 92 * on the command line.
93 ***************************************************************************/ 93 ***************************************************************************/
94 ctedispcube::ctedispcube(int argc, char *argv[]) : 94 ctedispcube::ctedispcube(int argc, char *argv[]) :
95 - ctobservation(CTEDISPCUBE_NAME, CTEDISPCUBE_VERSION, argc, argv) 95 + ctobservation(CTEDISPCUBE_NAME, VERSION, argc, argv)
96 { 96 {
97 // Initialise members 97 // Initialise members
98 init_members(); 98 init_members();
src/ctedispcube/ctedispcube.hpp
@@ -33,8 +33,7 @@ @@ -33,8 +33,7 @@
33 #include "ctobservation.hpp" 33 #include "ctobservation.hpp"
34 34
35 /* __Definitions _________________________________________________________ */ 35 /* __Definitions _________________________________________________________ */
36 -#define CTEDISPCUBE_NAME "ctedispcube"  
37 -#define CTEDISPCUBE_VERSION "1.1.0" 36 +#define CTEDISPCUBE_NAME "ctedispcube"
38 37
39 38
40 /***********************************************************************//** 39 /***********************************************************************//**
src/cterror/cterror.cpp
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 * 52 *
53 * Constructs an empty cterror tool. 53 * Constructs an empty cterror tool.
54 ***************************************************************************/ 54 ***************************************************************************/
55 -cterror::cterror(void) : ctlikelihood(CTERROR_NAME, CTERROR_VERSION) 55 +cterror::cterror(void) : ctlikelihood(CTERROR_NAME, VERSION)
56 { 56 {
57 // Initialise members 57 // Initialise members
58 init_members(); 58 init_members();
@@ -70,7 +70,7 @@ cterror::cterror(void) : ctlikelihood(CTERROR_NAME, CTERROR_VERSION) @@ -70,7 +70,7 @@ cterror::cterror(void) : ctlikelihood(CTERROR_NAME, CTERROR_VERSION)
70 * Constructs cterror tool from an observations container. 70 * Constructs cterror tool from an observations container.
71 ***************************************************************************/ 71 ***************************************************************************/
72 cterror::cterror(const GObservations& obs) : 72 cterror::cterror(const GObservations& obs) :
73 - ctlikelihood(CTERROR_NAME, CTERROR_VERSION, obs) 73 + ctlikelihood(CTERROR_NAME, VERSION, obs)
74 { 74 {
75 // Initialise members 75 // Initialise members
76 init_members(); 76 init_members();
@@ -90,7 +90,7 @@ cterror::cterror(const GObservations&amp; obs) : @@ -90,7 +90,7 @@ cterror::cterror(const GObservations&amp; obs) :
90 * parameters that are provided as command line arguments. 90 * parameters that are provided as command line arguments.
91 ***************************************************************************/ 91 ***************************************************************************/
92 cterror::cterror(int argc, char *argv[]) : 92 cterror::cterror(int argc, char *argv[]) :
93 - ctlikelihood(CTERROR_NAME, CTERROR_VERSION, argc, argv) 93 + ctlikelihood(CTERROR_NAME, VERSION, argc, argv)
94 { 94 {
95 // Initialise members 95 // Initialise members
96 init_members(); 96 init_members();
src/cterror/cterror.hpp
@@ -31,8 +31,7 @@ @@ -31,8 +31,7 @@
31 #include "ctlikelihood.hpp" 31 #include "ctlikelihood.hpp"
32 32
33 /* __Definitions _________________________________________________________ */ 33 /* __Definitions _________________________________________________________ */
34 -#define CTERROR_NAME "cterror"  
35 -#define CTERROR_VERSION "1.2.0" 34 +#define CTERROR_NAME "cterror"
36 35
37 36
38 /***********************************************************************//** 37 /***********************************************************************//**
src/ctexpcube/ctexpcube.cpp
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 /***********************************************************************//** 50 /***********************************************************************//**
51 * @brief Void constructor 51 * @brief Void constructor
52 ***************************************************************************/ 52 ***************************************************************************/
53 -ctexpcube::ctexpcube(void) : ctobservation(CTEXPCUBE_NAME, CTEXPCUBE_VERSION) 53 +ctexpcube::ctexpcube(void) : ctobservation(CTEXPCUBE_NAME, VERSION)
54 { 54 {
55 // Initialise members 55 // Initialise members
56 init_members(); 56 init_members();
@@ -69,7 +69,7 @@ ctexpcube::ctexpcube(void) : ctobservation(CTEXPCUBE_NAME, CTEXPCUBE_VERSION) @@ -69,7 +69,7 @@ ctexpcube::ctexpcube(void) : ctobservation(CTEXPCUBE_NAME, CTEXPCUBE_VERSION)
69 * observations container. 69 * observations container.
70 ***************************************************************************/ 70 ***************************************************************************/
71 ctexpcube::ctexpcube(const GObservations& obs) : 71 ctexpcube::ctexpcube(const GObservations& obs) :
72 - ctobservation(CTEXPCUBE_NAME, CTEXPCUBE_VERSION, obs) 72 + ctobservation(CTEXPCUBE_NAME, VERSION, obs)
73 { 73 {
74 // Initialise members 74 // Initialise members
75 init_members(); 75 init_members();
@@ -87,7 +87,7 @@ ctexpcube::ctexpcube(const GObservations&amp; obs) : @@ -87,7 +87,7 @@ ctexpcube::ctexpcube(const GObservations&amp; obs) :
87 * @param[in] argv Array of command line arguments. 87 * @param[in] argv Array of command line arguments.
88 ***************************************************************************/ 88 ***************************************************************************/
89 ctexpcube::ctexpcube(int argc, char *argv[]) : 89 ctexpcube::ctexpcube(int argc, char *argv[]) :
90 - ctobservation(CTEXPCUBE_NAME, CTEXPCUBE_VERSION, argc, argv) 90 + ctobservation(CTEXPCUBE_NAME, VERSION, argc, argv)
91 { 91 {
92 // Initialise members 92 // Initialise members
93 init_members(); 93 init_members();
src/ctexpcube/ctexpcube.hpp
@@ -33,8 +33,7 @@ @@ -33,8 +33,7 @@
33 #include "ctobservation.hpp" 33 #include "ctobservation.hpp"
34 34
35 /* __Definitions _________________________________________________________ */ 35 /* __Definitions _________________________________________________________ */
36 -#define CTEXPCUBE_NAME "ctexpcube"  
37 -#define CTEXPCUBE_VERSION "1.1.0" 36 +#define CTEXPCUBE_NAME "ctexpcube"
38 37
39 38
40 /***********************************************************************//** 39 /***********************************************************************//**
src/ctlike/ctlike.cpp
@@ -48,7 +48,7 @@ @@ -48,7 +48,7 @@
48 /***********************************************************************//** 48 /***********************************************************************//**
49 * @brief Void constructor 49 * @brief Void constructor
50 ***************************************************************************/ 50 ***************************************************************************/
51 -ctlike::ctlike(void) : ctlikelihood(CTLIKE_NAME, CTLIKE_VERSION) 51 +ctlike::ctlike(void) : ctlikelihood(CTLIKE_NAME, VERSION)
52 { 52 {
53 // Initialise members 53 // Initialise members
54 init_members(); 54 init_members();
@@ -66,7 +66,7 @@ ctlike::ctlike(void) : ctlikelihood(CTLIKE_NAME, CTLIKE_VERSION) @@ -66,7 +66,7 @@ ctlike::ctlike(void) : ctlikelihood(CTLIKE_NAME, CTLIKE_VERSION)
66 * Constructs ctlike tool from an observations container. 66 * Constructs ctlike tool from an observations container.
67 ***************************************************************************/ 67 ***************************************************************************/
68 ctlike::ctlike(const GObservations& obs) : 68 ctlike::ctlike(const GObservations& obs) :
69 - ctlikelihood(CTLIKE_NAME, CTLIKE_VERSION, obs) 69 + ctlikelihood(CTLIKE_NAME, VERSION, obs)
70 { 70 {
71 // Initialise members 71 // Initialise members
72 init_members(); 72 init_members();
@@ -86,7 +86,7 @@ ctlike::ctlike(const GObservations&amp; obs) : @@ -86,7 +86,7 @@ ctlike::ctlike(const GObservations&amp; obs) :
86 * that are provided as command line arguments. 86 * that are provided as command line arguments.
87 ***************************************************************************/ 87 ***************************************************************************/
88 ctlike::ctlike(int argc, char *argv[]) : 88 ctlike::ctlike(int argc, char *argv[]) :
89 - ctlikelihood(CTLIKE_NAME, CTLIKE_VERSION, argc, argv) 89 + ctlikelihood(CTLIKE_NAME, VERSION, argc, argv)
90 { 90 {
91 // Initialise members 91 // Initialise members
92 init_members(); 92 init_members();
src/ctlike/ctlike.hpp
@@ -31,8 +31,7 @@ @@ -31,8 +31,7 @@
31 #include "ctlikelihood.hpp" 31 #include "ctlikelihood.hpp"
32 32
33 /* __Definitions _________________________________________________________ */ 33 /* __Definitions _________________________________________________________ */
34 -#define CTLIKE_NAME "ctlike"  
35 -#define CTLIKE_VERSION "1.2.0" 34 +#define CTLIKE_NAME "ctlike"
36 35
37 36
38 /***********************************************************************//** 37 /***********************************************************************//**
src/ctmapcube/ctmapcube.cpp
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 /***********************************************************************//** 50 /***********************************************************************//**
51 * @brief Void constructor 51 * @brief Void constructor
52 ***************************************************************************/ 52 ***************************************************************************/
53 -ctmapcube::ctmapcube(void) : ctool(CTMAPCUBE_NAME, CTMAPCUBE_VERSION) 53 +ctmapcube::ctmapcube(void) : ctool(CTMAPCUBE_NAME, VERSION)
54 { 54 {
55 // Initialise members 55 // Initialise members
56 init_members(); 56 init_members();
@@ -67,7 +67,7 @@ ctmapcube::ctmapcube(void) : ctool(CTMAPCUBE_NAME, CTMAPCUBE_VERSION) @@ -67,7 +67,7 @@ ctmapcube::ctmapcube(void) : ctool(CTMAPCUBE_NAME, CTMAPCUBE_VERSION)
67 * @param[in] argv Array of command line arguments. 67 * @param[in] argv Array of command line arguments.
68 ***************************************************************************/ 68 ***************************************************************************/
69 ctmapcube::ctmapcube(int argc, char *argv[]) : 69 ctmapcube::ctmapcube(int argc, char *argv[]) :
70 - ctool(CTMAPCUBE_NAME, CTMAPCUBE_VERSION, argc, argv) 70 + ctool(CTMAPCUBE_NAME, VERSION, argc, argv)
71 { 71 {
72 // Initialise members 72 // Initialise members
73 init_members(); 73 init_members();
src/ctmapcube/ctmapcube.hpp
@@ -33,8 +33,7 @@ @@ -33,8 +33,7 @@
33 #include "ctool.hpp" 33 #include "ctool.hpp"
34 34
35 /* __Definitions _________________________________________________________ */ 35 /* __Definitions _________________________________________________________ */
36 -#define CTMAPCUBE_NAME "ctmapcube"  
37 -#define CTMAPCUBE_VERSION "1.3.0" 36 +#define CTMAPCUBE_NAME "ctmapcube"
38 37
39 38
40 /***********************************************************************//** 39 /***********************************************************************//**
src/ctmodel/ctmodel.cpp
@@ -53,7 +53,7 @@ const GEnergy g_energy_margin(1.0e-12, &quot;TeV&quot;); @@ -53,7 +53,7 @@ const GEnergy g_energy_margin(1.0e-12, &quot;TeV&quot;);
53 /***********************************************************************//** 53 /***********************************************************************//**
54 * @brief Void constructor 54 * @brief Void constructor
55 ***************************************************************************/ 55 ***************************************************************************/
56 -ctmodel::ctmodel(void) : ctobservation(CTMODEL_NAME, CTMODEL_VERSION) 56 +ctmodel::ctmodel(void) : ctobservation(CTMODEL_NAME, VERSION)
57 { 57 {
58 // Initialise members 58 // Initialise members
59 init_members(); 59 init_members();
@@ -72,7 +72,7 @@ ctmodel::ctmodel(void) : ctobservation(CTMODEL_NAME, CTMODEL_VERSION) @@ -72,7 +72,7 @@ ctmodel::ctmodel(void) : ctobservation(CTMODEL_NAME, CTMODEL_VERSION)
72 * observations container. 72 * observations container.
73 ***************************************************************************/ 73 ***************************************************************************/
74 ctmodel::ctmodel(const GObservations& obs) : 74 ctmodel::ctmodel(const GObservations& obs) :
75 - ctobservation(CTMODEL_NAME, CTMODEL_VERSION, obs) 75 + ctobservation(CTMODEL_NAME, VERSION, obs)
76 { 76 {
77 // Initialise members 77 // Initialise members
78 init_members(); 78 init_members();
@@ -90,7 +90,7 @@ ctmodel::ctmodel(const GObservations&amp; obs) : @@ -90,7 +90,7 @@ ctmodel::ctmodel(const GObservations&amp; obs) :
90 * @param[in] argv Array of command line arguments. 90 * @param[in] argv Array of command line arguments.
91 ***************************************************************************/ 91 ***************************************************************************/
92 ctmodel::ctmodel(int argc, char *argv[]) : 92 ctmodel::ctmodel(int argc, char *argv[]) :
93 - ctobservation(CTMODEL_NAME, CTMODEL_VERSION, argc, argv) 93 + ctobservation(CTMODEL_NAME, VERSION, argc, argv)
94 { 94 {
95 // Initialise members 95 // Initialise members
96 init_members(); 96 init_members();
src/ctmodel/ctmodel.hpp
@@ -33,8 +33,7 @@ @@ -33,8 +33,7 @@
33 #include "ctobservation.hpp" 33 #include "ctobservation.hpp"
34 34
35 /* __Definitions _________________________________________________________ */ 35 /* __Definitions _________________________________________________________ */
36 -#define CTMODEL_NAME "ctmodel"  
37 -#define CTMODEL_VERSION "1.1.0" 36 +#define CTMODEL_NAME "ctmodel"
38 37
39 38
40 /***********************************************************************//** 39 /***********************************************************************//**
src/ctobssim/ctobssim.cpp
@@ -67,7 +67,7 @@ const double g_roi_margin = 0.5; //!&lt; Simulation radius margin (degrees) @@ -67,7 +67,7 @@ const double g_roi_margin = 0.5; //!&lt; Simulation radius margin (degrees)
67 * 67 *
68 * Constructs an empty ctobssim tool. 68 * Constructs an empty ctobssim tool.
69 ***************************************************************************/ 69 ***************************************************************************/
70 -ctobssim::ctobssim(void) : ctobservation(CTOBSSIM_NAME, CTOBSSIM_VERSION) 70 +ctobssim::ctobssim(void) : ctobservation(CTOBSSIM_NAME, VERSION)
71 { 71 {
72 // Initialise members 72 // Initialise members
73 init_members(); 73 init_members();
@@ -85,7 +85,7 @@ ctobssim::ctobssim(void) : ctobservation(CTOBSSIM_NAME, CTOBSSIM_VERSION) @@ -85,7 +85,7 @@ ctobssim::ctobssim(void) : ctobservation(CTOBSSIM_NAME, CTOBSSIM_VERSION)
85 * Constructs ctobssim tool from an observation container. 85 * Constructs ctobssim tool from an observation container.
86 ***************************************************************************/ 86 ***************************************************************************/
87 ctobssim::ctobssim(const GObservations& obs) : 87 ctobssim::ctobssim(const GObservations& obs) :
88 - ctobservation(CTOBSSIM_NAME, CTOBSSIM_VERSION, obs) 88 + ctobservation(CTOBSSIM_NAME, VERSION, obs)
89 { 89 {
90 // Initialise members 90 // Initialise members
91 init_members(); 91 init_members();
@@ -105,7 +105,7 @@ ctobssim::ctobssim(const GObservations&amp; obs) : @@ -105,7 +105,7 @@ ctobssim::ctobssim(const GObservations&amp; obs) :
105 * setting. 105 * setting.
106 ***************************************************************************/ 106 ***************************************************************************/
107 ctobssim::ctobssim(int argc, char *argv[]) : 107 ctobssim::ctobssim(int argc, char *argv[]) :
108 - ctobservation(CTOBSSIM_NAME, CTOBSSIM_VERSION, argc, argv) 108 + ctobservation(CTOBSSIM_NAME, VERSION, argc, argv)
109 { 109 {
110 // Initialise members 110 // Initialise members
111 init_members(); 111 init_members();
src/ctobssim/ctobssim.hpp
@@ -33,8 +33,7 @@ @@ -33,8 +33,7 @@
33 #include "ctobservation.hpp" 33 #include "ctobservation.hpp"
34 34
35 /* __Definitions _________________________________________________________ */ 35 /* __Definitions _________________________________________________________ */
36 -#define CTOBSSIM_NAME "ctobssim"  
37 -#define CTOBSSIM_VERSION "1.2.0" 36 +#define CTOBSSIM_NAME "ctobssim"
38 37
39 38
40 /***********************************************************************//** 39 /***********************************************************************//**
src/ctpsfcube/ctpsfcube.cpp
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 /***********************************************************************//** 49 /***********************************************************************//**
50 * @brief Void constructor 50 * @brief Void constructor
51 ***************************************************************************/ 51 ***************************************************************************/
52 -ctpsfcube::ctpsfcube(void) : ctobservation(CTPSFCUBE_NAME, CTPSFCUBE_VERSION) 52 +ctpsfcube::ctpsfcube(void) : ctobservation(CTPSFCUBE_NAME, VERSION)
53 { 53 {
54 // Initialise members 54 // Initialise members
55 init_members(); 55 init_members();
@@ -68,7 +68,7 @@ ctpsfcube::ctpsfcube(void) : ctobservation(CTPSFCUBE_NAME, CTPSFCUBE_VERSION) @@ -68,7 +68,7 @@ ctpsfcube::ctpsfcube(void) : ctobservation(CTPSFCUBE_NAME, CTPSFCUBE_VERSION)
68 * observations container. 68 * observations container.
69 ***************************************************************************/ 69 ***************************************************************************/
70 ctpsfcube::ctpsfcube(const GObservations& obs) : 70 ctpsfcube::ctpsfcube(const GObservations& obs) :
71 - ctobservation(CTPSFCUBE_NAME, CTPSFCUBE_VERSION, obs) 71 + ctobservation(CTPSFCUBE_NAME, VERSION, obs)
72 { 72 {
73 // Initialise members 73 // Initialise members
74 init_members(); 74 init_members();
@@ -86,7 +86,7 @@ ctpsfcube::ctpsfcube(const GObservations&amp; obs) : @@ -86,7 +86,7 @@ ctpsfcube::ctpsfcube(const GObservations&amp; obs) :
86 * @param[in] argv Array of command line arguments. 86 * @param[in] argv Array of command line arguments.
87 ***************************************************************************/ 87 ***************************************************************************/
88 ctpsfcube::ctpsfcube(int argc, char *argv[]) : 88 ctpsfcube::ctpsfcube(int argc, char *argv[]) :
89 - ctobservation(CTPSFCUBE_NAME, CTPSFCUBE_VERSION, argc, argv) 89 + ctobservation(CTPSFCUBE_NAME, VERSION, argc, argv)
90 { 90 {
91 // Initialise members 91 // Initialise members
92 init_members(); 92 init_members();
src/ctpsfcube/ctpsfcube.hpp
@@ -33,8 +33,7 @@ @@ -33,8 +33,7 @@
33 #include "ctobservation.hpp" 33 #include "ctobservation.hpp"
34 34
35 /* __Definitions _________________________________________________________ */ 35 /* __Definitions _________________________________________________________ */
36 -#define CTPSFCUBE_NAME "ctpsfcube"  
37 -#define CTPSFCUBE_VERSION "1.1.0" 36 +#define CTPSFCUBE_NAME "ctpsfcube"
38 37
39 38
40 /***********************************************************************//** 39 /***********************************************************************//**
src/ctselect/ctselect.cpp
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 /***********************************************************************//** 53 /***********************************************************************//**
54 * @brief Void constructor 54 * @brief Void constructor
55 ***************************************************************************/ 55 ***************************************************************************/
56 -ctselect::ctselect(void) : ctobservation(CTSELECT_NAME, CTSELECT_VERSION) 56 +ctselect::ctselect(void) : ctobservation(CTSELECT_NAME, VERSION)
57 { 57 {
58 // Initialise members 58 // Initialise members
59 init_members(); 59 init_members();
@@ -72,7 +72,7 @@ ctselect::ctselect(void) : ctobservation(CTSELECT_NAME, CTSELECT_VERSION) @@ -72,7 +72,7 @@ ctselect::ctselect(void) : ctobservation(CTSELECT_NAME, CTSELECT_VERSION)
72 * provided in an observation container. 72 * provided in an observation container.
73 ***************************************************************************/ 73 ***************************************************************************/
74 ctselect::ctselect(const GObservations& obs) : 74 ctselect::ctselect(const GObservations& obs) :
75 - ctobservation(CTSELECT_NAME, CTSELECT_VERSION, obs) 75 + ctobservation(CTSELECT_NAME, VERSION, obs)
76 { 76 {
77 // Initialise members 77 // Initialise members
78 init_members(); 78 init_members();
@@ -91,7 +91,7 @@ ctselect::ctselect(const GObservations&amp; obs) : @@ -91,7 +91,7 @@ ctselect::ctselect(const GObservations&amp; obs) :
91 * @param[in] argv Array of command line arguments. 91 * @param[in] argv Array of command line arguments.
92 ***************************************************************************/ 92 ***************************************************************************/
93 ctselect::ctselect(int argc, char *argv[]) : 93 ctselect::ctselect(int argc, char *argv[]) :
94 - ctobservation(CTSELECT_NAME, CTSELECT_VERSION, argc, argv) 94 + ctobservation(CTSELECT_NAME, VERSION, argc, argv)
95 { 95 {
96 // Initialise members 96 // Initialise members
97 init_members(); 97 init_members();
src/ctselect/ctselect.hpp
@@ -35,8 +35,7 @@ @@ -35,8 +35,7 @@
35 #include "ctobservation.hpp" 35 #include "ctobservation.hpp"
36 36
37 /* __Definitions _________________________________________________________ */ 37 /* __Definitions _________________________________________________________ */
38 -#define CTSELECT_NAME "ctselect"  
39 -#define CTSELECT_VERSION "1.2.0" 38 +#define CTSELECT_NAME "ctselect"
40 39
41 40
42 /***********************************************************************//** 41 /***********************************************************************//**
src/ctskymap/ctskymap.cpp
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 * 52 *
53 * Constructs an empty sky mapping tool. 53 * Constructs an empty sky mapping tool.
54 ***************************************************************************/ 54 ***************************************************************************/
55 -ctskymap::ctskymap(void) : ctobservation(CTSKYMAP_NAME, CTSKYMAP_VERSION) 55 +ctskymap::ctskymap(void) : ctobservation(CTSKYMAP_NAME, VERSION)
56 { 56 {
57 // Initialise members 57 // Initialise members
58 init_members(); 58 init_members();
@@ -70,7 +70,7 @@ ctskymap::ctskymap(void) : ctobservation(CTSKYMAP_NAME, CTSKYMAP_VERSION) @@ -70,7 +70,7 @@ ctskymap::ctskymap(void) : ctobservation(CTSKYMAP_NAME, CTSKYMAP_VERSION)
70 * Constructs sky mapping tool from an observation container. 70 * Constructs sky mapping tool from an observation container.
71 ***************************************************************************/ 71 ***************************************************************************/
72 ctskymap::ctskymap(const GObservations& obs) : 72 ctskymap::ctskymap(const GObservations& obs) :
73 - ctobservation(CTSKYMAP_NAME, CTSKYMAP_VERSION, obs) 73 + ctobservation(CTSKYMAP_NAME, VERSION, obs)
74 { 74 {
75 // Initialise members 75 // Initialise members
76 init_members(); 76 init_members();
@@ -91,7 +91,7 @@ ctskymap::ctskymap(const GObservations&amp; obs) : @@ -91,7 +91,7 @@ ctskymap::ctskymap(const GObservations&amp; obs) :
91 * parameter setting. 91 * parameter setting.
92 ***************************************************************************/ 92 ***************************************************************************/
93 ctskymap::ctskymap(int argc, char *argv[]) : 93 ctskymap::ctskymap(int argc, char *argv[]) :
94 - ctobservation(CTSKYMAP_NAME, CTSKYMAP_VERSION, argc, argv) 94 + ctobservation(CTSKYMAP_NAME, VERSION, argc, argv)
95 { 95 {
96 // Initialise members 96 // Initialise members
97 init_members(); 97 init_members();
src/ctskymap/ctskymap.hpp
@@ -32,8 +32,7 @@ @@ -32,8 +32,7 @@
32 #include "ctobservation.hpp" 32 #include "ctobservation.hpp"
33 33
34 /* __Definitions _________________________________________________________ */ 34 /* __Definitions _________________________________________________________ */
35 -#define CTSKYMAP_NAME "ctskymap"  
36 -#define CTSKYMAP_VERSION "1.3.0" 35 +#define CTSKYMAP_NAME "ctskymap"
37 36
38 37
39 /***********************************************************************//** 38 /***********************************************************************//**
src/cttsmap/cttsmap.cpp
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 * 51 *
52 * Constructs an empty cttsmap tool. 52 * Constructs an empty cttsmap tool.
53 ***************************************************************************/ 53 ***************************************************************************/
54 -cttsmap::cttsmap(void) : ctlikelihood(CTTSMAP_NAME, CTTSMAP_VERSION) 54 +cttsmap::cttsmap(void) : ctlikelihood(CTTSMAP_NAME, VERSION)
55 { 55 {
56 // Initialise members 56 // Initialise members
57 init_members(); 57 init_members();
@@ -69,7 +69,7 @@ cttsmap::cttsmap(void) : ctlikelihood(CTTSMAP_NAME, CTTSMAP_VERSION) @@ -69,7 +69,7 @@ cttsmap::cttsmap(void) : ctlikelihood(CTTSMAP_NAME, CTTSMAP_VERSION)
69 * Constructs cttsmap tool from an observations container. 69 * Constructs cttsmap tool from an observations container.
70 ***************************************************************************/ 70 ***************************************************************************/
71 cttsmap::cttsmap(const GObservations& obs) : 71 cttsmap::cttsmap(const GObservations& obs) :
72 - ctlikelihood(CTTSMAP_NAME, CTTSMAP_VERSION, obs) 72 + ctlikelihood(CTTSMAP_NAME, VERSION, obs)
73 { 73 {
74 // Initialise members 74 // Initialise members
75 init_members(); 75 init_members();
@@ -89,7 +89,7 @@ cttsmap::cttsmap(const GObservations&amp; obs) : @@ -89,7 +89,7 @@ cttsmap::cttsmap(const GObservations&amp; obs) :
89 * that are provided as command line arguments. 89 * that are provided as command line arguments.
90 ***************************************************************************/ 90 ***************************************************************************/
91 cttsmap::cttsmap(int argc, char *argv[]) : 91 cttsmap::cttsmap(int argc, char *argv[]) :
92 - ctlikelihood(CTTSMAP_NAME, CTTSMAP_VERSION, argc, argv) 92 + ctlikelihood(CTTSMAP_NAME, VERSION, argc, argv)
93 { 93 {
94 // Initialise members 94 // Initialise members
95 init_members(); 95 init_members();
src/cttsmap/cttsmap.hpp
@@ -31,8 +31,7 @@ @@ -31,8 +31,7 @@
31 #include "ctlikelihood.hpp" 31 #include "ctlikelihood.hpp"
32 32
33 /* __Definitions _________________________________________________________ */ 33 /* __Definitions _________________________________________________________ */
34 -#define CTTSMAP_NAME "cttsmap"  
35 -#define CTTSMAP_VERSION "1.2.0" 34 +#define CTTSMAP_NAME "cttsmap"
36 35
37 36
38 /***********************************************************************//** 37 /***********************************************************************//**
src/ctulimit/ctulimit.cpp
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 * 53 *
54 * Constructs an empty ctulimit tool. 54 * Constructs an empty ctulimit tool.
55 ***************************************************************************/ 55 ***************************************************************************/
56 -ctulimit::ctulimit(void) : ctlikelihood(CTULIMIT_NAME, CTULIMIT_VERSION) 56 +ctulimit::ctulimit(void) : ctlikelihood(CTULIMIT_NAME, VERSION)
57 { 57 {
58 // Initialise members 58 // Initialise members
59 init_members(); 59 init_members();
@@ -71,7 +71,7 @@ ctulimit::ctulimit(void) : ctlikelihood(CTULIMIT_NAME, CTULIMIT_VERSION) @@ -71,7 +71,7 @@ ctulimit::ctulimit(void) : ctlikelihood(CTULIMIT_NAME, CTULIMIT_VERSION)
71 * Constructs ctulimit tool from an observations container. 71 * Constructs ctulimit tool from an observations container.
72 ***************************************************************************/ 72 ***************************************************************************/
73 ctulimit::ctulimit(const GObservations& obs) : 73 ctulimit::ctulimit(const GObservations& obs) :
74 - ctlikelihood(CTULIMIT_NAME, CTULIMIT_VERSION, obs) 74 + ctlikelihood(CTULIMIT_NAME, VERSION, obs)
75 { 75 {
76 // Initialise members 76 // Initialise members
77 init_members(); 77 init_members();
@@ -92,7 +92,7 @@ ctulimit::ctulimit(const GObservations&amp; obs) : @@ -92,7 +92,7 @@ ctulimit::ctulimit(const GObservations&amp; obs) :
92 * parameters that are provided as command line arguments. 92 * parameters that are provided as command line arguments.
93 ***************************************************************************/ 93 ***************************************************************************/
94 ctulimit::ctulimit(int argc, char *argv[]) : 94 ctulimit::ctulimit(int argc, char *argv[]) :
95 - ctlikelihood(CTULIMIT_NAME, CTULIMIT_VERSION, argc, argv) 95 + ctlikelihood(CTULIMIT_NAME, VERSION, argc, argv)
96 { 96 {
97 // Initialise members 97 // Initialise members
98 init_members(); 98 init_members();
src/ctulimit/ctulimit.hpp
@@ -31,8 +31,7 @@ @@ -31,8 +31,7 @@
31 #include "ctlikelihood.hpp" 31 #include "ctlikelihood.hpp"
32 32
33 /* __Definitions _________________________________________________________ */ 33 /* __Definitions _________________________________________________________ */
34 -#define CTULIMIT_NAME "ctulimit"  
35 -#define CTULIMIT_VERSION "1.2.0" 34 +#define CTULIMIT_NAME "ctulimit"
36 35
37 36
38 /***********************************************************************//** 37 /***********************************************************************//**