Index: trunk/psModules/src/imcombine/pmStack.c
===================================================================
--- trunk/psModules/src/imcombine/pmStack.c	(revision 36708)
+++ trunk/psModules/src/imcombine/pmStack.c	(revision 36710)
@@ -835,4 +835,5 @@
                           psImageMaskType goodMask, // Value for good pixels
                           bool safe,           // Safe combination?
+			  int nminpix,         // Minimum number of input per pixel
                           float invTotalWeight    // Inverse of total weight for all inputs
                           )
@@ -854,5 +855,11 @@
     CHECKPIX(x, y, "bad vs good : %x %x %x\n", maskValue, badMask, blankMask);
 
-    switch (num) {
+    //MEH -- hackish adding of lower limit for input per pixel 
+    int numN = num;
+    if (num < nminpix) {
+        CHECKPIX(x, y, "Nmin (%d) inputs (%d) to combine, pixel %d,%d is manually set bad\n", nminpix, numN, x, y);
+        numN = 0;
+    }
+    switch (numN) {
       case 0: {
           // Nothing to combine: it's bad
@@ -1518,4 +1525,5 @@
     bool useVariance, 
     bool safe, 
+    int nminpix,
     bool rejection)
 {
@@ -1692,5 +1700,5 @@
 	    psImageMaskType goodMask = 0; // OR of mask bits in all good input pixels
             combineExtract(&num, &suspect, &badMask, &goodMask, buffer, combinedImage, combinedMask, combinedVariance, input, weights, exps, addVariance, reject, x, y, badMaskBits, suspectMaskBits);
-            combinePixels(combinedImage, combinedMask, combinedVariance, exp, expnum, expweight, num, buffer, x, y, blankMaskBits, badMask, goodMask, safe, totalExpWeight);
+            combinePixels(combinedImage, combinedMask, combinedVariance, exp, expnum, expweight, num, buffer, x, y, blankMaskBits, badMask, goodMask, safe, nminpix, totalExpWeight);
 
             if (iter > 0) {
Index: trunk/psModules/src/imcombine/pmStack.h
===================================================================
--- trunk/psModules/src/imcombine/pmStack.h	(revision 36708)
+++ trunk/psModules/src/imcombine/pmStack.h	(revision 36710)
@@ -61,4 +61,5 @@
                     bool useVariance,   ///< Use variance values for rejection?
                     bool safe,          ///< Play safe with small numbers of input pixels (mask if N <= 2)?
+		    int nminpix,        ///< Minimum number input per pixel to combine
                     bool rejectInspect  ///< Reject pixels instead of marking them for inspection?
     );
