From e40ac86ce66f115626faf61e446ac182cb4b6c5f Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Tue, 9 Jun 2015 16:23:50 +0200 Subject: [PATCH] Added check if RoI information are valid and throw a meaningful excpetion if it is not the case --- src/ctbin/ctbin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+), 0 deletions(-) diff --git a/src/ctbin/ctbin.cpp b/src/ctbin/ctbin.cpp index 74b285f..e110af9 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()+"\". Consider running ctselect " + "to set the RoI information properly. This is required " + "to proceed with ctbin."; + throw GException::invalid_value(G_FILL_CUBE, msg); + } + // Initialise binning statistics int num_outside_roi = 0; int num_outside_map = 0; -- libgit2 0.21.4