Index: trunk/SophyaExt/FitsIOServer/fitsarrhand.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsarrhand.h	(revision 2903)
+++ trunk/SophyaExt/FitsIOServer/fitsarrhand.h	(revision 2907)
@@ -88,5 +88,9 @@
       if ( dobj == NULL) {
 	if (naxis == 1) dobj = new TVector<T>;
-	else if (naxis == 1) dobj = new TMatrix<T>;
+	else if (naxis == 2) { 
+	  if ( (naxes[0] == 1) || (naxes[1] == 1) )  
+	    dobj = new TVector<T>;  
+	  else dobj = new TMatrix<T>;
+	}
 	else dobj = new TArray<T>;
 	ownobj = true;
Index: trunk/SophyaExt/FitsIOServer/fitsfile.cc
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsfile.cc	(revision 2903)
+++ trunk/SophyaExt/FitsIOServer/fitsfile.cc	(revision 2907)
@@ -298,4 +298,5 @@
 {
   InitNull();
+  hdunum_ = fios.CurrentHDU();
 }
 
@@ -1145,4 +1146,25 @@
     {
       fits_read_col(fptr_,TFLOAT,ncol+1,NoLine+1,1,1,&fnull,&fdata[ncol],&anynul,&status);
+      if (status)
+	{
+	  ResetStatus(status);
+	  break;
+	}
+    }
+}
+
+/*! 
+Get the NoLine-th float 'line'  from the current BINTABLE extension on FITS file,
+*/
+void FitsInFile::GetBinTabLine(int NoLine, double* ddata) 
+{
+  int status= 0;
+  int    anynul;
+  double dnull= fnull_;
+  long nels=1;
+  int ncol;
+  for (ncol=0; ncol<nbcols_; ncol++)
+    {
+      fits_read_col(fptr_, TDOUBLE, ncol+1,NoLine+1,1,1,&dnull,&ddata[ncol],&anynul,&status);
       if (status)
 	{
Index: trunk/SophyaExt/FitsIOServer/fitsfile.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsfile.h	(revision 2903)
+++ trunk/SophyaExt/FitsIOServer/fitsfile.h	(revision 2907)
@@ -285,4 +285,5 @@
  void   GetBinTabLine(long NoLine, BnTblLine& ligne) ;
  void   GetBinTabLine(int NoLine, float* fdata) ;
+ void   GetBinTabLine(int NoLine, double* ddata) ;
  void   GetBinTabFCol(r_8* valeurs, int nentries, int NoCol) const;
  void   GetBinTabFCol(r_4* valeurs, int nentries, int NoCol) const;
Index: trunk/SophyaExt/FitsIOServer/fitsntuple.cc
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsntuple.cc	(revision 2903)
+++ trunk/SophyaExt/FitsIOServer/fitsntuple.cc	(revision 2907)
@@ -104,23 +104,24 @@
       ColName[k][LONNOM] =  '\0';
     }
+  // Reza Dec 2006 : Colonnes du NTuple de type double par defaut 
   for (k=0; k<nbcols;k++)
     {
       FitsFile::FitsDataType ss= is.ColTypeFromFits(k);
       string type;
-      if (ss !=  FitsFile::FitsDataType_float) 
+      if ( (ss !=  FitsFile::FitsDataType_double) && (ss != FitsFile::FitsDataType_float) )
 	{
-	  if (ss == FitsFile::FitsDataType_double) type= string("double");
+	  if (ss == FitsFile::FitsDataType_int) type= string("integer");
 	  else
-	    if (ss == FitsFile::FitsDataType_int) type= string("integer");
+	    if (ss == FitsFile::FitsDataType_char) type = string("char*");
 	    else
-	      if (ss == FitsFile::FitsDataType_char) type = string("char*");
-	      else
-		type = string("unknown");
+	      type = string("unknown");
 	  cout << " WARNING: the column " << k << " on fits file is not float but : " << type << endl;
 	} 
     }
+  bool fgdouble = true;
+  if ( is.ColTypeFromFits(0) == FitsFile::FitsDataType_float ) fgdouble = false;
   if(dobj_ == NULL) 
     { 
-      dobj_= new NTuple(nbcols,ColName);
+      dobj_= new NTuple(nbcols,ColName,512,fgdouble);
       ownobj_ = true;      
     }
@@ -128,5 +129,5 @@
     {
       dobj_->Clean();
-      (*dobj_) = NTuple(nbcols,ColName);
+      (*dobj_) = NTuple(nbcols,ColName,512,fgdouble);
     }
   for (k=0; k<nbcols;k++) 
@@ -136,5 +137,9 @@
   delete [] ColName;
 
-  float* ligne = new float[nbcols];
+  // Reza Dec 2006 : Colonnes du NTuple de type double par defaut 
+  double* dligne = NULL;
+  float* fligne = NULL;
+  if (fgdouble) dligne = new double[nbcols];
+  else fligne = new float[nbcols];
 
   int firstln, lastln;
@@ -150,10 +155,17 @@
     }
   int numLigne;
-  for (numLigne=firstln; numLigne < lastln; numLigne++)
-    {
-      is.GetBinTabLine(numLigne, ligne);
-      dobj_->Fill((r_4*)ligne);
-    }
-  delete [] ligne;
+  if (fgdouble) 
+    for (numLigne=firstln; numLigne < lastln; numLigne++) {
+      is.GetBinTabLine(numLigne, dligne);
+      dobj_->Fill((r_8*)dligne);
+    }
+  else 
+    for (numLigne=firstln; numLigne < lastln; numLigne++) {
+      is.GetBinTabLine(numLigne, fligne);
+      dobj_->Fill((r_4*)fligne);
+    }
+  
+  if (dligne) delete [] dligne;
+  if (fligne) delete [] fligne;
 
   dobj_->Info()=is.DVListFromFits();
@@ -191,17 +203,33 @@
     }
 
-  string type(ncols, 'E');
-  vector<int> dummy;
-
-  os.makeHeaderBntblOnFits(type,Noms, nentries, ncols, &dvl, extname, dummy);
-   float* column =  new float[nentries];
-   for (k=0; k<ncols;k++)
-     {
-       int j;
-       for(j = 0; j < nentries; j++) column[j]= dobj_->GetVal(j,k);
-       os.PutColToFits(k, nentries, column);
-     }
-   delete [] column;
-
-}
-
+  // Gestion NTuple en double ou float / Reza Jan 2006
+  if (dobj_->mFgDouble) {    // NTuple avec colonnes double
+    string type(ncols, 'D');
+    vector<int> dummy;
+    
+    os.makeHeaderBntblOnFits(type,Noms, nentries, ncols, &dvl, extname, dummy);
+    double* column =  new double[nentries];
+    for (k=0; k<ncols;k++)
+      {
+	int j;
+	for(j = 0; j < nentries; j++) column[j]= dobj_->GetCell(j,k);
+	os.PutColToFits(k, nentries, column);
+      }
+    delete [] column;
+  }
+  else {   // NTuple avec colonnes float
+    string type(ncols, 'E');
+    vector<int> dummy;
+    
+    os.makeHeaderBntblOnFits(type,Noms, nentries, ncols, &dvl, extname, dummy);
+    float* column =  new float[nentries];
+    for (k=0; k<ncols;k++)
+      {
+	int j;
+	for(j = 0; j < nentries; j++) column[j]= dobj_->GetVal(j,k);
+	os.PutColToFits(k, nentries, column);
+      }
+    delete [] column;
+  }
+}
+
