Changeset 17284 for trunk/Mars/mcore


Ignore:
Timestamp:
10/21/13 12:04:02 (11 years ago)
Author:
lyard
Message:
added special case for sanity checks if calibration table is compressed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mcore/factfits.h

    r17282 r17284  
    157157            clear(rdstate()|std::ios::badbit);
    158158#ifdef __EXCEPTIONS
    159             throw std::runtime_error("Table 'DrsCalib' found, but first column is not the one expected");
    160 #else
    161             gLog << ___err___ << "ERROR - Table 'DrsCalib' found, but first column is not the one expected" << std::endl;
    162             return;
    163 #endif
    164         }
    165         if (calib.GetStr("TFORM1") != "1474560I")  // 1024*1440
    166         {
    167             clear(rdstate()|std::ios::badbit);
    168 #ifdef __EXCEPTIONS
    169             throw std::runtime_error("Table 'DrsCalib' has wrong column format (TFROM1)");
    170 #else
    171             gLog << ___err___ << "ERROR - Table 'DrsCalib' has wrong column format (TFORM1)" << std::endl;
     159            throw std::runtime_error("Table 'ZDrsCellOffsets' found, but first column is not the one expected");
     160#else
     161            gLog << ___err___ << "ERROR - Table 'ZDrsCellOffsets' found, but first column is not the one expected" << std::endl;
     162            return;
     163#endif
     164        }
     165        bool isColumnPresent = false;
     166        if (calib.HasKey("TFORM1") && calib.GetStr("TFORM1") == "1474560I") isColumnPresent = true;
     167        if (calib.HasKey("ZFORM1") && calib.GetStr("ZFORM1") == "1474560I") isColumnPresent = true;
     168        if (!isColumnPresent)  // 1024*1440
     169        {
     170            clear(rdstate()|std::ios::badbit);
     171#ifdef __EXCEPTIONS
     172            throw std::runtime_error("Table 'ZDrsCellOffsets' has wrong column format (TFROM1)");
     173#else
     174            gLog << ___err___ << "ERROR - Table 'ZDrsCellOffsets' has wrong column format (TFORM1)" << std::endl;
    172175            return;
    173176#endif
Note: See TracChangeset for help on using the changeset viewer.