Commit 3335d555306d37a7b58fcc45fa1b95635ee1e1ba

Authored by Jürgen Knödlseder
1 parent 052e74fa

Take into account RoI in ctskymap

ChangeLog
1   -2017-03-13
  1 +2017-03-18
2 2  
3 3 * Version 1.3.0 released
4 4 ========================
5 5  
  6 + Take into account RoI in ctskymap
6 7 Set local language to english (#1370)
7 8 Enhance logfile output of csroot2caldb script
8 9 Set default deadc value to 0.98 (CTA has <2% deadtime)
... ...
1 1 New Features and Important Changes in ctools 1.3.0.dev1
2 2  
3   -13 March 2017
  3 +18 March 2017
4 4  
5 5  
6 6 Introduction
... ... @@ -52,7 +52,8 @@ None
52 52  
53 53 ctskymap - CTA sky mapping
54 54 --------------------------
55   -None
  55 +Any RoI is now taken into account in ctskymap so that if IRF background
  56 +subtraction is requested the counts and background maps are coherent.
56 57  
57 58  
58 59 ctmodel - CTA counts cube modelling
... ...
src/ctskymap/ctskymap.cpp
... ... @@ -489,10 +489,14 @@ void ctskymap::map_events(GCTAObservation* obs)
489 489 emax.TeV(m_emax);
490 490  
491 491 // Initialise binning statistics
  492 + int num_outside_roi = 0;
492 493 int num_outside_map = 0;
493 494 int num_outside_erange = 0;
494 495 int num_in_map = 0;
495 496  
  497 + // Extract region of interest from observation
  498 + GCTARoi roi = obs->roi();
  499 +
496 500 // Fill sky map
497 501 for (int i = 0; i < events->size(); ++i) {
498 502  
... ... @@ -517,6 +521,12 @@ void ctskymap::map_events(GCTAObservation* obs)
517 521 continue;
518 522 }
519 523  
  524 + // If RoI is valid then skip if instrument direction is not within RoI
  525 + if (roi.is_valid() && !roi.contains(*inst)) {
  526 + continue;
  527 + num_outside_roi++;
  528 + }
  529 +
520 530 // Fill event in skymap
521 531 m_skymap(pixel, 0) += 1.0;
522 532 num_in_map++;
... ... @@ -526,6 +536,7 @@ void ctskymap::map_events(GCTAObservation* obs)
526 536 // Log binning results
527 537 log_value(NORMAL, "Events in list", obs->events()->size());
528 538 log_value(NORMAL, "Events in map", num_in_map);
  539 + log_value(NORMAL, "Events outside RoI", num_outside_roi);
529 540 log_value(NORMAL, "Events outside map area", num_outside_map);
530 541 log_value(NORMAL, "Events outside energies", num_outside_erange);
531 542  
... ... @@ -614,6 +625,9 @@ void ctskymap::map_background_irf(GCTAObservation* obs)
614 625 nebin = 10;
615 626 }
616 627  
  628 + // Extract region of interest from observation
  629 + GCTARoi roi = obs->roi();
  630 +
617 631 // Setup energy nodes for computation
618 632 GEnergies energies(nebin, emin, emax); // More complicated nbins later
619 633  
... ... @@ -626,6 +640,12 @@ void ctskymap::map_background_irf(GCTAObservation* obs)
626 640 // Convert sky direction in instrument direction
627 641 GCTAInstDir instdir = obs->pointing().instdir(skydir);
628 642  
  643 + // If RoI is valid and instrument direction is not within RoI then
  644 + // skip pixel
  645 + if (roi.is_valid() && !roi.contains(instdir)) {
  646 + continue;
  647 + }
  648 +
629 649 // Compute background value for each energy node
630 650 std::vector<double> values(energies.size(), 0.0);
631 651 for (int k = 0; k < energies.size(); ++k) {
... ...
src/ctskymap/ctskymap.hpp
1 1 /***************************************************************************
2 2 * ctskymap - Sky mapping tool *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2016 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2017 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -33,7 +33,7 @@
33 33  
34 34 /* __Definitions _________________________________________________________ */
35 35 #define CTSKYMAP_NAME "ctskymap"
36   -#define CTSKYMAP_VERSION "1.2.0"
  36 +#define CTSKYMAP_VERSION "1.3.0"
37 37  
38 38  
39 39 /***********************************************************************//**
... ...