Index: trunk/ippconfig/recipes/ppStack.config
===================================================================
--- trunk/ippconfig/recipes/ppStack.config	(revision 27104)
+++ trunk/ippconfig/recipes/ppStack.config	(revision 27105)
@@ -24,4 +24,5 @@
 VARIANCE	BOOL	TRUE		# Use variance in rejection?
 SAFE		BOOL	TRUE		# Play safe when combining small number of values?
+WEIGHTS		BOOL	TRUE		# Use 1/noise^2 weighting?
 BIN1		S32	4		# Binning factor for first level
 BIN2		S32	4		# Binning factor for second level
@@ -84,5 +85,6 @@
 # Faster processing for PR images
 PR	METADATA
-	IMAGE.REJ	    F32	  0.5	
+	IMAGE.REJ	    F32	  0.5
+	WEIGHTS		    BOOL  FALSE
 	CONVOLVE	    BOOL  FALSE
 	SKIP.BG.SUB	    BOOL  FALSE
Index: trunk/ppStack/src/ppStackMatch.c
===================================================================
--- trunk/ppStack/src/ppStackMatch.c	(revision 27104)
+++ trunk/ppStack/src/ppStackMatch.c	(revision 27105)
@@ -628,16 +628,18 @@
 
     // Measure the variance level for the weighting
-    if (!psImageBackground(bg, NULL, readout->variance, readout->mask, maskVal | maskBad, rng)) {
-        psError(PPSTACK_ERR_DATA, false, "Can't measure mean variance for image.");
-        psFree(rng);
-        psFree(bg);
-        return false;
-    }
-    options->weightings->data.F32[index] = 1.0 / (psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN) *
-                                                  psImageCovarianceFactor(readout->covariance));
+    if (psMetadataLookupBool(NULL, recipe, "WEIGHTS")) {
+        if (!psImageBackground(bg, NULL, readout->variance, readout->mask, maskVal | maskBad, rng)) {
+            psError(PPSTACK_ERR_DATA, false, "Can't measure mean variance for image.");
+            psFree(rng);
+            psFree(bg);
+            return false;
+        }
+        options->weightings->data.F32[index] = 1.0 / (psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN) *
+                                                      psImageCovarianceFactor(readout->covariance));
+    } else {
+        options->weightings->data.F32[index] = 1.0;
+    }
     psLogMsg("ppStack", PS_LOG_INFO, "Weighting for image %d is %f\n",
              index, options->weightings->data.F32[index]);
-    psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "PPSTACK.WEIGHTING", 0,
-                     "Weighting by 1/noise^2 for stack", options->weightings->data.F32[index]);
 
     psFree(rng);
Index: trunk/ppStack/src/ppStackReadout.c
===================================================================
--- trunk/ppStack/src/ppStackReadout.c	(revision 27104)
+++ trunk/ppStack/src/ppStackReadout.c	(revision 27105)
@@ -143,15 +143,4 @@
         }
 
-#if 0
-        // This doesn't seem to work, so getting the weightings directly from a vector
-        float weighting = psMetadataLookupF32(&mdok, ro->analysis, "PPSTACK.WEIGHTING"); // Relative weight
-        if (!mdok || !isfinite(weighting)) {
-            psWarning("No weighting supplied for image %d --- set to unity.", i);
-            weighting = 1.0;
-        } else {
-            psLogMsg("ppStack", PS_LOG_INFO, "Weighting for image %d is %f", i, weighting);
-        }
-#endif
-
         // Ensure there is a mask, or pmStackCombine will complain
         if (!ro->mask) {
@@ -243,14 +232,4 @@
         }
 
-#if 0
-        // This doesn't seem to work, so getting the weightings directly from a vector
-        bool mdok;                      // Status of MD lookup
-        float weighting = psMetadataLookupF32(&mdok, ro->analysis, "PPSTACK.WEIGHTING"); // Relative weight
-        if (!mdok || !isfinite(weighting)) {
-            psWarning("No WEIGHTING supplied for image %d --- set to unity.", i);
-            weighting = 1.0;
-        }
-#endif
-
         // Ensure there is a mask, or pmStackCombine will complain
         if (!ro->mask) {
