Commit 6607b27d79db6ad5ed5a61e37260e1ff62cc88ee

Authored by Jürgen Knödlseder
1 parent 9b861497

Enhance log information in fill() methods.

inst/cta/src/GCTACubeBackground.cpp
... ... @@ -293,8 +293,11 @@ void GCTACubeBackground::fill(const GObservations& obs, GLog* log)
293 293 // Skip observation if it's not CTA
294 294 if (cta == NULL) {
295 295 if (log != NULL) {
296   - *log << "Warning: Skipping "+obs[i]->instrument()+" observation ";
297   - *log << "\"" << obs[i]->name() << "\"" <<std::endl;
  296 + *log << "Skipping ";
  297 + *log << obs[i]->instrument();
  298 + *log << " observation ";
  299 + *log << "\"" << obs[i]->name() << "\"";
  300 + *log << " (id=" << obs[i]->id() << ")" << std::endl;
298 301 }
299 302 continue;
300 303 }
... ... @@ -302,12 +305,24 @@ void GCTACubeBackground::fill(const GObservations&amp; obs, GLog* log)
302 305 // Skip observation if we have a binned observation
303 306 if (cta->eventtype() == "CountsCube") {
304 307 if (log != NULL) {
305   - *log << "Warning: Skipping binned observation ";
306   - *log << "\"" << cta->name() << "\"" <<std::endl;
  308 + *log << "Skipping binned ";
  309 + *log << cta->instrument();
  310 + *log << " observation ";
  311 + *log << "\"" << cta->name() << "\"";
  312 + *log << " (id=" << cta->id() << ")" << std::endl;
307 313 }
308 314 continue;
309 315 }
310 316  
  317 + // Announce observation usage
  318 + if (log != NULL) {
  319 + *log << "Including ";
  320 + *log << cta->instrument();
  321 + *log << " observation \"" << cta->name();
  322 + *log << "\" (id=" << cta->id() << ")";
  323 + *log << " in background cube computation." << std::endl;
  324 + }
  325 +
311 326 // Extract region of interest from CTA observation
312 327 GCTARoi roi = cta->roi();
313 328  
... ...
inst/cta/src/GCTACubeExposure.cpp
... ... @@ -389,8 +389,11 @@ void GCTACubeExposure::fill(const GObservations&amp; obs, GLog* log)
389 389 // Skip observation if it's not CTA
390 390 if (cta == NULL) {
391 391 if (log != NULL) {
392   - *log << "Warning: Skipping "+obs[i]->instrument()+" observation ";
393   - *log << "\"" << obs[i]->name() << "\"" <<std::endl;
  392 + *log << "Skipping ";
  393 + *log << obs[i]->instrument();
  394 + *log << " observation ";
  395 + *log << "\"" << obs[i]->name() << "\"";
  396 + *log << " (id=" << obs[i]->id() << ")" << std::endl;
394 397 }
395 398 continue;
396 399 }
... ... @@ -398,8 +401,11 @@ void GCTACubeExposure::fill(const GObservations&amp; obs, GLog* log)
398 401 // Skip observation if we have a binned observation
399 402 if (cta->eventtype() == "CountsCube") {
400 403 if (log != NULL) {
401   - *log << "Warning: Skipping binned observation ";
402   - *log << "\"" << cta->name() << "\"" <<std::endl;
  404 + *log << "Skipping binned ";
  405 + *log << cta->instrument();
  406 + *log << " observation ";
  407 + *log << "\"" << cta->name() << "\"";
  408 + *log << " (id=" << cta->id() << ")" << std::endl;
403 409 }
404 410 continue;
405 411 }
... ... @@ -414,11 +420,24 @@ void GCTACubeExposure::fill(const GObservations&amp; obs, GLog* log)
414 420 // Skip observation if we don't have an unbinned observation
415 421 if (rsp == NULL) {
416 422 if (log != NULL) {
417   - *log << "Warning: Observation \"" << cta->name();
418   - *log << "\" contains no IRF response." <<std::endl;
  423 + *log << "WARNING: ";
  424 + *log << cta->instrument();
  425 + *log << " observation \"" << cta->name();
  426 + *log << "\" (id=" << cta->id() << ")";
  427 + *log << " contains no IRF response.";
  428 + *log << " Skipping this observation." << std::endl;
419 429 }
420 430 continue;
421 431 }
  432 +
  433 + // Announce observation usage
  434 + if (log != NULL) {
  435 + *log << "Including ";
  436 + *log << cta->instrument();
  437 + *log << " observation \"" << cta->name();
  438 + *log << "\" (id=" << cta->id() << ")";
  439 + *log << " in exposure cube computation." << std::endl;
  440 + }
422 441  
423 442 // Loop over all pixels in sky map
424 443 for (int pixel = 0; pixel < m_cube.npix(); ++pixel) {
... ...
inst/cta/src/GCTACubePsf.cpp
... ... @@ -454,8 +454,11 @@ void GCTACubePsf::fill(const GObservations&amp; obs, GLog* log)
454 454 // Skip observation if it's not CTA
455 455 if (cta == NULL) {
456 456 if (log != NULL) {
457   - *log << "Warning: Skipping "+obs[i]->instrument()+" observation ";
458   - *log << "\"" << obs[i]->name() << "\"" <<std::endl;
  457 + *log << "Skipping ";
  458 + *log << obs[i]->instrument();
  459 + *log << " observation ";
  460 + *log << "\"" << obs[i]->name() << "\"";
  461 + *log << " (id=" << obs[i]->id() << ")" << std::endl;
459 462 }
460 463 continue;
461 464 }
... ... @@ -463,8 +466,11 @@ void GCTACubePsf::fill(const GObservations&amp; obs, GLog* log)
463 466 // Skip observation if we have a binned observation
464 467 if (cta->eventtype() == "CountsCube") {
465 468 if (log != NULL) {
466   - *log << "Warning: Skipping binned observation ";
467   - *log << "\"" << cta->name() << "\"" <<std::endl;
  469 + *log << "Skipping binned ";
  470 + *log << cta->instrument();
  471 + *log << " observation ";
  472 + *log << "\"" << cta->name() << "\"";
  473 + *log << " (id=" << cta->id() << ")" << std::endl;
468 474 }
469 475 continue;
470 476 }
... ... @@ -479,12 +485,25 @@ void GCTACubePsf::fill(const GObservations&amp; obs, GLog* log)
479 485 // Skip observation if we don't have an unbinned observation
480 486 if (rsp == NULL) {
481 487 if (log != NULL) {
482   - *log << "Warning: Observation \"" << cta->name();
483   - *log << "\" contains no IRF response." <<std::endl;
  488 + *log << "WARNING: ";
  489 + *log << cta->instrument();
  490 + *log << " observation \"" << cta->name();
  491 + *log << "\" (id=" << cta->id() << ")";
  492 + *log << " contains no IRF response.";
  493 + *log << " Skipping this observation." << std::endl;
484 494 }
485 495 continue;
486 496 }
487 497  
  498 + // Announce observation usage
  499 + if (log != NULL) {
  500 + *log << "Including ";
  501 + *log << cta->instrument();
  502 + *log << " observation \"" << cta->name();
  503 + *log << "\" (id=" << cta->id() << ")";
  504 + *log << " in point spread function cube computation." << std::endl;
  505 + }
  506 +
488 507 // Loop over all pixels in sky map
489 508 for (int pixel = 0; pixel < m_cube.npix(); ++pixel) {
490 509  
... ...