Index: branches/eam_branches/ipp-20211108/psModules/src/imcombine/pmStack.c
===================================================================
--- branches/eam_branches/ipp-20211108/psModules/src/imcombine/pmStack.c	(revision 41939)
+++ branches/eam_branches/ipp-20211108/psModules/src/imcombine/pmStack.c	(revision 41940)
@@ -1711,12 +1711,18 @@
 	    combined->mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = outputMask;
 
+	    // The exposure time of interest should be the total number of values, after
+	    // rejection of known bad measurements, not the sorted and clipped number.
+	    // Note that if we were to take the median, the relevant exposure time would
+	    // still be the total of all inputs, not the single exposure for which the
+	    // median was generated.
+
 	    if (expTime) { 
 		float sum = 0.0;
-		for (int n = Ns; n < Ne; n++) {
+		for (int n = 0; n < nGood; n++) {
 		    sum += expTime->data.F32[n];
 		}
 		expmaps->image->data.F32[y][x] = sum;
 	    }
-	    if (expmaps) { expmaps->mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = Ne - Ns; }
+	    if (expmaps) { expmaps->mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = nGood; }
 	}
     }
