Changeset 12628 for trunk/Mars/mraw


Ignore:
Timestamp:
11/23/11 14:17:41 (13 years ago)
Author:
tbretz
Message:
Make sure that no name for the mapping can be given; print the name in the error message; Get the runtype from the header; Use PCTime as a fallback to UnixTimePC
File:
1 edited

Legend:

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

    r12327 r12628  
    7272    fPixelMap.resize(1440);
    7373
     74    if (!name)
     75        return kTRUE;
     76
    7477    ifstream fin(name);
    7578
     
    108111    if (l!=1440)
    109112    {
    110         gLog << err << "ERROR - Problems reading FACTmapV5.txt" << endl;
     113        gLog << err << "ERROR - Problems reading " << name << endl;
    111114        fPixelMap.resize(0);
    112115        return kFALSE;
     
    136139    }
    137140
     141    const string type = fin.GetStr("RUNTYPE");
     142
    138143    fRawRunHeader->SetValidMagicNumber();
    139144    fRawRunHeader->SetNumEvents(fin.GetUInt("NAXIS2"));
    140145    fRawRunHeader->InitPixels(fin.GetUInt("NPIX"));
    141     fRawRunHeader->SetObservation("", "FACT");
     146    fRawRunHeader->SetObservation(type=="4294967295"?"":fin.GetStr("RUNTYPE"), "FACT");
    142147    fRawRunHeader->SetRunInfo(0, fin.GetUInt("NIGHT"), fin.GetUInt("RUNID"));
    143148    fRawRunHeader->InitFact(fin.GetUInt("NPIX")/9, 9, fin.GetUInt("NROI"), fPixelMap.size()==0?0:fPixelMap.data());
     
    171176    fPCTime.resize(2);
    172177    if (!fin.SetVecAddress("UnixTimeUTC", fPCTime))
    173         return kFALSE;
     178        if (!fin.SetVecAddress("PCTime", fPCTime))
     179            return kFALSE;
    174180
    175181    if (!fin.SetPtrAddress("Data", (int16_t*)(*data)->GetArray(), (*data)->GetSize()/2))
Note: See TracChangeset for help on using the changeset viewer.