Index: /trunk/AddOn/TAcq/minifits.cc
===================================================================
--- /trunk/AddOn/TAcq/minifits.cc	(revision 3683)
+++ /trunk/AddOn/TAcq/minifits.cc	(revision 3684)
@@ -86,4 +86,6 @@
   nax1 = 1;
   nax2 = 1; 
+  nax3 = 1; 
+  fgnax3 = false;
   totwsz = 0;
   header = new char[MFITSHLEN];
@@ -152,5 +154,22 @@
   nax1 = na1; 
   nax2 = na2;
-}
+  nax3 = 1;
+  fgnax3 = false;
+}
+
+/* --Methode-- */
+void MiniFITSFile::setDTypeNaxis(MiniFITS_DT dt, size_t na1, size_t na2, size_t na3)
+{
+  // Interdit si fichier ouvert en lecture ...
+  if ((fip!=NULL)&&(rwmode == MF_Read))  
+     throw MiniFITSException("MiniFITSFile::setDTypeNaxis()/Error ReadOnly file");
+
+  dtype = dt;
+  nax1 = na1; 
+  nax2 = na2;
+  nax3 = na3;
+  fgnax3 = true;
+}
+
 
 /* --Methode-- */
@@ -192,5 +211,8 @@
   buff[strlen(buff)] = ' ';
   buff = header+160;
-  strcpy(buff, "NAXIS   =                    2 / number of data axes");
+  if (fgnax3) 
+    strcpy(buff, "NAXIS   =                    2 / number of data axes");
+  else 
+    strcpy(buff, "NAXIS   =                    3 / number of data axes");
   buff[strlen(buff)] = ' ';
   buff = header+240;
@@ -200,8 +222,15 @@
   sprintf(buff, "NAXIS2  = %20ld / nb of rows = NumberOfPaquets", (long)nax2);
   buff[strlen(buff)] = ' ';
-  buff = header+400+nkeya_*80;
+  buff = header+400;
+  if (fgnax3) 
+    sprintf(buff, "NAXIS3  = %20ld / nb of rows = NumberOfFibers", (long)nax3);
+  else 
+    strcpy(buff,"COMMENT  BAO-Radio / MiniFITSFile ");
+  buff[strlen(buff)] = ' ';
+  
+  buff = header+480+nkeya_*80;
   strcpy(buff,"COMMENT  BAO-Radio / MiniFITSFile ");
   buff[strlen(buff)] = ' ';
-  buff = header+480+nkeya_*80;
+  buff = header+560+nkeya_*80;
   strcpy(buff,"END");
   buff[strlen(buff)] = ' ';
@@ -213,5 +242,5 @@
 int MiniFITSFile::AddKeyI(const char* key, long val, const char* comm)
 {
-  if (nkeya_ >= 29) return 0;
+  if (nkeya_ >= 28) return 0;
   char cle[10];
   strncpy(cle,key,8);
@@ -220,5 +249,5 @@
     if (cle[i]=='\0') cle[i]=' ';
   cle[9]='\0';
-  char* buff=header+400+nkeya_*80;
+  char* buff=header+480+nkeya_*80;
   if (comm!=NULL) {
     char tcom[50];
@@ -236,5 +265,5 @@
 int MiniFITSFile::AddKeyD(const char* key, double val, const char* comm)
 {
-  if (nkeya_ >= 29) return 0;
+  if (nkeya_ >= 28) return 0;
   char cle[10];
   strncpy(cle,key,8);
@@ -243,5 +272,5 @@
     if (cle[i]=='\0') cle[i]=' ';
   cle[9]='\0';
-  char* buff=header+400+nkeya_*80;
+  char* buff=header+480+nkeya_*80;
   if (comm!=NULL) {
     char tcom[50];
@@ -259,5 +288,5 @@
 int MiniFITSFile::AddKeyS(const char* key, const char* val, const char* comm)
 {
-  if (nkeya_ >= 29) return 0;
+  if (nkeya_ >= 28) return 0;
   char cle[10];
   strncpy(cle,key,8);
@@ -274,5 +303,5 @@
   if ((l<70)&&(comm!=NULL)) strncpy(tcom+l,comm,70-l);
   tcom[70]='\0';
-  char* buff=header+400+nkeya_*80;
+  char* buff=header+480+nkeya_*80;
   sprintf(buff,"%s %s", cle, tcom);
   buff[strlen(buff)] = ' ';
@@ -291,4 +320,5 @@
   bool fgok1=false;
   bool fgok2=false;
+  bool fgok3=false;
   for(int kh=80; kh<2800; kh+=80) {
   	buff = header+kh;
@@ -303,4 +333,9 @@
 //  	  cout << " FOUND : NAXIS2= " << nax2 << endl;  	  
   	} 
+  	else if (strncmp(buff, "NAXIS3  =", 9) == 0)  {
+  	  nax3 = atol(buff+10);
+  	  fgok3 = true;
+//  	  cout << " FOUND : NAXIS2= " << nax2 << endl;  	  
+  	} 
   	else if (strncmp(buff, "BITPIX  =", 9) == 0)  {
   	  int bpix = atoi(buff+10);
@@ -315,4 +350,5 @@
   if (!(fgok1&&fgok2&&fgokt))  
      throw MiniFITSException("MiniFITSFile::DecodeHeader()/Error- Missing/wrong NAXIS1/2,BITPIX");
+  if (fgok3)  fgnax3=true;
   return;
 }
Index: /trunk/AddOn/TAcq/minifits.h
===================================================================
--- /trunk/AddOn/TAcq/minifits.h	(revision 3683)
+++ /trunk/AddOn/TAcq/minifits.h	(revision 3684)
@@ -51,8 +51,11 @@
   string DataTypeToString();  
 
-  size_t NAxis1() { return nax1; }
-  size_t NAxis2() { return nax2; }
+  inline size_t NAxes()  { return ((fgnax3)?3:2); }
+  inline size_t NAxis1() { return nax1; }
+  inline size_t NAxis2() { return nax2; }
+  inline size_t NAxis3() { return ((fgnax3)?nax3:0); }
 
   void setDTypeNaxis(MiniFITS_DT dt, size_t na1, size_t na2);
+  void setDTypeNaxis(MiniFITS_DT dt, size_t na1, size_t na2, size_t na3);
 
   // Lecture avec indication de la taille (nb d'elements) et offset 
@@ -100,5 +103,6 @@
   MiniFITS_Mode rwmode;
   MiniFITS_DT dtype;
-  size_t nax1, nax2;
+  size_t nax1, nax2, nax3;
+  bool fgnax3;  // true -> NAXIS=3 3D file 
   size_t totwsz;  // total bytes ecrits
   char* header; //  entete FITS
