Commit 97a49aa672f663b3f84f2ff3874e697108d67d30

Authored by Jürgen Knödlseder
1 parent 2747c60c

Improve output in print() methods.

inst/cta/src/GCTAEventCube.cpp
... ... @@ -490,16 +490,20 @@ std::string GCTAEventCube::print(const GChatter& chatter) const
490 490 }
491 491  
492 492 // Append energy intervals
493   - if (ebounds().size() > 0) {
494   - result.append("\n"+ebounds().print(gammalib::reduce(chatter)));
495   - }
496   - else {
497   - result.append("\n"+gammalib::parformat("Energy intervals") +
498   - "not defined");
  493 + if (gammalib::reduce(chatter) > SILENT) {
  494 + if (ebounds().size() > 0) {
  495 + result.append("\n"+ebounds().print(gammalib::reduce(chatter)));
  496 + }
  497 + else {
  498 + result.append("\n"+gammalib::parformat("Energy intervals") +
  499 + "not defined");
  500 + }
499 501 }
500 502  
501 503 // Append skymap definition
502   - result.append("\n"+m_map.print(gammalib::reduce(chatter)));
  504 + if (gammalib::reduce(chatter) > SILENT) {
  505 + result.append("\n"+m_map.print(gammalib::reduce(chatter)));
  506 + }
503 507  
504 508 } // endif: chatter was not silent
505 509  
... ...
inst/cta/src/GCTAEventList.cpp
... ... @@ -449,21 +449,25 @@ std::string GCTAEventList::print(const GChatter& chatter) const
449 449 }
450 450  
451 451 // Append energy intervals
452   - if (ebounds().size() > 0) {
453   - result.append("\n"+ebounds().print(gammalib::reduce(chatter)));
454   - }
455   - else {
456   - result.append("\n"+gammalib::parformat("Energy intervals") +
457   - "not defined");
  452 + if (gammalib::reduce(chatter) > SILENT) {
  453 + if (ebounds().size() > 0) {
  454 + result.append("\n"+ebounds().print(gammalib::reduce(chatter)));
  455 + }
  456 + else {
  457 + result.append("\n"+gammalib::parformat("Energy intervals") +
  458 + "not defined");
  459 + }
458 460 }
459 461  
460 462 // Append ROI
461   - if (roi().radius() > 0) {
462   - result.append("\n"+roi().print(gammalib::reduce(chatter)));
463   - }
464   - else {
465   - result.append("\n"+gammalib::parformat("Region of interest") +
466   - "not defined");
  463 + if (gammalib::reduce(chatter) > SILENT) {
  464 + if (roi().radius() > 0) {
  465 + result.append("\n"+roi().print(gammalib::reduce(chatter)));
  466 + }
  467 + else {
  468 + result.append("\n"+gammalib::parformat("Region of interest") +
  469 + "not defined");
  470 + }
467 471 }
468 472  
469 473 // EXPLICIT: Append IRF cache
... ...
inst/cta/src/GCTAObservation.cpp
... ... @@ -654,13 +654,17 @@ std::string GCTAObservation::print(const GChatter& chatter) const
654 654 result.append(gammalib::str(m_deadc));
655 655  
656 656 // Append pointing
657   - result.append("\n"+pointing().print(gammalib::reduce(chatter)));
  657 + if (gammalib::reduce(chatter) > SILENT) {
  658 + result.append("\n"+pointing().print(gammalib::reduce(chatter)));
  659 + }
658 660  
659 661 // Append response
660   - result.append("\n"+response().print(gammalib::reduce(chatter)));
  662 + if (gammalib::reduce(chatter) > SILENT) {
  663 + result.append("\n"+response().print(gammalib::reduce(chatter)));
  664 + }
661 665  
662 666 // Append events
663   - if (m_events != NULL) {
  667 + if (m_events != NULL && gammalib::reduce(chatter) > SILENT) {
664 668 result.append("\n"+m_events->print(gammalib::reduce(chatter)));
665 669 }
666 670  
... ...
inst/cta/src/GCTAPointing.cpp
... ... @@ -231,7 +231,7 @@ std::string GCTAPointing::print(const GChatter& chatter) const
231 231  
232 232 // Append information
233 233 result.append("\n"+gammalib::parformat("Pointing direction"));
234   - result.append(this->dir().print(gammalib::reduce(chatter)));
  234 + result.append(this->dir().print());
235 235  
236 236 } // endif: chatter was not silent
237 237  
... ...