Changeset 3047 in Sophya for trunk/SophyaExt/FitsIOServer/fitslocalmap.cc
- Timestamp:
- Aug 11, 2006, 10:42:10 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fitslocalmap.cc
r2898 r3047 81 81 int FITS_LocalMap<T>::CheckReadability(FitsInOutFile& is) 82 82 { 83 if (is.CurrentHDUType() != BINARY_TBL) return 0;83 if (is.CurrentHDUType() != IMAGE_HDU ) return 0; 84 84 string key; 85 85 key = "Content"; 86 86 string clsnm = is.KeyValue(key); 87 87 if (clsnm != "LocalMap") return 0; 88 89 vector<string> colnames; 90 vector<int> coltypes; 91 vector<long> repcnt; 92 vector<long> width; 93 long ncols = is.GetColInfo(colnames, coltypes, repcnt, width); 94 if (ncols < 1) return 0; 88 89 long naxes[2]; 90 int naxis=2; 91 int imgtyp = is.GetImageHDUInfo(naxis, naxes); 92 if (naxis != 2) return 0; 93 95 94 T x = 0; 96 if ( coltypes[0] == FitsTypes::DataType(x)) return 2 ;95 if (imgtyp == FitsTypes::ImageType(x)) return 2 ; 97 96 else return 1; 98 97 } … … 132 131 // 133 132 if (!is.IsFitsImage()) 134 { 135 throw PException("ReadFromFits: the fits file seems not to be an image"); 136 } 133 throw PException("ReadFromFits: the fits file seems not to be an image"); 137 134 int dimension = is.nbDimOfImage(); 138 135 if (dimension != 2 ) 139 { 140 cout << " WARNING::ReadFromFits: the fits image seems not to be a matrix" << endl; 141 } 136 cout << " WARNING::ReadFromFits: the fits image seems not to be a matrix" << endl; 137 142 138 nbentries = is.nbOfImageData(); 143 139 // … … 149 145 int_4 nPix = dvl.GetI("NPIX"); 150 146 if (nPix != nbentries) 151 { 152 throw IOExc("longueur datablock incompatible avec nPix"); 153 } 147 throw IOExc("longueur datablock incompatible avec nPix"); 154 148 dobj_->ReSize(nSzX, nSzY); 155 149 int_4 localMappingDone = dvl.GetI("LCMP");
Note:
See TracChangeset
for help on using the changeset viewer.