Commit 8a3d351ed81ffac3c0345e38a9c49e20ce208657

Authored by Jürgen Knödlseder
1 parent 523cbd4b

Catch any exception in ctbin::fill_cube() method during WCS conversion

Showing 1 changed file with 5 additions and 5 deletions
src/ctbin/ctbin.cpp
... ... @@ -292,10 +292,10 @@ void ctbin::save(void)
292 292  
293 293 // Save only if observation is valid
294 294 if (obs != NULL) {
295   -
  295 +
296 296 // Log counts cube file name
297 297 log_value(NORMAL, "Counts cube file", m_outcube.url());
298   -
  298 +
299 299 // Save cube
300 300 obs->save(m_outcube, clobber());
301 301  
... ... @@ -517,7 +517,7 @@ void ctbin::fill_cube(GCTAObservation* obs)
517 517 try {
518 518 pixel = m_counts.dir2pix(dir);
519 519 }
520   - catch (const GException::wcs_invalid_phi_theta&) {
  520 + catch (std::exception &e) {
521 521 num_invalid_wcs++;
522 522 continue;
523 523 }
... ... @@ -558,7 +558,7 @@ void ctbin::fill_cube(GCTAObservation* obs)
558 558 log_value(NORMAL, "Events in list", obs->events()->size());
559 559 log_value(NORMAL, "Events in cube", num_in_map);
560 560 log_value(NORMAL, "Events outside RoI", num_outside_roi);
561   - log_value(NORMAL, "Events/data with invalid WCS", num_invalid_wcs);
  561 + log_value(NORMAL, "Events with invalid WCS", num_invalid_wcs);
562 562 log_value(NORMAL, "Events outside cube area", num_outside_map);
563 563 log_value(NORMAL, "Events outside energy bins", num_outside_ebds);
564 564  
... ... @@ -738,7 +738,7 @@ void ctbin::obs_cube(void)
738 738  
739 739 // Append CTA observation
740 740 container.append(obs);
741   -
  741 +
742 742 // Copy over all remaining non-CTA observations
743 743 for (int i = 0; i < m_obs.size(); ++i) {
744 744 GCTAObservation* obs = dynamic_cast<GCTAObservation*>(m_obs[i]);
... ...