Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3800)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3801)
@@ -53,4 +53,9 @@
    * mraw/MRawRead.[h,cc]:
      - added fForceMode flag to be able to suppress event errors
+
+   * mbadpixels/MBadPixelsTreat.[h,cc]:
+     - changes such that the pedestal interpolation is now done
+       only in ReInit. If you need the old behaviour call
+       SetProcessRMS()
 
 
Index: /trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 3800)
+++ /trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 3801)
@@ -235,5 +235,5 @@
         // If not, unmap the pixel. The maximum number of blind neighbors
         // should be 2
-        if (num<3)
+        if (num<fNumMinNeighbors)
         {
             pix->SetPixelUnmapped();
@@ -351,4 +351,5 @@
 //      the Image Parameters.
 //
+/*
 void MBadPixelsTreat::Interpolate() const
 {
@@ -453,5 +454,5 @@
         }
 
-        if (num<2)
+        if (num<fNumMinNeighbors)
         {
             pix->SetPixelUnmapped();
@@ -492,4 +493,5 @@
     }
 }
+*/
 
 // --------------------------------------------------------------------------
@@ -517,27 +519,27 @@
 // --------------------------------------------------------------------------
 //
+// Interpolate Pedestals if kProcessRMS not set
+//
+Bool_t MBadPixelsTreat::ReInit(MParList *pList)
+{
+    if (!TESTBIT(fFlags, kProcessRMS))
+        InterpolatePedestals();
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
 // Treat the blind pixels
 //
 Int_t MBadPixelsTreat::Process()
 {
-    /*
-    if (TESTBIT(fFlags, kCheckPedestalRms))
-    {
-        // if the number of blind pixels is too high, do not interpolate
-       if (CheckPedestalRms()==kFALSE)
-           return kTRUE;
-
-       if (TESTBIT(fFlags, kUseInterpolation))
-           InterpolatePedestals();
-    }
-    */
-
     if (TESTBIT(fFlags, kUseInterpolation) && fGeomCam)
-        Interpolate();
+    {
+        InterpolateSignal();
+        if (TESTBIT(fFlags, kProcessRMS))
+            InterpolatePedestals();
+    }
     else
         Unmap();
-
-
-    //fErrors[0]++;
 
     return kTRUE;
