Index: trunk/ppSub/src/ppSubReadoutSubtract.c
===================================================================
--- trunk/ppSub/src/ppSubReadoutSubtract.c	(revision 29003)
+++ trunk/ppSub/src/ppSubReadoutSubtract.c	(revision 30619)
@@ -31,4 +31,5 @@
 
     bool reverse = psMetadataLookupBool(&mdok, config->arguments, "REVERSE"); // Reverse sense of subtraction?
+    bool addPair = psMetadataLookupBool(&mdok, recipe, "ADD.NOT.SUBTRACT"); // add instead of subtracting
 
     pmFPAview *view = ppSubViewReadout(); // View to readout
@@ -47,5 +48,10 @@
     // Do the actual subtraction
     pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT");
-    outRO->image = (psImage*)psBinaryOp(outRO->image, minuend->image, "-", subtrahend->image);
+
+    if (addPair) {
+	outRO->image = (psImage*)psBinaryOp(outRO->image, minuend->image, "+", subtrahend->image);
+    } else {
+	outRO->image = (psImage*)psBinaryOp(outRO->image, minuend->image, "-", subtrahend->image);
+    }
     outRO->mask = (psImage*)psBinaryOp(outRO->mask, minuend->mask, "|", subtrahend->mask);
     outRO->variance = (psImage*)psBinaryOp(outRO->variance, minuend->variance, "+", subtrahend->variance);
@@ -70,4 +76,9 @@
     psFree(rng);
 
+    // XXX EAM : I suspect that the weighted averaging is giving the wrong answer for
+    // single-direction PSF matching (and maybe DUAL as well).  I am testing the difference by
+    // generating A+B images instead of A-B images and then checking the significance of the
+    // sources in the image
+
     // Combine the covariances
     // These are weighted by the appropriate mean variance.  This is probably not perfectly correct, but it
@@ -79,5 +90,9 @@
     covarWeights->data.F32[0] = minuendVar;
     covarWeights->data.F32[1] = subtrahendVar;
+# if (0)    
     outRO->covariance = psImageCovarianceAverageWeighted(covars, covarWeights);
+# else
+    outRO->covariance = psImageCovarianceAverage(covars);
+# endif
     psFree(covars);
     psFree(covarWeights);
@@ -109,4 +124,5 @@
     pmChip *outChip = pmFPAfileThisChip(config->files, view, "PPSUB.OUTPUT"); // Output chip
     psFree(view);
+
     if (!outHDU || !inHDU) {
         psError(PPSUB_ERR_PROG, true, "Unable to find HDU at FPA level to copy astrometry.");
