Changeset 11556


Ignore:
Timestamp:
07/24/11 11:05:14 (13 years ago)
Author:
tbretz
Message:
Replaced MZlib by izstream; added check for TELESCOP key.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mraw/MRawFitsRead.cc

    r11490 r11556  
    4343#include "MLogManip.h"
    4444
    45 #include "MFits.h"
     45#include "fits.h"
    4646#include "MTime.h"
    4747
     
    6868Bool_t MRawFitsRead::IsFits(const char *name)
    6969{
    70     MZlib fin(name);
    71     if (!fin)
    72         return 0;
    73 
    74     Byte_t c[6];
    75     fin.read((char*)c, 6);
    76     if (!fin)
    77         return 0;
    78 
    79     return memcmp(c, "SIMPLE", 6)==0;
     70    return fits(name).good();
    8071}
    8172
    8273istream *MRawFitsRead::OpenFile(const char *filename)
    8374{
    84     return new MFits(filename);
     75    return new fits(filename);
    8576}
    8677
    8778Bool_t MRawFitsRead::ReadRunHeader(istream &stream)
    8879{
    89     MFits &fin = static_cast<MFits&>(stream);
     80    fits &fin = static_cast<fits&>(stream);
     81
     82    if (fin.GetStr("TELESCOP")!="FACT")
     83    {
     84        gLog << err << "Not a valid FACT FITS file (key TELESCOP not 'FACT')." << endl;
     85        return kFALSE;
     86    }
    9087
    9188    fRawRunHeader->SetValidMagicNumber();
     
    106103Bool_t::MRawFitsRead::InitReadData(istream &stream)
    107104{
    108     MFits &fin = static_cast<MFits&>(stream);
     105    fits &fin = static_cast<fits&>(stream);
    109106
    110107    MArrayB **data   = reinterpret_cast<MArrayB**>(fRawEvtData1->DataMember("fHiGainFadcSamples"));
     
    139136Bool_t MRawFitsRead::ReadEvent(istream &stream)
    140137{
    141     if (!static_cast<MFits&>(stream).GetNextRow())
     138    if (!static_cast<fits&>(stream).GetNextRow())
    142139        return kFALSE;
    143140
     
    154151void MRawFitsRead::SkipEvent(istream &fin)
    155152{
    156     static_cast<MFits&>(fin).SkipNextRow();
     153    static_cast<fits&>(fin).SkipNextRow();
    157154}
Note: See TracChangeset for help on using the changeset viewer.