From c3cb3dd06be5806ade6fbff2f7682d03117f77cc Mon Sep 17 00:00:00 2001 From: knodlseder <> Date: Mon, 24 Jan 2011 22:25:26 +0000 Subject: [PATCH] adapt to new GObservation interface --- src/ctbin/ctbin.cpp | 14 ++++++++------ src/ctlike/ctlike.cpp | 9 +++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/ctbin/ctbin.cpp b/src/ctbin/ctbin.cpp index 31a9147..a7eda26 100644 --- a/src/ctbin/ctbin.cpp +++ b/src/ctbin/ctbin.cpp @@ -159,11 +159,13 @@ void ctbin::bin(void) obs.load_unbinned(m_evfile); // Setup energy range covered by data - GEnergy emin; - GEnergy emax; + GEnergy emin; + GEnergy emax; + GEbounds ebds; emin.TeV(m_emin); emax.TeV(m_emax); - obs.ebounds()->setlog(emin, emax, m_enumbins); + ebds.setlog(emin, emax, m_enumbins); + obs.ebounds(ebds); // Log observation if (logTerse()) { @@ -199,7 +201,7 @@ void ctbin::bin(void) } // Determine energy bin. Skip if we are outside the energy range - int index = obs.ebounds()->index(event->energy()); + int index = obs.ebounds().index(event->energy()); if (index == -1) { num_outside_ebds++; continue; @@ -235,8 +237,8 @@ void ctbin::bin(void) // Save counts map GFits file; map.write(&file); - obs.ebounds()->write(&file); - obs.gti()->write(&file); + obs.ebounds().write(&file); + obs.gti().write(&file); file.saveto(m_outfile, clobber()); // Return diff --git a/src/ctlike/ctlike.cpp b/src/ctlike/ctlike.cpp index 7c31f09..4282361 100644 --- a/src/ctlike/ctlike.cpp +++ b/src/ctlike/ctlike.cpp @@ -254,18 +254,19 @@ void ctlike::unbinned(const std::string& evfile) // DUMMY: Setup energy range covered by data. This is needed since actual // test data do not contain any energy range information - GEnergy emin; - GEnergy emax; + GEnergy emin; + GEnergy emax; + GEbounds ebds; emin.TeV(0.1); emax.TeV(100.0); + ebds.append(emin, emax); // Load data and response and set ROI, energy range and time range // for analysis run.load_unbinned(evfile); run.response(m_irf, m_caldb); run.roi(roi); - //run.gti()->add(tstart, tstop); - run.ebounds()->append(emin, emax); + run.ebounds(ebds); m_obs.append(run); // Return -- libgit2 0.21.4