Changeset 17035 for trunk/Mars/mcore/fits.h
- Timestamp:
- 08/21/13 16:35:22 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/fits.h
r16935 r17035 463 463 return it==cols.end() ? 0 : it->second.num; 464 464 } 465 466 465 467 466 468 // There may be a gap between the main table and the start of the heap: … … 660 662 // Check for table name. Skip until eof or requested table are found. 661 663 // skip the current table? 662 if (!tableName.empty() && tableName!=fTable.Get<string>("EXTNAME")) 664 if ((!tableName.empty() && tableName!=fTable.Get<string>("EXTNAME")) || 665 ( tableName.empty() && "ZDrsCellOffsets"==fTable.Get<string>("EXTNAME"))) 663 666 { 664 667 const streamoff skip = fTable.GetTotalBytes(); … … 711 714 fits(const string &fname, const string& tableName="", bool force=false) : izstream(fname.c_str()) 712 715 { 716 gLog << "Here..." <<endl; 713 717 Constructor(fname, "", tableName, force); 718 if ((fTable.is_compressed && !force) || 719 (fTable.name == "ZDrsCellOffsets" && !force)) 720 { 721 #ifdef __EXCEPTIONS 722 throw runtime_error("You are trying to read a compressed fits with the base fits class. Please use factfits instead."); 723 #else 724 gLog << ___err___ << "ERROR - You are trying to read a compressed fits with the base fits class. Please use factfits instead." << endl; 725 #endif 726 clear(rdstate()|ios::badbit); 727 } 714 728 } 715 729 716 730 fits(const string &fname, const string &fout, const string& tableName, bool force=false) : izstream(fname.c_str()) 717 731 { 732 gLog << "There..." << endl; 718 733 Constructor(fname, fout, tableName, force); 734 if ((fTable.is_compressed && !force) || 735 (fTable.name == "ZDrsCellOffsets" && !force)) 736 { 737 #ifdef __EXCEPTIONS 738 throw runtime_error("You are trying to read a compressed fits with the base fits class. Please use factfits instead."); 739 #else 740 gLog << ___err___ << "ERROR - You are trying to read a compressed fits with the base fits class. Please use factfits instead." << endl; 741 #endif 742 clear(rdstate()|ios::badbit); 743 } 744 } 745 746 fits() : izstream() 747 { 748 719 749 } 720 750 … … 999 1029 } 1000 1030 1001 size_t GetNumRows() const { return fTable.num_rows; }1031 // size_t GetNumRows() const { return fTable.num_rows; } 1002 1032 size_t GetRow() const { return fRow==(size_t)-1 ? 0 : fRow; } 1003 1033 … … 1011 1041 1012 1042 bool IsCompressedFITS() const { return fTable.is_compressed;} 1043 1044 virtual size_t GetNumRows() const 1045 { 1046 return fTable.Get<size_t>("NAXIS2"); 1047 } 1048 1049 virtual size_t GetBytesPerRow() const 1050 { 1051 return fTable.Get<size_t>("NAXIS1"); 1052 } 1013 1053 }; 1014 1054
Note:
See TracChangeset
for help on using the changeset viewer.