Index: /trunk/MagicSoft/Mars/mtemp/mifae/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/mifae/Changelog	(revision 4224)
+++ /trunk/MagicSoft/Mars/mtemp/mifae/Changelog	(revision 4225)
@@ -21,7 +21,8 @@
 	
  2004/05/27 Javier Rico
-   * programs/makeHillas.cc
+   * programs/makeHillas.cc, programs/makehillas.datacard
      - Remove unneeded MCalibrationQECam and MBadPixelsCam objects, 
        trying to trace back a bug in the calibration
+     - Add possibility to interpolate bad pixels
 
    * library/MHillasDisplay.cc
Index: /trunk/MagicSoft/Mars/mtemp/mifae/programs/makeHillas.cc
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/mifae/programs/makeHillas.cc	(revision 4224)
+++ /trunk/MagicSoft/Mars/mtemp/mifae/programs/makeHillas.cc	(revision 4225)
@@ -10,4 +10,5 @@
 #include "MPedestalCam.h"
 #include "MBadPixelsCam.h"
+#include "MBadPixelsTreat.h"
 #include "MReadMarsFile.h"
 #include "MGeomApply.h"
@@ -130,6 +131,4 @@
   extractor.SetRange(hifirst,hilast,lofirst,lolast);
 
-  //  MCalibrationQECam   qecam;
-  //  MBadPixelsCam       badcam;
   MGeomCamMagic       geomcam;
   MGeomApply          geomapl;
@@ -159,5 +158,4 @@
   calloop.SetExtractor(&extractor);
   calloop.SetInput(&caliter);
-  //  calloop.SetQECam(qecam);
   calloop.SetBadPixels(pedloop.GetBadPixels());
 
@@ -184,5 +182,5 @@
   plist3.AddToList(&calloop.GetQECam());
   plist3.AddToList(&calloop.GetRelTimeCam());
-  //  plist3.AddToList(&badcam);
+  plist3.AddToList(&calloop.GetBadPixels());
   plist3.AddToList(&sigcam);
   plist3.AddToList(&nphot);
@@ -201,6 +199,4 @@
   read3.DisableAutoScheme();
  
-  //  MExtractSignal  extsig;
-  //  extsig.SetRange(hifirst,hilast,lofirst,lolast);
   MCalibrate      photcalc(calMode);
   MPedPhotCalc    photrmscalc; 
@@ -258,5 +254,5 @@
   plist4.AddToList(&calloop.GetQECam());
   plist4.AddToList(&calloop.GetRelTimeCam());
-  //  plist4.AddToList(&badcam);
+  plist4.AddToList(&calloop.GetBadPixels());
   plist4.AddToList(&nphot);
   plist4.AddToList(&nphotrms);
@@ -274,15 +270,4 @@
   read4.DisableAutoScheme();
   
-  // set bad pixels 
-  MBlindPixelCalc   blind;
-  MBlindPixelCalc   blind2;
-  const Short_t x[16] = {330,395,329,396,389,
-                         323,388,322,384,385,
-                         386,387,321,320,319,
-                         394};
-  const TArrayS bp(16,(Short_t*)x);
-  blind.SetPixelIndices(bp);
-  blind2.SetPixelIndices(bp);
-  
   MImgCleanStd      clean(lcore,ltail);
 
@@ -291,4 +276,7 @@
   MIslandCalc       island;
   island.SetOutputName("MIslands1");
+
+  MBadPixelsTreat   interpolatebadpixels;
+  interpolatebadpixels.SetUseInterpolation();
 
   MIslandClean      islclean(lnew);
@@ -331,5 +319,4 @@
       if (islflag == 2)
 	disphillas->SetIslandsName("MIslands2");
-
     }      
 
@@ -338,5 +325,6 @@
   tlist4.AddToList(&extractor);
   tlist4.AddToList(&photcalc);
-  //tlist4.AddToList(&blind);
+  if(calflag==11)
+    tlist4.AddToList(&interpolatebadpixels);
   tlist4.AddToList(&clean);
 
@@ -523,5 +511,13 @@
   if(display)
     cout << "Generating PS file: " << psfilename << endl;
-  cout << "Calibration flag: " << calflag << endl;
+  cout << "Calibration: ";
+  if(calflag==0)    
+    cout << "Pixel area proportional intercalibration" << endl;
+  else if(calflag==-1)    
+    cout << "No calibration whatsoever" << endl;
+  else if(calflag==1)
+    cout << "Default calibration" << endl;
+  else if(calflag==11)
+    cout << "Default calibration + bad pixels interpolation" << endl;
   cout << "Cleaning level: ("<<lcore<<","<<ltail<<")" << endl;
   if (islflag == 1 || islflag == 2)
Index: /trunk/MagicSoft/Mars/mtemp/mifae/programs/makehillas.datacard
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/mifae/programs/makehillas.datacard	(revision 4224)
+++ /trunk/MagicSoft/Mars/mtemp/mifae/programs/makehillas.datacard	(revision 4225)
@@ -1,5 +1,15 @@
+/////////////////////////////////////////////////////////
+// Data card template for makeHillas executable        //
+//                                                     //
+// *** Compulsory cards are:                           //
+// PRUNS, CRUNS, DRUNS, OUTFILE                        //
+//                                                     //
+// the rest are optional                               //
+// *** Do NEVER add a datacard with no value after it  //
+/////////////////////////////////////////////////////////
+
 
 // Maximun number of (data) events to be processed)
-NEVENTS 10
+NEVENTS 9999999
 
 // data file directory
@@ -9,5 +19,5 @@
 PRUNS 16743
 CRUNS 16744
-DRUNS 16745-16767
+DRUNS 16745
 
 // output file name
@@ -19,5 +29,5 @@
 // Enclose all conditions between brakets, like: "(x<y) && (z<5)"
 // (see MF description class for more details)
-FILTER (MHillas.fLength<100) && (MHillas.fLength>50)
+// FILTER (MHillas.fLength<100) && (MHillas.fLength>50)
 
 // Display flag 
@@ -25,5 +35,5 @@
 // DISPLAY 1 will show event display and produce ps file
 // DISPLAY 2 will produce the ps files, no display
-DISPLAY 0
+DISPLAY 1
 
 // PS file name
@@ -34,5 +44,6 @@
 //  0: kNone
 //  1: kDefault
-CALFLAG 0
+// 11: kDefault + bad pixel interpolation
+CALFLAG 11
 
 // Cleaning level
