Commit e76e98c3dbe88afc596fa13ba5852f4076d061d7
1 parent
36cb4846
Read GTIs before reading the events.
We needs the GTIs before reading the events as we need a proper time reference for time conversion.
Showing
1 changed file
with
9 additions
and
13 deletions
inst/cta/src/GCTAEventList.cpp
| ... | ... | @@ -296,10 +296,6 @@ void GCTAEventList::save(const std::string& filename, bool clobber) const |
| 296 | 296 | * |
| 297 | 297 | * @todo Ultimately, any events file should have a GTI extension, hence the |
| 298 | 298 | * extraction of GTIs from TSTART and TSTOP should not be necessary. |
| 299 | - * | |
| 300 | - * @todo For the moment we simply use the MJD unit from the GTime class, but | |
| 301 | - * we should add the information from MJDREFI and MJDREFF to allow | |
| 302 | - * setting of arbitrary time units. | |
| 303 | 299 | ***************************************************************************/ |
| 304 | 300 | void GCTAEventList::read(const GFits& file) |
| 305 | 301 | { |
| ... | ... | @@ -309,15 +305,6 @@ void GCTAEventList::read(const GFits& file) |
| 309 | 305 | // Get event list HDU |
| 310 | 306 | GFitsTable* events = file.table("EVENTS"); |
| 311 | 307 | |
| 312 | - // Load event data | |
| 313 | - read_events(events); | |
| 314 | - | |
| 315 | - // Read region of interest from data selection keyword | |
| 316 | - read_ds_roi(events); | |
| 317 | - | |
| 318 | - // Read energy boundaries from data selection keyword | |
| 319 | - read_ds_ebounds(events); | |
| 320 | - | |
| 321 | 308 | // If we have a GTI extension, then read Good Time Intervals from that |
| 322 | 309 | // extension |
| 323 | 310 | if (file.hashdu("GTI")) { |
| ... | ... | @@ -347,6 +334,15 @@ void GCTAEventList::read(const GFits& file) |
| 347 | 334 | |
| 348 | 335 | } // endelse: GTI built from TSTART and TSTOP |
| 349 | 336 | |
| 337 | + // Load event data | |
| 338 | + read_events(events); | |
| 339 | + | |
| 340 | + // Read region of interest from data selection keyword | |
| 341 | + read_ds_roi(events); | |
| 342 | + | |
| 343 | + // Read energy boundaries from data selection keyword | |
| 344 | + read_ds_ebounds(events); | |
| 345 | + | |
| 350 | 346 | // Return |
| 351 | 347 | return; |
| 352 | 348 | } | ... | ... |