Changeset 17035 for trunk/Mars/mraw


Ignore:
Timestamp:
08/21/13 16:35:22 (11 years ago)
Author:
lyard
Message:
Added error when using wrong fits class and adapted MRawFitsRead to deal with compressed .fz fits
File:
1 edited

Legend:

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

    r14095 r17035  
    4545#include "MLogManip.h"
    4646
    47 #include "fits.h"
     47#include "factfits.h"
    4848#include "MTime.h"
    4949
     
    133133Bool_t MRawFitsRead::IsFits(const char *name)
    134134{
    135     return fits(name).good();
     135    return factfits(name).good();
    136136}
    137137
    138138istream *MRawFitsRead::OpenFile(const char *filename)
    139139{
    140     return new fits(filename);
     140    return new factfits(filename);
    141141}
    142142
    143143Bool_t MRawFitsRead::ReadRunHeader(istream &stream)
    144144{
    145     fits &fin = static_cast<fits&>(stream);
     145    factfits &fin = static_cast<factfits&>(stream);
    146146
    147147    if (fin.GetStr("TELESCOP")!="FACT")
     
    154154
    155155    fRawRunHeader->SetValidMagicNumber();
    156     fRawRunHeader->SetNumEvents(fin.GetUInt("NAXIS2"));
     156    fRawRunHeader->SetNumEvents(fin.GetNumRows());//GetUInt("NAXIS2"));
    157157    fRawRunHeader->InitPixels(fin.GetUInt("NPIX"));
    158158    fRawRunHeader->SetObservation(type=="4294967295"?"":fin.GetStr("RUNTYPE"), "FACT");
     
    175175Bool_t  MRawFitsRead::InitReadData(istream &stream)
    176176{
    177     fits &fin = static_cast<fits&>(stream);
     177    factfits &fin = static_cast<factfits&>(stream);
    178178
    179179    MArrayB **data   = reinterpret_cast<MArrayB**>(fRawEvtData1->DataMember("fHiGainFadcSamples"));
     
    216216Bool_t MRawFitsRead::ReadEvent(istream &stream)
    217217{
    218     if (!static_cast<fits&>(stream).GetNextRow())
     218    if (!static_cast<factfits&>(stream).GetNextRow())
    219219        return kFALSE;
    220220
     
    231231void MRawFitsRead::SkipEvent(istream &fin)
    232232{
    233     static_cast<fits&>(fin).SkipNextRow();
    234 }
     233    static_cast<factfits&>(fin).SkipNextRow();
     234}
Note: See TracChangeset for help on using the changeset viewer.