Index: /trunk/SophyaExt/FitsIOServer/fitshdtable.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitshdtable.h	(revision 3046)
+++ /trunk/SophyaExt/FitsIOServer/fitshdtable.h	(revision 3047)
@@ -21,5 +21,6 @@
 
 inline FitsInOutFile& operator >> (FitsInOutFile& is, BaseDataTable & obj)
-  { FitsHandler<BaseDataTable> fio(obj); fio.Read(is); is.MoveToNextHDU(); return(is); }
+  { FitsHandler<BaseDataTable> fio(obj); is.SkipEmptyFirstHDU();
+  fio.Read(is); is.MoveToNextHDU(); return(is); }
 
 
Index: /trunk/SophyaExt/FitsIOServer/fitsinoutfile.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsinoutfile.cc	(revision 3046)
+++ /trunk/SophyaExt/FitsIOServer/fitsinoutfile.cc	(revision 3047)
@@ -322,4 +322,24 @@
     return MoveRelToHDU(1);
   else return -1;
+}
+
+/*-- Methode --*/
+/*! 
+  Skip HDU 1 if NAXIS=0 (no data), on a file opened for reading.
+  return true if moved to HDU No 2
+*/
+bool FitsInOutFile::SkipEmptyFirstHDU()
+{
+  if (fptr_ == NULL) return false;
+  if (mode_ == Fits_Create) return false;
+  if (CurrentHDU() != 1) return false;
+  int naxis = 2;
+  long naxes[2];
+  GetImageHDUInfo(naxis, naxes);
+  if ((naxis == 0) &&  (NbHDUs() > 1)) {
+    MoveRelToHDU(1);
+    return true; 
+  }
+  return false; 
 }
 
Index: /trunk/SophyaExt/FitsIOServer/fitsinoutfile.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsinoutfile.h	(revision 3046)
+++ /trunk/SophyaExt/FitsIOServer/fitsinoutfile.h	(revision 3047)
@@ -112,4 +112,6 @@
  //! Move to the next HDU specified by relhdu. Returns the newly opened HDU type (<0 at EOF)
  int               MoveToNextHDU();
+ //! Skip the first HDU if it contains no data. 
+ bool              SkipEmptyFirstHDU();
 
  //---- IMAGE_HDU manipulation methods
Index: /trunk/SophyaExt/FitsIOServer/fitslocalmap.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitslocalmap.cc	(revision 3046)
+++ /trunk/SophyaExt/FitsIOServer/fitslocalmap.cc	(revision 3047)
@@ -81,18 +81,17 @@
 int FITS_LocalMap<T>::CheckReadability(FitsInOutFile& is)
 {
-  if (is.CurrentHDUType() !=  BINARY_TBL ) return 0;
+  if (is.CurrentHDUType() !=  IMAGE_HDU ) return 0;
   string key;
   key = "Content";
   string clsnm = is.KeyValue(key);
   if (clsnm != "LocalMap") return 0;
-
-  vector<string> colnames; 
-  vector<int> coltypes;
-  vector<long> repcnt;
-  vector<long> width;
-  long ncols = is.GetColInfo(colnames, coltypes, repcnt, width); 
-  if (ncols < 1) return 0;
+  
+  long naxes[2];
+  int naxis=2;
+  int imgtyp = is.GetImageHDUInfo(naxis, naxes);
+  if (naxis != 2) return 0;
+
   T x = 0;
-  if (coltypes[0] == FitsTypes::DataType(x)) return 2 ;
+  if (imgtyp == FitsTypes::ImageType(x)) return 2 ;
   else return 1;
 }
@@ -132,12 +131,9 @@
   //
   if (!is.IsFitsImage())
-    {
-      throw PException("ReadFromFits: the fits file seems not to be an image");
-    }
+    throw PException("ReadFromFits: the fits file seems not to be an image");
   int dimension = is.nbDimOfImage();
   if (dimension != 2 )
