Changeset 11616 for trunk/FACT++/gui


Ignore:
Timestamp:
07/26/11 15:23:10 (13 years ago)
Author:
tbretz
Message:
Changed from using MFits.h to new fits.h in Mars trunk.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc

    r11613 r11616  
    77
    88#include "RawEventsViewer.h"
    9 #include "RawEventsViewerUi.h"
     9#include "viewer.h"
    1010#include <math.h>
    1111#include <fstream>
     
    837837}
    838838/************************************************************
    839  * IS FITS. checks if a given file is a fits file.
    840  ************************************************************/
    841 bool RawDataViewer::IsFits(const char *name)
    842 {
    843     MZlib fin(name);
    844     if (!fin)
    845         return 0;
    846 
    847     unsigned char c[6];
    848     fin.read((char*)c, 6);
    849     if (!fin)
    850         return 0;
    851 
    852     return memcmp(c, "SIMPLE", 6)==0;
    853 }
    854 /************************************************************
    855839 * OPEN FILE. opens a new fits file
    856840 ************************************************************/
    857841void RawDataViewer::openFile(string& file)
    858842{
    859     if (!IsFits(file.c_str()))
    860     {
    861         cout << "File does not seem to be fits. aborting" << endl;
    862         return;
    863     }
    864843    if (inputFile)
    865844    {
     
    867846        delete inputFile;
    868847    }
    869     inputFile = new MFits(file);
     848    inputFile = new fits(file);
     849    if (!*inputFile)
     850    {
     851        cout << "Couldn't open file." << endl;
     852        delete inputFile;
     853        inputFile = NULL;
     854        return;
     855    }
    870856    nRows = inputFile->GetInt("NAXIS2");
    871857    nRoi = inputFile->GetInt("NROI");
Note: See TracChangeset for help on using the changeset viewer.