Commit 09dc609e4f942e75c2bf56b77d7554719811cbec
1 parent
784a46ef
Integrate code and update documentation
Showing
5 changed files
with
53 additions
and
25 deletions
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 | * Version 1.0.0 released | 3 | * Version 1.0.0 released |
| 4 | ======================== | 4 | ======================== |
| 5 | 5 | ||
| 6 | Adapt to GammaLib 1.0.0 interface | 6 | Adapt to GammaLib 1.0.0 interface |
| 7 | Do not import automatically Python scripts | 7 | Do not import automatically Python scripts |
| 8 | + Support INDEF/NONE/UNDEF/UNDEFINED parameters in ctselect | ||
| 8 | 9 | ||
| 9 | 10 | ||
| 10 | 2015-01-08 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> | 11 | 2015-01-08 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> |
NEWS
| @@ -2,7 +2,7 @@ New Features and Important Changes in ctools 1.0.0 | @@ -2,7 +2,7 @@ New Features and Important Changes in ctools 1.0.0 | ||
| 2 | 2 | ||
| 3 | Author(s) : Juergen Knoedlseder | 3 | Author(s) : Juergen Knoedlseder |
| 4 | 4 | ||
| 5 | -2 February 2015 | 5 | +16 February 2015 |
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | 1. Introduction | 8 | 1. Introduction |
| @@ -38,7 +38,8 @@ None | @@ -38,7 +38,8 @@ None | ||
| 38 | 38 | ||
| 39 | 6. ctselect - CTA event selection | 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 | 7. ctbin - CTA event binning | 45 | 7. ctbin - CTA event binning |
doc/source/reference_manual/ctselect.rst
| @@ -30,24 +30,38 @@ General parameters | @@ -30,24 +30,38 @@ General parameters | ||
| 30 | 30 | ||
| 31 | ``ra [real]`` | 31 | ``ra [real]`` |
| 32 | Right Ascension of acceptance cone (or ROI) centre (J2000, in degrees). | 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 | ``dec [real]`` | 36 | ``dec [real]`` |
| 35 | Declination of acceptance cone (or ROI) centre (J2000, in degrees). | 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 | ``rad [real]`` | 41 | ``rad [real]`` |
| 38 | Radius of acceptance cone (or ROI) centre (in degrees). | 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 | ``tmin [real]`` | 46 | ``tmin [real]`` |
| 41 | CTA mission elapsed start time defining the earliest event (in seconds). | 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 | ``tmax [real]`` | 51 | ``tmax [real]`` |
| 44 | CTA mission elapsed stop time defining the latest event (in seconds). | 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 | ``emin [real]`` | 56 | ``emin [real]`` |
| 47 | Lower energy limit of events (in TeV). | 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 | ``emax [real]`` | 61 | ``emax [real]`` |
| 50 | Upper energy limit of events (in TeV). | 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 | ``(expr = "") [string]`` | 66 | ``(expr = "") [string]`` |
| 53 | Additional event selection expression (cfitsio syntax). | 67 | Additional event selection expression (cfitsio syntax). |
src/ctselect/ctselect.cpp
| @@ -406,8 +406,8 @@ void ctselect::init_members(void) | @@ -406,8 +406,8 @@ void ctselect::init_members(void) | ||
| 406 | m_timemin.clear(); | 406 | m_timemin.clear(); |
| 407 | m_timemax.clear(); | 407 | m_timemax.clear(); |
| 408 | m_select_energy = true; | 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 | // Return | 412 | // Return |
| 413 | return; | 413 | return; |
| @@ -436,13 +436,13 @@ void ctselect::copy_members(const ctselect& app) | @@ -436,13 +436,13 @@ void ctselect::copy_members(const ctselect& app) | ||
| 436 | m_usethres = app.m_usethres; | 436 | m_usethres = app.m_usethres; |
| 437 | 437 | ||
| 438 | // Copy protected members | 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 | m_select_energy = app.m_select_energy; | 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 | // Return | 447 | // Return |
| 448 | return; | 448 | return; |
| @@ -471,6 +471,11 @@ void ctselect::free_members(void) | @@ -471,6 +471,11 @@ void ctselect::free_members(void) | ||
| 471 | ***************************************************************************/ | 471 | ***************************************************************************/ |
| 472 | void ctselect::get_parameters(void) | 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 | // If there are no observations in container then load them via user | 479 | // If there are no observations in container then load them via user |
| 475 | // parameters | 480 | // parameters |
| 476 | if (m_obs.size() == 0) { | 481 | if (m_obs.size() == 0) { |
| @@ -489,8 +494,8 @@ void ctselect::get_parameters(void) | @@ -489,8 +494,8 @@ void ctselect::get_parameters(void) | ||
| 489 | 494 | ||
| 490 | // Check RA/DEC parameters for validity to read | 495 | // Check RA/DEC parameters for validity to read |
| 491 | if ((*this)["ra"].is_valid() && (*this)["dec"].is_valid()) { | 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 | m_select_roi = true; | 499 | m_select_roi = true; |
| 495 | } | 500 | } |
| 496 | else { | 501 | else { |
| @@ -500,7 +505,7 @@ void ctselect::get_parameters(void) | @@ -500,7 +505,7 @@ void ctselect::get_parameters(void) | ||
| 500 | 505 | ||
| 501 | // Check if radius is vaild for a RoI selection | 506 | // Check if radius is vaild for a RoI selection |
| 502 | if (m_select_roi && (*this)["rad"].is_valid()) { | 507 | if (m_select_roi && (*this)["rad"].is_valid()) { |
| 503 | - m_rad = (*this)["rad"].real(); | 508 | + m_rad = (*this)["rad"].real(); |
| 504 | } | 509 | } |
| 505 | else { | 510 | else { |
| 506 | m_select_roi = false; | 511 | m_select_roi = false; |
| @@ -508,13 +513,18 @@ void ctselect::get_parameters(void) | @@ -508,13 +513,18 @@ void ctselect::get_parameters(void) | ||
| 508 | 513 | ||
| 509 | // Check for sanity of time selection parameters | 514 | // Check for sanity of time selection parameters |
| 510 | if ((*this)["tmin"].is_valid() && (*this)["tmax"].is_valid()) { | 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 | // Additional check for time values | 521 | // Additional check for time values |
| 515 | if (m_tmin >= m_tmax) { | 522 | if (m_tmin >= m_tmax) { |
| 516 | m_select_time = false; | 523 | m_select_time = false; |
| 517 | } | 524 | } |
| 525 | + else { | ||
| 526 | + m_select_time = true; | ||
| 527 | + } | ||
| 518 | } | 528 | } |
| 519 | else { | 529 | else { |
| 520 | m_select_time = false; | 530 | m_select_time = false; |
| @@ -522,13 +532,15 @@ void ctselect::get_parameters(void) | @@ -522,13 +532,15 @@ void ctselect::get_parameters(void) | ||
| 522 | 532 | ||
| 523 | // Check for sanity of energy selection parameters | 533 | // Check for sanity of energy selection parameters |
| 524 | if ((*this)["emin"].is_valid() && (*this)["emax"].is_valid()) { | 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 | else { | 539 | else { |
| 529 | m_select_energy = false; | 540 | m_select_energy = false; |
| 530 | } | 541 | } |
| 531 | 542 | ||
| 543 | + // Get other User parameters | ||
| 532 | m_expr = (*this)["expr"].string(); | 544 | m_expr = (*this)["expr"].string(); |
| 533 | m_usethres = (*this)["usethres"].string(); | 545 | m_usethres = (*this)["usethres"].string(); |
| 534 | 546 |
src/ctselect/ctselect.hpp
| @@ -96,13 +96,13 @@ protected: | @@ -96,13 +96,13 @@ protected: | ||
| 96 | std::string m_usethres; //!< Energy threshold type | 96 | std::string m_usethres; //!< Energy threshold type |
| 97 | 97 | ||
| 98 | // Protected members | 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 |