Commit 09dc609e4f942e75c2bf56b77d7554719811cbec

Authored by Jürgen Knödlseder
1 parent 784a46ef

Integrate code and update documentation

ChangeLog
1   -2015-02-02 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
  1 +2015-02-16 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
2 2  
3 3 * Version 1.0.0 released
4 4 ========================
5 5  
6 6 Adapt to GammaLib 1.0.0 interface
7 7 Do not import automatically Python scripts
  8 + Support INDEF/NONE/UNDEF/UNDEFINED parameters in ctselect
8 9  
9 10  
10 11 2015-01-08 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
... ...
... ... @@ -2,7 +2,7 @@ New Features and Important Changes in ctools 1.0.0
2 2  
3 3 Author(s) : Juergen Knoedlseder
4 4  
5   -2 February 2015
  5 +16 February 2015
6 6  
7 7  
8 8 1. Introduction
... ... @@ -38,7 +38,8 @@ None
38 38  
39 39 6. ctselect - CTA event selection
40 40 ---------------------------------
41   -None
  41 +If INDEF, UNDEF, NONE or UNDEFINED are passed for the selection parameters, no
  42 +selection will be performed.
42 43  
43 44  
44 45 7. ctbin - CTA event binning
... ...
doc/source/reference_manual/ctselect.rst
... ... @@ -30,24 +30,38 @@ General parameters
30 30  
31 31 ``ra [real]``
32 32 Right Ascension of acceptance cone (or ROI) centre (J2000, in degrees).
  33 + If INDEF, NONE, UNDEF or UNDEFINED is passed as value, not ROI
  34 + selection will be performed.
33 35  
34 36 ``dec [real]``
35 37 Declination of acceptance cone (or ROI) centre (J2000, in degrees).
  38 + If INDEF, NONE, UNDEF or UNDEFINED is passed as value, not ROI
  39 + selection will be performed.
36 40  
37 41 ``rad [real]``
38 42 Radius of acceptance cone (or ROI) centre (in degrees).
  43 + If INDEF, NONE, UNDEF or UNDEFINED is passed as value, not ROI
  44 + selection will be performed.
39 45  
40 46 ``tmin [real]``
41 47 CTA mission elapsed start time defining the earliest event (in seconds).
  48 + If INDEF, NONE, UNDEF or UNDEFINED is passed as value, not time
  49 + selection will be performed.
42 50  
43 51 ``tmax [real]``
44 52 CTA mission elapsed stop time defining the latest event (in seconds).
  53 + If INDEF, NONE, UNDEF or UNDEFINED is passed as value, not time
  54 + selection will be performed.
45 55  
46 56 ``emin [real]``
47 57 Lower energy limit of events (in TeV).
  58 + If INDEF, NONE, UNDEF or UNDEFINED is passed as value, not energy
  59 + selection will be performed.
48 60  
49 61 ``emax [real]``
50 62 Upper energy limit of events (in TeV).
  63 + If INDEF, NONE, UNDEF or UNDEFINED is passed as value, not energy
  64 + selection will be performed.
51 65  
52 66 ``(expr = "") [string]``
53 67 Additional event selection expression (cfitsio syntax).
... ...
src/ctselect/ctselect.cpp
... ... @@ -406,8 +406,8 @@ void ctselect::init_members(void)
406 406 m_timemin.clear();
407 407 m_timemax.clear();
408 408 m_select_energy = true;
409   - m_select_roi = true;
410   - m_select_time = true;
  409 + m_select_roi = true;
  410 + m_select_time = true;
411 411  
412 412 // Return
413 413 return;
... ... @@ -436,13 +436,13 @@ void ctselect::copy_members(const ctselect&amp; app)
436 436 m_usethres = app.m_usethres;
437 437  
438 438 // Copy protected members
439   - m_obs = app.m_obs;
440   - m_infiles = app.m_infiles;
441   - m_timemin = app.m_timemin;
442   - m_timemax = app.m_timemax;
  439 + m_obs = app.m_obs;
  440 + m_infiles = app.m_infiles;
  441 + m_timemin = app.m_timemin;
  442 + m_timemax = app.m_timemax;
