diff --git a/ChangeLog b/ChangeLog index 808365b..d8d1a3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,9 @@ -2015-06-05 Juergen Knoedlseder +2015-06-09 Juergen Knoedlseder * Version 0.10.0 released ========================= + Check existence of ROI in ctbin (#1476) Allocate optimizer in ctlike upon construction (#1471) Move cscripts into the ctools Python module (#1470) diff --git a/NEWS b/NEWS index afa1965..bfecfa4 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ New Features and Important Changes in ctools 0.10.0 Author(s) : Juergen Knoedlseder -5 June 2015 +9 June 2015 1. Introduction @@ -40,7 +40,8 @@ None 7. ctbin - CTA event binning ---------------------------- -None +ctbin now verifies if an ROI has been set properly, and throws an exception in +case that no ROI information could be found. 8. ctlike - Maximum likelihood fitting diff --git a/src/ctbin/ctbin.cpp b/src/ctbin/ctbin.cpp index 74b285f..7070f2f 100644 --- a/src/ctbin/ctbin.cpp +++ b/src/ctbin/ctbin.cpp @@ -455,6 +455,15 @@ void ctbin::fill_cube(GCTAObservation* obs) // Get the RoI const GCTARoi& roi = events->roi(); + // Check for RoI sanity + if (!roi.is_valid()) { + std::string msg = "No RoI information found in input observation " + "\""+obs->name()+"\". Run ctselect to specify " + "an RoI for this observation before running " + "ctbin."; + throw GException::invalid_value(G_FILL_CUBE, msg); + } + // Initialise binning statistics int num_outside_roi = 0; int num_outside_map = 0;