Index: /trunk/ippconfig/gpc1/ppStack.config
===================================================================
--- /trunk/ippconfig/gpc1/ppStack.config	(revision 36709)
+++ /trunk/ippconfig/gpc1/ppStack.config	(revision 36710)
@@ -167,10 +167,12 @@
     PSF.TARGET.AS.MAX  BOOL  TRUE
     PSF.TARGET.AS.MAX.EPSILON F32 0.1
-    THRESHOLD.MASK  F32     0.01             # Threshold for mask deconvolution (0..1)
+    THRESHOLD.MASK  F32     0.3             # Threshold for mask deconvolution (0..1)
     COMBINE.ITER    F32     0.5             # Number of rejection iterations per input
-    COMBINE.REJ     F32     2.5             # Rejection threshold in combination (sigma)
+    COMBINE.REJ     F32     3.5             # Rejection threshold in combination (sigma)
     COMBINE.SYS     F32     0.1             # Relative systematic error in combination
     COMBINE.DISCARD F32     0.2             # Discard fraction for Olympic weighted mean
     IMAGE.REJ       F32     0.1             # Rejected pixel fraction threshold for rejecting entire image
+    NMINPIX         S32     10              # Minimum input per pixel -- testing 
+    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
 END
 
Index: /trunk/ippconfig/recipes/ppStack.config
===================================================================
--- /trunk/ippconfig/recipes/ppStack.config	(revision 36709)
+++ /trunk/ippconfig/recipes/ppStack.config	(revision 36710)
@@ -32,4 +32,5 @@
 TARGET.FRAC	F32	0.1		# Minimum flux fraction for target PSF
 TARGET.MINMAG	F32	3.0		# Minimum magnitude difference to tolerate in stamp
+NMINPIX		S32	1 		# Minimum input per pixel -- testing 
 
 BACKGROUND.MODEL    BOOL   FALSE        # Construct a stacked version of the warp stage background
Index: /trunk/ppStack/src/ppStackReadout.c
===================================================================
--- /trunk/ppStack/src/ppStackReadout.c	(revision 36709)
+++ /trunk/ppStack/src/ppStackReadout.c	(revision 36710)
@@ -116,4 +116,6 @@
     bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection?
     bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels
+   
+    int nminpix = psMetadataLookupS32(&mdok, recipe, "NMINPIX"); // Minimum input per pixel to combine with
 
     psMetadata *ppsub = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe
@@ -161,5 +163,5 @@
 
     if (!pmStackCombine(outRO, NULL, stack, maskBad, maskSuspect, maskBlank, kernelSize, iter,
-                        combineRej, combineSys, combineDiscard, useVariance, safe, false)) {
+                        combineRej, combineSys, combineDiscard, useVariance, safe, nminpix, false)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts with rejection.");
         psFree(stack);
@@ -218,4 +220,6 @@
     bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection?
     bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels
+
+    int nminpix = psMetadataLookupS32(&mdok, recipe, "NMINPIX"); // Minimum input per pixel to combine with
 
     psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask for bad
@@ -275,5 +279,5 @@
 
     if (!pmStackCombine(outRO, expRO, stack, maskBad, maskSuspect, maskBlank, 0, iter, combineRej,
-                        combineSys, combineDiscard, useVariance, safe, rejected)) {
+                        combineSys, combineDiscard, useVariance, safe, nminpix, rejected)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts.");
         psFree(stack);
Index: /trunk/psModules/src/imcombine/pmStack.c
===================================================================
--- /trunk/psModules/src/imcombine/pmStack.c	(revision 36709)
+++ /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 36709)
+++ /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?
     );