443 443 m_select_energy = app.m_select_energy;
444   - m_select_roi = app.m_select_roi;
445   - m_select_time = app.m_select_time;
  444 + m_select_roi = app.m_select_roi;
  445 + m_select_time = app.m_select_time;
446 446  
447 447 // Return
448 448 return;
... ... @@ -471,6 +471,11 @@ void ctselect::free_members(void)
471 471 ***************************************************************************/
472 472 void ctselect::get_parameters(void)
473 473 {
  474 + // Initialise selection flags
  475 + m_select_energy = true;
  476 + m_select_roi = true;
  477 + m_select_time = true;
  478 +
474 479 // If there are no observations in container then load them via user
475 480 // parameters
476 481 if (m_obs.size() == 0) {
... ... @@ -489,8 +494,8 @@ void ctselect::get_parameters(void)
489 494  
490 495 // Check RA/DEC parameters for validity to read
491 496 if ((*this)["ra"].is_valid() && (*this)["dec"].is_valid()) {
492   - m_ra = (*this)["ra"].real();
493   - m_dec = (*this)["dec"].real();
  497 + m_ra = (*this)["ra"].real();
  498 + m_dec = (*this)["dec"].real();
494 499 m_select_roi = true;
495 500 }
496 501 else {
... ... @@ -500,7 +505,7 @@ void ctselect::get_parameters(void)
500 505  
501 506 // Check if radius is vaild for a RoI selection
502 507 if (m_select_roi && (*this)["rad"].is_valid()) {
503   - m_rad = (*this)["rad"].real();
  508 + m_rad = (*this)["rad"].real();
504 509 }
505 510 else {
506 511 m_select_roi = false;
... ... @@ -508,13 +513,18 @@ void ctselect::get_parameters(void)
508 513  
509 514 // Check for sanity of time selection parameters
510 515 if ((*this)["tmin"].is_valid() && (*this)["tmax"].is_valid()) {
511   - m_tmin = (*this)["tmin"].real();
512   - m_tmax = (*this)["tmax"].real();
  516 +
  517 + // Get User parameters
  518 + m_tmin = (*this)["tmin"].real();
  519 + m_tmax = (*this)["tmax"].real();
513 520  
514 521 // Additional check for time values
515 522 if (m_tmin >= m_tmax) {
516 523 m_select_time = false;
517 524 }
  525 + else {
  526 + m_select_time = true;
  527 + }
518 528 }
519 529 else {
520 530 m_select_time = false;
... ... @@ -522,13 +532,15 @@ void ctselect::get_parameters(void)
522 532  
523 533 // Check for sanity of energy selection parameters
524 534 if ((*this)["emin"].is_valid() && (*this)["emax"].is_valid()) {
525   - m_emin = (*this)["emin"].real();
526   - m_emax = (*this)["emax"].real();
  535 + m_emin = (*this)["emin"].real();
  536 + m_emax = (*this)["emax"].real();
  537 + m_select_energy = true;
527 538 }
528 539 else {
529 540 m_select_energy = false;
530 541 }
531 542  
  543 + // Get other User parameters
532 544 m_expr = (*this)["expr"].string();
533 545 m_usethres = (*this)["usethres"].string();
534 546  
... ...
src/ctselect/ctselect.hpp
... ... @@ -96,13 +96,13 @@ protected:
96 96 std::string m_usethres; //!< Energy threshold type
97 97  
98 98 // Protected members
99   - GObservations m_obs; //!< Observations container
100   - std::vector<std::string> m_infiles; //!< Input event filenames
101   - GTime m_timemin; //!< Earliest time
102   - GTime m_timemax; //!< Latest time
103   - bool m_select_energy; //!< Flag that signals to perform energy selection
104   - bool m_select_roi; //!< Flag that signals to perform energy selection
105   - bool m_select_time; //!< Flag that signals to perform energy selection
  99 + GObservations m_obs; //!< Observations container
  100 + std::vector<std::string> m_infiles; //!< Input event filenames
  101 + GTime m_timemin; //!< Earliest time
  102 + GTime m_timemax; //!< Latest time
  103 + bool m_select_energy; //!< Perform energy selection
  104 + bool m_select_roi; //!< Perform ROI selection
  105 + bool m_select_time; //!< Perform time selection
106 106  
107 107 };
108 108  
... ...