Commit a41c0ea0c1d619a8c3a91e7417c934a06012225c

Authored by Jürgen Knödlseder
1 parent 9ec0fea1

Adapt to new FITS interface

src/ctbin/ctbin.cpp
... ... @@ -503,7 +503,7 @@ void ctbin::bin_events(GCTAObservation* obs)
503 503 // Open fits file to check which extension is given
504 504 GFits file(m_ebinfile);
505 505  
506   - if (file.hashdu("EBOUNDS")) {
  506 + if (file.contains("EBOUNDS")) {
507 507  
508 508 // Close file and load ebounds
509 509 file.close();
... ... @@ -511,7 +511,7 @@ void ctbin::bin_events(GCTAObservation* obs)
511 511  
512 512 } // endif: EBOUNDS extension was given
513 513  
514   - else if (file.hashdu("ENERGYBINS")) {
  514 + else if (file.contains("ENERGYBINS")) {
515 515  
516 516 // Close file and load ebounds
517 517 file.close();
... ...
src/ctlike/ctlike.cpp
... ... @@ -339,9 +339,9 @@ void ctlike::get_parameters(void)
339 339 try {
340 340  
341 341 // Determine whether FITS file has EVENTS extension
342   - GFits file(filename);
343   - bool is_unbinned = file.hashdu("EVENTS");
344   - file.close();
  342 + GFits fits(filename);
  343 + bool is_unbinned = fits.contains("EVENTS");
  344 + fits.close();
345 345  
346 346 // If FITS file has an events header then load as unbinned
347 347 if (is_unbinned) {
... ...
src/ctselect/ctselect.cpp
... ... @@ -603,7 +603,7 @@ void ctselect::select_events(GCTAObservation* obs, const std::string& filename)
603 603 }
604 604  
605 605 // Check if we have an EVENTS HDU
606   - if (!file.hashdu("EVENTS")) {
  606 + if (!file.contains("EVENTS")) {
607 607 std::string message = "No \"EVENTS\" extension found in FITS file "+
608 608 expression+".";
609 609 throw GException::app_error(G_SELECT_EVENTS, message);
... ... @@ -952,7 +952,7 @@ void ctselect::save_event_list(const GCTAObservation* obs,
952 952 GFits infits(infile);
953 953 GFits outfits(outfile);
954 954 for (int extno = 1; extno < infits.size(); ++extno) {
955   - GFitsHDU* hdu = infits.hdu(extno);
  955 + GFitsHDU* hdu = infits.at(extno);
956 956 if (hdu->extname() != "EVENTS" && hdu->extname() != "GTI") {
957 957 outfits.append(*hdu);
958 958 }
... ...