Index: trunk/psModules/src/imcombine/pmStack.c
===================================================================
--- trunk/psModules/src/imcombine/pmStack.c	(revision 16681)
+++ trunk/psModules/src/imcombine/pmStack.c	(revision 16685)
@@ -8,6 +8,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-02-27 02:25:10 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-02-27 21:16:57 $
  *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
  *
@@ -480,5 +480,5 @@
             int x = pixels->data[j].x, y = pixels->data[j].y; // Coordinates of interest
             if (x < 0 || x >= numCols || y < 0 || y >= numRows) {
-                psWarning("Bad pixel coordinate: %d,%d --- ignored.", x, y);
+                //                psWarning("Bad pixel coordinate: %d,%d --- ignored.", x, y);
                 continue;
             }
@@ -528,5 +528,5 @@
 /// Stack input images
 bool pmStackCombine(pmReadout *combined, psArray *input, psMaskType maskVal, psMaskType bad,
-                    int numIter, float rej, bool useVariance, bool safe)
+                    int kernelSize, int numIter, float rej, bool useVariance, bool safe)
 {
     PS_ASSERT_PTR_NON_NULL(combined, false);
@@ -538,4 +538,5 @@
         return false;
     }
+    PS_ASSERT_INT_NONNEGATIVE(kernelSize, false);
     PS_ASSERT_INT_POSITIVE(bad, false);
     PS_ASSERT_INT_NONNEGATIVE(numIter, false);
@@ -580,6 +581,14 @@
     psFree(stack);
     pmReadoutUpdateSize(combined, minInputCols, minInputRows, xSize, ySize, true, true, bad);
-    psTrace("psModules.imcombine", 1, "Combining [%d:%d,%d:%d] (%dx%d)\n",
+    psTrace("psModules.imcombine", 1, "Have for combination [%d:%d,%d:%d] (%dx%d)\n",
             minInputCols, maxInputCols, minInputRows, maxInputRows, xSize, ySize);
+
+    // Reduce combination area by the size of the kernel
+    minInputCols += kernelSize;
+    maxInputCols -= kernelSize;
+    minInputRows += kernelSize;
+    maxInputRows -= kernelSize;
+    psTrace("psModules.imcombine", 1, "Combining on [%d:%d,%d:%d]\n",
+            minInputCols, maxInputCols, minInputRows, maxInputRows);
 
 
