Ignore:
Timestamp:
Aug 11, 2006, 10:42:10 AM (19 years ago)
Author:
ansari
Message:

Ajout FitsInOutFile::SkipEmptyFirstHDU() , positionnement sur HDU 2 si HDU 1 vide ds operateur >> lisant des tables + autres petites corrections , Reza 11/08/2006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/FitsIOServer/fitslocalmap.cc

    r2898 r3047  
    8181int FITS_LocalMap<T>::CheckReadability(FitsInOutFile& is)
    8282{
    83   if (is.CurrentHDUType() !=  BINARY_TBL ) return 0;
     83  if (is.CurrentHDUType() !=  IMAGE_HDU ) return 0;
    8484  string key;
    8585  key = "Content";
    8686  string clsnm = is.KeyValue(key);
    8787  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
    9594  T x = 0;
    96   if (coltypes[0] == FitsTypes::DataType(x)) return 2 ;
     95  if (imgtyp == FitsTypes::ImageType(x)) return 2 ;
    9796  else return 1;
    9897}
     
    132131  //
    133132  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");
    137134  int dimension = is.nbDimOfImage();
    138135  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
    142138  nbentries =  is.nbOfImageData();
    143139  //
     
    149145  int_4 nPix = dvl.GetI("NPIX");
    150146  if (nPix != nbentries)
    151     {
    152       throw IOExc("longueur datablock incompatible avec nPix");
    153     }
     147    throw IOExc("longueur datablock incompatible avec nPix");
    154148  dobj_->ReSize(nSzX, nSzY);
    155149  int_4 localMappingDone = dvl.GetI("LCMP");
Note: See TracChangeset for help on using the changeset viewer.