Index: trunk/SophyaProg/PMixer/skymixer.cc
===================================================================
--- trunk/SophyaProg/PMixer/skymixer.cc	(revision 1282)
+++ trunk/SophyaProg/PMixer/skymixer.cc	(revision 1295)
@@ -30,4 +30,5 @@
 RadSpectra * getEmissionSpectra(DataCards & dc, int nc);
 void SKM_MergeFITSKeywords(char * flnm);
+void SKM_MergeFITSKeywords2(DVList & dvl);
 void RadSpec2Nt(RadSpectra & rs, POutPersist & so, string name);
 void SpectralResponse2Nt(SpectralResponse& sr, POutPersist & so, string name);
@@ -138,5 +139,7 @@
 	fios.Read(ifnm,2);
 	//  Getting FITS keywords in primary header
-	SKM_MergeFITSKeywords(ifnm); 
+	//	SKM_MergeFITSKeywords(ifnm); 
+	//  Getting FITS keywords in data object header
+	SKM_MergeFITSKeywords2(outgs.Info()); 
       }
       if(printlev>0)
@@ -203,5 +206,7 @@
 	    fiosIn.Read(flnm,2);
 	    //  Getting FITS keywords in primary header
-	    SKM_MergeFITSKeywords(flnm); 
+	    //  SKM_MergeFITSKeywords(flnm); 
+	    //  Getting FITS keywords in data object header
+	    SKM_MergeFITSKeywords2(ings.Info()); 
 	  }
 	  if (debuglev > 4) {  // Writing the input map to the outppf
@@ -242,5 +247,7 @@
 		fiosBM.Read(flnm,2);
 		//  Getting FITS keywords in primary header
-		SKM_MergeFITSKeywords(flnm); 
+		// SKM_MergeFITSKeywords(flnm); 
+		//  Getting FITS keywords in data object header
+		SKM_MergeFITSKeywords2(betaMap.Info()); 
 	      }
 	      if (printlev > 2) {
@@ -311,5 +318,6 @@
      dvl["SKYMVER"] =  skm_version;
      dvl.SetComment("SKYMVER", "skymixer Version number"); 
-     fios.DVListIntoPrimaryHeader(dvl);  
+     //     fios.DVListIntoPrimaryHeader(dvl);  
+     outgs.Info() = dvl;
      fios << outgs ;
    }
@@ -502,5 +510,7 @@
     fiis >> mtx ; 
     //  Getting FITS keywords in primary header
-    SKM_MergeFITSKeywords(ifnm); 
+    //    SKM_MergeFITSKeywords(ifnm); 
+    //  Getting FITS keywords in data object header
+    SKM_MergeFITSKeywords2(mtx.Info()); 
     double numin = dc.DParam(key, 2, 1.);
     double numax = dc.DParam(key, 3, 9999.);
@@ -556,5 +566,7 @@
     fiis >> mtx ; 
     //  Getting FITS keywords in primary header
-    SKM_MergeFITSKeywords(ifnm); 
+    //    SKM_MergeFITSKeywords(ifnm); 
+    //  Getting FITS keywords in data object header
+    SKM_MergeFITSKeywords2(mtx.Info()); 
     double numin = dc.DParam(key, 2, 1.);
     double numax = dc.DParam(key, 3, 9999.);
@@ -799,4 +811,40 @@
 
 /* Nouvelle-Fonction */
+void SKM_MergeFITSKeywords2(DVList & dvl)
+{
+  // Cleaning the keywords 
+#define SZexlst 21
+  char *exlst[SZexlst]=
+  {"SIMPLE","BITPIX" ,"NAXIS" ,"NAXIS#" ,"PCOUNT","GCOUNT",
+     "EXTEND","ORIGIN" ,"DATE*" ,"TFIELDS","TTYPE#","TFORM#",
+     "TUNIT#","EXTNAME","CTYPE#","CRVAL#" ,"CRPIX#","CDELT#",
+     "XTENSION","INSTRUME","TELESCOP"};
+  char  kwex[32];
+  int i,l;
+  for (i=0; i<SZexlst; i++) {
+    strncpy(kwex, exlst[i], 32);
+    l = strlen(kwex)-1;
+    if ((kwex[l] != '*') && (kwex[l] != '#')) {
+      dvl.DeleteKey(kwex);
+    } 
+    else {
+      bool fgd = (kwex[l] == '#') ? true : false;
+      list<string> lstsup;
+      kwex[l] = '\0';
+      DVList::ValList::const_iterator it;
+      for (it = dvl.Begin(); it != dvl.End(); it++) {
+	if ((*it).first.substr(0,l) != kwex) continue;
+	if (fgd && !isdigit((*it).first[l])) continue;
+	lstsup.push_back((*it).first);
+      }
+      list<string>::iterator it2;
+      for (it2 = lstsup.begin(); it2 != lstsup.end(); it2++)
+	dvl.DeleteKey(*it2);
+    }
+  }
+  dvl_fitskw->Merge(dvl);
+}
+
+/* Nouvelle-Fonction */
 void RadSpec2Nt(RadSpectra & rs, POutPersist & so, string name)
 {
Index: trunk/SophyaProg/PMixer/tgsky.cc
===================================================================
--- trunk/SophyaProg/PMixer/tgsky.cc	(revision 1282)
+++ trunk/SophyaProg/PMixer/tgsky.cc	(revision 1295)
@@ -118,4 +118,5 @@
   dvl["TGSKYKW"] =  "Test Keyword from tgsky.cc";
   fios.DVListIntoPrimaryHeader(dvl);  
+  sph.Info() = dvl;
   fios << sph; 
   cout << "SphereHEALPix<float> written to FITS file " << (string)(arg[4]) << endl;
