Commit c3cb3dd06be5806ade6fbff2f7682d03117f77cc

Authored by knodlseder
1 parent 715c28b1

adapt to new GObservation interface

src/ctbin/ctbin.cpp
... ... @@ -159,11 +159,13 @@ void ctbin::bin(void)
159 159 obs.load_unbinned(m_evfile);
160 160  
161 161 // Setup energy range covered by data
162   - GEnergy emin;
163   - GEnergy emax;
  162 + GEnergy emin;
  163 + GEnergy emax;
  164 + GEbounds ebds;
164 165 emin.TeV(m_emin);
165 166 emax.TeV(m_emax);
166   - obs.ebounds()->setlog(emin, emax, m_enumbins);
  167 + ebds.setlog(emin, emax, m_enumbins);
  168 + obs.ebounds(ebds);
167 169  
168 170 // Log observation
169 171 if (logTerse()) {
... ... @@ -199,7 +201,7 @@ void ctbin::bin(void)
199 201 }
200 202  
201 203 // Determine energy bin. Skip if we are outside the energy range
202   - int index = obs.ebounds()->index(event->energy());
  204 + int index = obs.ebounds().index(event->energy());
203 205 if (index == -1) {
204 206 num_outside_ebds++;
205 207 continue;
... ... @@ -235,8 +237,8 @@ void ctbin::bin(void)
235 237 // Save counts map
236 238 GFits file;
237 239 map.write(&file);
238   - obs.ebounds()->write(&file);
239   - obs.gti()->write(&file);
  240 + obs.ebounds().write(&file);
  241 + obs.gti().write(&file);
240 242 file.saveto(m_outfile, clobber());
241 243  
242 244 // Return
... ...
src/ctlike/ctlike.cpp
... ... @@ -254,18 +254,19 @@ void ctlike::unbinned(const std::string& evfile)
254 254  
255 255 // DUMMY: Setup energy range covered by data. This is needed since actual
256 256 // test data do not contain any energy range information
257   - GEnergy emin;
258   - GEnergy emax;
  257 + GEnergy emin;
  258 + GEnergy emax;
  259 + GEbounds ebds;
259 260 emin.TeV(0.1);
260 261 emax.TeV(100.0);
  262 + ebds.append(emin, emax);
261 263  
262 264 // Load data and response and set ROI, energy range and time range
263 265 // for analysis
264 266 run.load_unbinned(evfile);
265 267 run.response(m_irf, m_caldb);
266 268 run.roi(roi);
267   - //run.gti()->add(tstart, tstop);
268   - run.ebounds()->append(emin, emax);
  269 + run.ebounds(ebds);
269 270 m_obs.append(run);
270 271  
271 272 // Return
... ...