Index: trunk/ArchTOIPipe/TestPipes/toistat.cc
===================================================================
--- trunk/ArchTOIPipe/TestPipes/toistat.cc	(revision 2055)
+++ trunk/ArchTOIPipe/TestPipes/toistat.cc	(revision 2058)
@@ -45,5 +45,5 @@
     cout << "\n Usage : toistat [-intoi toiname] [-start snb] [-end sne] \n" 
 	 << "         [-wtoi sz] [-wclean wsz,nbw] [-range min,max] [-cleannsig nsig] \n"
-	 << "         [-outppf] [-noprstat] [-useseqbuff] \n"
+	 << "         [-sepflg sepFlagFile] [-outppf] [-noprstat] [-useseqbuff] \n"
 	 << "         inFitsName outFileName \n" 
 	 << "   -start snb : sets the start sample num \n"
@@ -52,4 +52,5 @@
 	 << "              default= -16000,16000\n"
 	 << "   -intoi toiName : select input TOI name (def bolo)\n"
+	 << "   -sepflg sepFlagFileName: sets separate flag file (Level2)\n" 
 	 << "   -wtoi sz : sets TOISeqBuff buffer size (def= 8192)\n"
 	 << "   -wclean wsz,nbw : sets cleaner window parameters (256,5) \n"
@@ -90,4 +91,8 @@
   int clean_nbw = 5;
   double clean_nsig = 999999.;
+
+// Fichier de flag separe / Level2 / Reza 18/6/2002
+  string sepflagfile;   
+  bool sepflg = false;  
 
   // File names 
@@ -130,4 +135,9 @@
       intoi = arg[ia+1]; ia++;
     }    
+    else if (strcmp(arg[ia],"-sepflg") == 0) {
+      if (ia == narg-1) Usage(true);  
+      sepflagfile = arg[ia+1]; 
+      sepflg = true; ia++;
+    }    
     else if (strcmp(arg[ia],"-outppf") == 0)  fgoutppf = true;
 
@@ -166,4 +176,12 @@
     cout << "> Creating FITSTOIReader object - InFile=" << infile << endl;
     FITSTOIReader r(infile); 
+    if (sepflg) {
+      cout << " Setting separate flag file for InTOI_bolo File=" << sepflagfile 
+	   << " (Flags=FlgToiSpike, FlgToiSource)" << endl;
+      vector<FlagToiDef> flgcol;
+      flgcol.push_back(FlgToiSpike);
+      flgcol.push_back(FlgToiSource);
+      r.setFlagFile(sepflagfile, flgcol);
+    }
 
     cout << "> Creating SimpleCleaner() " << endl;
Index: trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc
===================================================================
--- trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc	(revision 2055)
+++ trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc	(revision 2058)
@@ -27,5 +27,5 @@
      <<"           [-a label_coord1] [-d label_coord2] [-b label_bolomuv]"<<endl
      <<"           [-n nlat] [-i c,h] [-o c,h]"<<endl
-     <<"           [-m vmin] [-M vmax] [-f flag]"<<endl
+     <<"           [-m vmin] [-M vmax] [-f flag] [-F sepFlagFileName]"<<endl
      <<"           fitsin_point fitsin_bolo fitsphout [fitsphwout]"<<endl
      <<" -p lp : print level (def=0)"<<endl
@@ -44,5 +44,8 @@
      <<" -f flag : samples are bad if match flag"<<endl
      <<" -N nbfiles : Number of fitsin_point files fitsin_point%d.fits 0..nb-1"<<endl
+     <<" -c calibcoeff : Coefficient de calibration a appliquer (def=1.)"<<endl
      <<" -I : sampleNum are implicit in fits files (def=no)"<<endl
+     <<" -F sepFlagFileName : separate flag file name for levelS"<<endl
+     <<"                      (FlagColName: Glitch PtSrc)"<<endl
      <<" fitsin_point : fits file for pointing"<<endl
      <<" fitsin_bolo : fits file for bolo values"<<endl
@@ -70,6 +73,10 @@
 bool fgprstat = true;
 int nbpointfiles = 0;
+double coeffcalib = 1.;
+string sepflagfile;   // Fichier de flag separe / Level2 / Reza 18/6/2002
+bool sepflg = false;  //   "     "     "      "       "       "       "
+
 int c;
-while((c = getopt(narg,arg,"hIp:s:w:a:d:b:n:i:o:m:M:f:e:N:")) != -1) {
+while((c = getopt(narg,arg,"hIp:s:w:a:d:b:n:i:o:m:M:f:e:N:c:F:")) != -1) {
   switch (c) {
   case 's' :
@@ -125,6 +132,13 @@
     nbpointfiles = atoi(optarg);
     break;
+  case 'c' :
+    coeffcalib = atof(optarg);
+    break;
   case 'I' :
     snimplicit = true;
+    break;
+  case 'F' :
+    sepflagfile = optarg;
+    sepflg = true;
     break;
   case 'h' :
@@ -154,5 +168,6 @@
     <<"  ...... ctype="<<tcoormap<<endl;
 cout<<"Equinoxe "<<equi<<" years"<<endl;
-
+cout<<"CoeffCalib "<<coeffcalib<<endl;
+ 
 SophyaInit();
 InitTim();
@@ -170,4 +185,15 @@
  if(ncolb<1) exit(-4);
 
+
+ sepflagfile = optarg;
+ sepflg = true;
+ if (sepflg) {
+   cout << " Setting separate flag file for InTOI_bolo File=" << sepflagfile 
+	<< " (Flags=FlgToiSpike, FlgToiSource)" << endl;
+   vector<FlagToiDef> flgcol;
+   flgcol.push_back(FlgToiSpike);
+   flgcol.push_back(FlgToiSource);
+   rfitsb.setFlagFile(sepflagfile, flgcol);
+ }
  string pointfileI = fitsin_point;
  MuTyV numf=0;
@@ -212,4 +238,5 @@
  toi2m.SetTestMin(tmin,vmin);
  toi2m.SetTestMax(tmax,vmax);
+ toi2m.SetCalibrationFactor(coeffcalib);
  toi2m.Print(cout);
 
