Index: branches/pap/psModules/src/imcombine/pmStack.c
===================================================================
--- branches/pap/psModules/src/imcombine/pmStack.c	(revision 25780)
+++ branches/pap/psModules/src/imcombine/pmStack.c	(revision 25938)
@@ -33,7 +33,7 @@
 #define NUM_DIRECT_STDEV 5              // For less than this number of values, measure stdev directly
 
-//#define TESTING                         // Enable test output
-//#define TEST_X 1085                     // x coordinate to examine
-//#define TEST_Y 3371                     // y coordinate to examine
+#define TESTING                         // Enable test output
+#define TEST_X -1                     // x coordinate to examine
+#define TEST_Y -1                     // y coordinate to examine
 
 
@@ -390,4 +390,5 @@
         }
     }
+    int numRejected = 0;                // Number of rejected inputs
 #endif
 
@@ -423,4 +424,5 @@
               fprintf(stderr, "Single input to combine, safety on, pixel is bad.\n");
           }
+          numRejected = 1;
 #endif
           break;
@@ -468,4 +470,5 @@
                               diff, rej, sqrtf(sigma2));
                   }
+                  numRejected = 2;
 #endif
               }
@@ -579,4 +582,5 @@
                                       j, diff, sqrtf(pixelLimits->data.F32[j]));
                           }
+                          numRejected++;
 #endif
                       }
@@ -588,4 +592,5 @@
                                   j, diff, limit);
                       }
+                      numRejected++;
 #endif
                   }
@@ -632,4 +637,11 @@
         variance->data.F32[y][x] = varianceValue;
     }
+
+#ifdef TESTING
+    mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = num;
+    if (variance) {
+        variance->data.F32[y][x] = 1.0 - (float)numRejected / (float)num;
+    }
+#endif
 
     return;
