Index: /trunk/SophyaExt/FitsIOServer/fabtcolread.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fabtcolread.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fabtcolread.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   C. Magneville, 2001 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 /* Interface Fits BINARY/ASCII Table Column Reader    cmv 26/09/2001 */
 #ifndef FABTCOLREAD_H_SEEN
Index: /trunk/SophyaExt/FitsIOServer/fabtwriter.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fabtwriter.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fabtwriter.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   C. Magneville, 2001 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 /* Interface Fits BINARY/ASCII Table Writer    cmv 26/09/2001 */
 #ifndef FABTWRITER_H_SEEN
Index: /trunk/SophyaExt/FitsIOServer/fboloread.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fboloread.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fboloread.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   C. Magneville, 2001 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 /* Interface Fits pour bolometre    cmv 29/09/2001 */
 #ifndef FBOLOREAD_H_SEEN
Index: /trunk/SophyaExt/FitsIOServer/fbtntintf.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fbtntintf.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fbtntintf.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   C. Magneville, 2001 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 /* Interface Fits BINARY/ASCII Table     cmv 21/05/2001 */
 #ifndef FBTNTINTF_H_SEEN
Index: /trunk/SophyaExt/FitsIOServer/fiosinit.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fiosinit.cc	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fiosinit.cc	(revision 3493)
@@ -26,7 +26,10 @@
 int FitsIOServerInitiator::FgInit = 0;
 
+// ---> Reporter ce numero de version ds fitsinoutfile.h (methode Version())
 // Module version number - 2.0 , Jul 2006
 // Module version number - 2.1 , Fev 2007 (version ll (LONGLONG) de cfitsio)
-#define MOD_VERS   2.1
+// Module version number - 2.12 , Avr 2008 (Lecture-ecriture tableaux avec offset)
+
+#define MOD_VERS   2.12
 
 FitsIOServerInitiator::FitsIOServerInitiator()
Index: /trunk/SophyaExt/FitsIOServer/fiosinit.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fiosinit.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fiosinit.h	(revision 3493)
@@ -1,3 +1,7 @@
-// This may look like C code, but it is really -*- C++ -*-
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   Guy Le Meur, R. Ansari , 2000-2006 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 // Classe d'initialiseur du module FitsIOServer
 
@@ -6,5 +10,5 @@
 
 
-// Classe d''initialisation pour les modules de PEIDA++
+// Classe d''initialisation pour les modules de SOPHYA
 #include "sophyainit.h"
 
Index: /trunk/SophyaExt/FitsIOServer/fitsarrhand.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsarrhand.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitsarrhand.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   R. Ansari , 2005-2008 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSARRHAND_H
 #define FITSARRHAND_H
@@ -64,8 +69,10 @@
 
   //----- Ecriture
