Commit a37111d1113900d463bebdc32cb2fa691b5bd7de

Authored by Alexander Ziegler
1 parent ba23ac13

Update log output, clean up

Showing 1 changed file with 14 additions and 7 deletions
src/ctbutterfly/ctbutterfly.cpp
@@ -437,9 +437,17 @@ void ctbutterfly::run(void) @@ -437,9 +437,17 @@ void ctbutterfly::run(void)
437 437
438 // Use gaussian error propagation scheme to calculate 438 // Use gaussian error propagation scheme to calculate
439 // the butterfly 439 // the butterfly
440 - log_header2(TERSE, "Use gaussian error propagation to "  
441 - "calculate butterfly");  
442 440
  441 + // Confidence scaling
  442 + double scale = gammalib::erfinv(m_confidence) * gammalib::sqrt_two;
  443 +
  444 + // Write confidence level information into logger
  445 + log_value(NORMAL, "Confidence level", m_confidence);
  446 + log_value(NORMAL, "Corresponding scaling", scale);
  447 +
  448 + // Write header into logger
  449 + log_header1(TERSE, "Generate butterfly");
  450 +
443 // Initialise dummy time to evaluate spectral model 451 // Initialise dummy time to evaluate spectral model
444 GTime time = GTime(); 452 GTime time = GTime();
445 453
@@ -522,9 +530,8 @@ void ctbutterfly::run(void) @@ -522,9 +530,8 @@ void ctbutterfly::run(void)
522 // Get the error from the scalar product 530 // Get the error from the scalar product
523 double error = std::sqrt(grad * vector); 531 double error = std::sqrt(grad * vector);
524 532
525 - // Confidence scaling  
526 - double sigma = gammalib::erfinv(m_confidence) * gammalib::sqrt_two;  
527 - error *= sigma; 533 + // Multiply with confidence scaling
  534 + error *= scale;
528 535
529 // Store flux, value and energy for saving 536 // Store flux, value and energy for saving
530 m_intensities.push_back(model_flux); 537 m_intensities.push_back(model_flux);
@@ -774,8 +781,8 @@ void ctbutterfly::check_model(void) @@ -774,8 +781,8 @@ void ctbutterfly::check_model(void)
774 if (model->spectral()->type() != "PowerLaw") { 781 if (model->spectral()->type() != "PowerLaw") {
775 std::string msg = "\""+model->spectral()->type()+"\" cannot be " 782 std::string msg = "\""+model->spectral()->type()+"\" cannot be "
776 "used as spectral model for an butterfly " 783 "used as spectral model for an butterfly "
777 - "computation in default mode. Please specify a "  
778 - "power law model or switch to gep mode."; 784 + "computation with method=ENVELOPE. Please specify a "
  785 + "power law model or switch to method GAUSSIAN.";
779 throw GException::invalid_value(G_CHECK_MODEL, msg); 786 throw GException::invalid_value(G_CHECK_MODEL, msg);
780 } 787 }
781 } 788 }