-    {
-      cout << " WARNING::ReadFromFits: the fits image seems not to be a matrix" << endl;
-    }
+    cout << " WARNING::ReadFromFits: the fits image seems not to be a matrix" << endl;
+
   nbentries =  is.nbOfImageData();
   //
@@ -149,7 +145,5 @@
   int_4 nPix = dvl.GetI("NPIX");
   if (nPix != nbentries)
-    {
-      throw IOExc("longueur datablock incompatible avec nPix");
-    }
+    throw IOExc("longueur datablock incompatible avec nPix");
   dobj_->ReSize(nSzX, nSzY); 
   int_4 localMappingDone = dvl.GetI("LCMP");
Index: /trunk/SophyaExt/FitsIOServer/fitslocalmap.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitslocalmap.h	(revision 3046)
+++ /trunk/SophyaExt/FitsIOServer/fitslocalmap.h	(revision 3047)
@@ -52,5 +52,6 @@
 template <class T>
 inline FitsInOutFile& operator >> (FitsInOutFile& fiis, LocalMap<T> & lm)
-  { FITS_LocalMap<T> fih(&lm); fih.Read(fiis); return (fiis); }
+  { FITS_LocalMap<T> fih(&lm); fih.Read(fiis); 
+  fiis.MoveToNextHDU(); return (fiis); }
 
 } // Fin du namespace
Index: /trunk/SophyaExt/FitsIOServer/fitsntuple.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsntuple.h	(revision 3046)
+++ /trunk/SophyaExt/FitsIOServer/fitsntuple.h	(revision 3047)
@@ -81,5 +81,6 @@
 
 inline FitsInOutFile& operator >> (FitsInOutFile& fiis, NTuple & nt)
-  { FITS_NTuple fih(&nt); fih.Read(fiis); return (fiis); }
+  { FITS_NTuple fih(&nt); fiis.SkipEmptyFirstHDU();
+  fih.Read(fiis); fiis.MoveToNextHDU(); return (fiis); }
 
 
Index: /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.cc	(revision 3046)
+++ /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.cc	(revision 3047)
@@ -172,9 +172,11 @@
 void FITS_SphereHEALPix<T>::ReadFromFits(FitsInFile& is)
 {
-  if(dobj_ == NULL) 
-    {
-      dobj_= new SphereHEALPix<T>;
-      ownobj_= true;      
-    }
+  if (is.CurrentHDUType() != BINARY_TBL )
+    throw FitsIOException("FITS_SphereHEALPix<T>::ReadFromFits Not a binary table HDU");
+
+  if(dobj_ == NULL) {
+    dobj_= new SphereHEALPix<T>;
+    ownobj_= true;      
+  }
   int nbcols, nbentries;
   //
Index: /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.h	(revision 3046)
+++ /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.h	(revision 3047)
@@ -56,5 +56,6 @@
 template <class T>
 inline FitsInOutFile& operator >> (FitsInOutFile& fiis, SphereHEALPix<T> & sph)
-  { FITS_SphereHEALPix<T> fih(&sph); fih.Read(fiis); return (fiis); }
+  { FITS_SphereHEALPix<T> fih(&sph); fiis.SkipEmptyFirstHDU();
+  fih.Read(fiis); fiis.MoveToNextHDU(); return (fiis); }
 
 
Index: /trunk/SophyaExt/FitsIOServer/fitsspherethetaphi.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsspherethetaphi.h	(revision 3046)
+++ /trunk/SophyaExt/FitsIOServer/fitsspherethetaphi.h	(revision 3047)
@@ -58,5 +58,6 @@
 template <class T>
 inline FitsInOutFile& operator >> (FitsInOutFile& fiis, SphereThetaPhi<T> & sph)
-  { FITS_SphereThetaPhi<T> fih(&sph); fih.Read(fiis); return (fiis); }
+  { FITS_SphereThetaPhi<T> fih(&sph); fiis.SkipEmptyFirstHDU();
+  fih.Read(fiis); fiis.MoveToNextHDU(); return (fiis); }
 
 