+  //! Writes the complete array as an IMAGE HDU
   virtual void     Write(FitsInOutFile& os)
     {
-      if ( dobj == NULL) 
-	throw NullPtrError("FitsArrayHandler<T>::Write() dobj=NULL ");
+      if (( dobj == NULL) || (dobj->Size() < 1))  
+  	  throw NullPtrError("FitsArrayHandler<T>::Write() dobj=NULL or dobj->Size()=0");
+    	
       LONGLONG naxes[BASEARRAY_MAXNDIMS] = {0,0,0,0,0};
       for(int_4 id=0; id<dobj->NbDimensions(); id++) 
@@ -81,4 +88,5 @@
 
   //----- Lecture
+  //! Resize the array and reads the complete IMAGE HDU to the array
   virtual void     Read(FitsInOutFile& is)
     {
@@ -97,9 +105,61 @@
       }
       sa_size_t sz[BASEARRAY_MAXNDIMS];
-      if (naxis > BASEARRAY_MAXNDIMS) naxis = BASEARRAY_MAXNDIMS;
+      if (naxis > BASEARRAY_MAXNDIMS) { 
+      	cerr << "FitsArrayHandler<T>::Read()/Warning FITS NAXIS=" << naxis 
+      		 << " > BASEARRAY_MAXNDIMS=" << BASEARRAY_MAXNDIMS << endl;
+      	naxis = BASEARRAY_MAXNDIMS;
+      }
       for(int_4 id=0; id<naxis; id++) sz[id] = naxes[id];
       dobj->SetSize(naxis, sz, 1, false);
       FitsBlockRW<T>::ReadImageData(is, dobj->Data(), dobj->Size());
       is.GetHeaderRecords(dobj->Info());
+    }
+
+  //----- Lecture avec specification d'offset et taille donnee par le tableau
+  /*!  \brief Reads from the fits file into the array, at the specified offset 
+  
+     The array should be allocated and its size is used to define the number of 
+     pixels to be read. 
+     \warning The offset should be specified with SOPHYA/C array index convention 
+     (starting at zero) - and NOT the cfitsio/fortran convention. 
+     The offset should contain as many elements as the fits NAXIS keyword.
+  */
+  virtual void     ReadAtOffset(FitsInOutFile& is, sa_size_t* offset)
+    {
+    if (( dobj == NULL) || (dobj->Size() < 1))  
+  	  throw NullPtrError("FitsArrayHandler<T>::ReadAtOffset() dobj=NULL or dobj->Size()=0");
+	
+    LONGLONG naxes[BASEARRAY_MAXNDIMS];
+    int naxis=BASEARRAY_MAXNDIMS;
+    is.GetImageHDUInfo(naxis, naxes);
+    LONGLONG fpix[15]; 
+    int namx = (naxis < 15) ? naxis : 15;
+    for(int i=0; i<namx; i++) fpix[i] = offset[i]+1;
+    FitsBlockRW<T>::ReadImageData(is, dobj->Data(), dobj->Size(), fpix);
+    is.GetHeaderRecords(dobj->Info());
+    }
+
+  //----- Ecriture avec specification d'offset et taille donnee par le tableau
+  /*!  \brief Writes the array to the fits file, at the specified offset 
+  
+     The array should be allocated and its size is used to define the number of 
+     pixels to be read. 
+     \warning The offset should be specified with SOPHYA/C array index convention 
+     (starting at zero) - and NOT the cfitsio/fortran convention. 
+     The offset should contain as many elements as the fits NAXIS keyword.
+     \warning The IMAGE HDU should be already created using FitsInOutFile::CreateImageHDU().
+  */
+  virtual void     WriteAtOffset(FitsInOutFile& os, sa_size_t* offset)
+    {
+    if (( dobj == NULL) || (dobj->Size() < 1))  
+  	  throw NullPtrError("FitsArrayHandler<T>::ReadAtOffset() dobj=NULL or dobj->Size()=0");
+
+    LONGLONG naxes[BASEARRAY_MAXNDIMS];
+    int naxis=BASEARRAY_MAXNDIMS;
+    os.GetImageHDUInfo(naxis, naxes);
+    LONGLONG fpix[15]; 
+    int namx = (naxis < 15) ? naxis : 15;
+    for(int i=0; i<namx; i++) fpix[i] = offset[i]+1;
+    FitsBlockRW<T>::WriteImageData(os, dobj->Data(), dobj->Size(), fpix);	
     }
 
@@ -110,8 +170,10 @@
 
 
+//! operator << overload to write a TArray<T> to a fits IMAGE HDU
 template <class T>
 inline FitsInOutFile& operator << (FitsInOutFile& os, TArray<T> const & obj)
 { FitsArrayHandler<T> fio(const_cast< TArray<T> &>(obj));  fio.Write(os);  return os; }
 
+//! operator >> overload to read a TArray<T> from a fits IMAGE HDU
 template <class T>
 inline FitsInOutFile& operator >> (FitsInOutFile& is, TArray<T> & obj)
Index: /trunk/SophyaExt/FitsIOServer/fitsblkrw.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsblkrw.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitsblkrw.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   R. Ansari , 2005-2008 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSBLKRW_H
 #define FITSBLKRW_H
