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