Changeset 11616 for trunk/FACT++/gui/RawEventsViewer
- Timestamp:
- 07/26/11 15:23:10 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r11613 r11616 7 7 8 8 #include "RawEventsViewer.h" 9 #include " RawEventsViewerUi.h"9 #include "viewer.h" 10 10 #include <math.h> 11 11 #include <fstream> … … 837 837 } 838 838 /************************************************************ 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 /************************************************************855 839 * OPEN FILE. opens a new fits file 856 840 ************************************************************/ 857 841 void RawDataViewer::openFile(string& file) 858 842 { 859 if (!IsFits(file.c_str()))860 {861 cout << "File does not seem to be fits. aborting" << endl;862 return;863 }864 843 if (inputFile) 865 844 { … … 867 846 delete inputFile; 868 847 } 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 } 870 856 nRows = inputFile->GetInt("NAXIS2"); 871 857 nRoi = inputFile->GetInt("NROI");
Note:
See TracChangeset
for help on using the changeset viewer.