@@ -20,5 +25,5 @@
 {
   int status = 0;
-  LONGLONG fpix[5] = {1,1,1,1,1};
+  LONGLONG fpix[15] = {1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1};
   if (fpixel == NULL) fpixel = fpix;
   T * ncd = const_cast<T *>(d);
@@ -40,5 +45,5 @@
 {
   int status = 0;
-  LONGLONG fpix[5] = {1,1,1,1,1};
+  LONGLONG fpix[15] = {1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1};
   if (fpixel == NULL) fpixel = fpix;
   int anynul = 0;
Index: /trunk/SophyaExt/FitsIOServer/fitsfile.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsfile.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitsfile.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   Guy Le Meur 09/2000    R. Ansari , 2006 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSFILE_H
 #define FITSFILE_H
Index: /trunk/SophyaExt/FitsIOServer/fitsgenedata.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsgenedata.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitsgenedata.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   C. Magneville, 2006 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSGENDATAHAND_H
 #define FITSGENDATAHAND_H
Index: /trunk/SophyaExt/FitsIOServer/fitshandler.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitshandler.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitshandler.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   R. Ansari, 2005 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSHANDLER_H
 #define FITSHANDLER_H
Index: /trunk/SophyaExt/FitsIOServer/fitshdtable.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitshdtable.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitshdtable.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   R. Ansari , 2005
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSDTABLEHAND_H
 #define FITSDTABLEHAND_H
Index: /trunk/SophyaExt/FitsIOServer/fitshisterr.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitshisterr.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitshisterr.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   C. Magneville, 2007
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSHISTERRHAND_H
 #define FITSHISTERRHAND_H
Index: /trunk/SophyaExt/FitsIOServer/fitshistos.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitshistos.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitshistos.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   C. Magneville, 2006 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSHISTOHAND_H
 #define FITSHISTOHAND_H
Index: /trunk/SophyaExt/FitsIOServer/fitsinoutfile.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsinoutfile.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitsinoutfile.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   R. Ansari , 2005-2008 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSINOUTFILE_H
 #define FITSINOUTFILE_H
@@ -98,5 +103,5 @@
  static float      cfitsioVersion();
  //! Return the SOPHYA FitsIOServer version 
- static float      Version() { return 2.0; }
+ static float      Version() { return 2.12; }
 
  //! Return the file name as specified in the constructor (or Open) 
Index: /trunk/SophyaExt/FitsIOServer/fitsioserver.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsioserver.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitsioserver.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   R. Ansari, C. Magneville, 2000-2008 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSIOSERVER_SEEN
 #define FITSIOSERVER_SEEN
Index: /trunk/SophyaExt/FitsIOServer/fitslocalmap.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitslocalmap.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitslocalmap.h	(revision 3493)
@@ -1,5 +1,7 @@
-// Guy Le Meur 08/2000
-
-
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   Guy Le Meur 08/2000    R. Ansari , 2006 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSLOCALMAP_SEEN
 #define FITSLOCALMAP_SEEN
Index: /trunk/SophyaExt/FitsIOServer/fitsmanager.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsmanager.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitsmanager.h	(revision 3493)
@@ -1,2 +1,7 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   R. Ansari , 2005 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSMANAGER_H
 #define FITSMANAGER_H
Index: /trunk/SophyaExt/FitsIOServer/fitsntuple.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsntuple.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitsntuple.h	(revision 3493)
@@ -1,3 +1,7 @@
-// Guy Le Meur 03/2000
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   Guy Le Meur 03/2000    R. Ansari , 2006 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 
 
Index: /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.h	(revision 3493)
@@ -1,7 +1,10 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   Guy Le Meur 03/2000    R. Ansari , 2006 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSSPHEREHEALPIX_SEEN
 #define FITSSPHEREHEALPIX_SEEN
 
-
-// Guy Le Meur 03/2000
 
 
Index: /trunk/SophyaExt/FitsIOServer/fitsspherethetaphi.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsspherethetaphi.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitsspherethetaphi.h	(revision 3493)
@@ -1,7 +1,9 @@
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   Guy Le Meur 10/2001     R. Ansari , 2006
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSSPHERETHETAPHI_SEEN
 #define FITSSPHERETHETAPHI_SEEN
-
-
-// Guy Le Meur 10/2001
 
 
Index: /trunk/SophyaExt/FitsIOServer/fitsswapper.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsswapper.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/fitsswapper.h	(revision 3493)
@@ -1,6 +1,7 @@
-// This may look like C code, but it is really -*- C++ -*-
-// Gestion de block de donnees swapable
-//          C. Magneville R. Ansari  Mai 2005
-// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   R. Ansari,  C. Magneville,   Mai 2005 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 #ifndef FITSSWAPPER_H
 #define FITSSWAPPER_H
Index: /trunk/SophyaExt/FitsIOServer/swfitsdtable.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/swfitsdtable.h	(revision 3492)
+++ /trunk/SophyaExt/FitsIOServer/swfitsdtable.h	(revision 3493)
@@ -1,6 +1,7 @@
-// This may look like C code, but it is really -*- C++ -*-
-// Class DataTable  (Row-Column data table in memory) 
-//   R. Ansari -  Avril 2005
-//   (C)  LAL-IN2P3/CNRS    CEA-DAPNIA  
+/*    
+   --- SOPHYA software - FitsIOServer module ---
+   R. Ansari , 2005-2008 
+   (C) UPS+LAL IN2P3/CNRS     (C) DAPNIA-SPP/CEA 
+*/
 
 #ifndef SWFITSDTABLE_H_SEEN
@@ -15,5 +16,5 @@
 namespace SOPHYA {
 
-//! An implementation of BaseDataTable with using FITS files as swap space.
+//! An implementation of BaseDataTable  using FITS files as swap space.
 class SwFitsDataTable : public BaseDataTable {
 public:
