From 8830ee7cbf946f40a5a898d9194dd65012f22c14 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 19 Nov 2013 10:19:36 +0100 Subject: [PATCH] Adapt to new GCTARoi and GCTAInstDir interface. --- src/ctobssim/ctobssim.cpp | 13 ++++--------- src/ctselect/ctselect.cpp | 9 +++------ test/test_ctools.sh | 2 +- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/ctobssim/ctobssim.cpp b/src/ctobssim/ctobssim.cpp index 84cf9f0..a6ec4a7 100644 --- a/src/ctobssim/ctobssim.cpp +++ b/src/ctobssim/ctobssim.cpp @@ -548,11 +548,7 @@ void ctobssim::set_list(GCTAObservation* obs) pnt.dir(skydir); // Set ROI - GCTARoi roi; - GCTAInstDir instdir; - instdir.radec_deg(m_ra, m_dec); - roi.centre(instdir); - roi.radius(m_rad); + GCTARoi roi(GCTAInstDir(skydir), m_rad); // Set GTI GGti gti(m_cta_ref); @@ -747,9 +743,9 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels& models, *obs, ran); if (event != NULL) { + // Use event only if it falls within ROI - if (event->dir().dist_deg(events->roi().centre().dir()) <= - events->roi().radius()) { + if (events->roi().contains(*event)) { event->event_id(m_event_id); events->append(*event); m_event_id++; @@ -898,8 +894,7 @@ void ctobssim::simulate_background(GCTAObservation* obs, GCTAEventAtom* event = (*list)[k]; // Use event only if it falls within ROI - if (event->dir().dist_deg(events->roi().centre().dir()) <= - events->roi().radius()) { + if (events->roi().contains(*event)) { // Set event identifier event->event_id(m_event_id); diff --git a/src/ctselect/ctselect.cpp b/src/ctselect/ctselect.cpp index 7e955d2..4247ae1 100644 --- a/src/ctselect/ctselect.cpp +++ b/src/ctselect/ctselect.cpp @@ -505,7 +505,7 @@ void ctselect::select_events(GCTAObservation* obs, const std::string& filename) double dec = m_dec; if (m_usepnt) { const GCTAPointing *pnt = obs->pointing(); - ra = pnt->dir().ra_deg(); + ra = pnt->dir().ra_deg(); dec = pnt->dir().dec_deg(); } @@ -644,12 +644,9 @@ void ctselect::select_events(GCTAObservation* obs, const std::string& filename) static_cast(const_cast(obs->events())); // Set ROI - GCTARoi roi; GCTAInstDir instdir; - instdir.radec_deg(ra, dec); - roi.centre(instdir); - roi.radius(m_rad); - list->roi(roi); + instdir.dir().radec_deg(ra, dec); + list->roi(GCTARoi(instdir, m_rad)); // Set GTI list->gti(gti); diff --git a/test/test_ctools.sh b/test/test_ctools.sh index 3fd567a..d2805cc 100755 --- a/test/test_ctools.sh +++ b/test/test_ctools.sh @@ -338,4 +338,4 @@ else exit 1 fi $ECHO " ok" -#sleep 100 \ No newline at end of file +#sleep 100 -- libgit2 0.21.4