Index: /trunk/ppStack/src/ppStackArguments.c
===================================================================
--- /trunk/ppStack/src/ppStackArguments.c	(revision 20493)
+++ /trunk/ppStack/src/ppStackArguments.c	(revision 20494)
@@ -137,5 +137,4 @@
         psArgumentRemove(argNum, &argc, argv);
     }
-
 
 
@@ -172,5 +171,6 @@
     psMetadataAddStr(arguments, PS_LIST_TAIL, "-renorm-stdev", 0,
                      "Statistic for stdev in renormalisation", NULL);
-    psMetadataAddS32(arguments, PS_LIST_TAIL, "-renorm-width", 0, "Width of renormalisation boxes", 0);
+    psMetadataAddF32(arguments, PS_LIST_TAIL, "-renorm-width", 0, "Gaussian width for renormalisation", NAN);
+    psMetadataAddS32(arguments, PS_LIST_TAIL, "-renorm-num", 0, "Number of samples for renormalisation", 0);
     psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-image", 0, "Suffix for temporary images", NULL);
     psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-mask", 0, "Suffix for temporary masks", NULL);
@@ -179,4 +179,5 @@
                       "Delete temporary files on completion?", false);
     psMetadataAddS32(arguments, PS_LIST_TAIL, "-threads", 0, "Number of threads to use", 0);
+    psMetadataAddBool(arguments, PS_LIST_TAIL, "-psphot-visual", 0, "psphot visualisation", 0);
 
     if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 3) {
@@ -265,5 +266,6 @@
         psMetadataAddBool(arguments, PS_LIST_TAIL, "RENORM", 0, "Renormalise variance maps?", true);
     }
-    VALUE_ARG_RECIPE_INT("-renorm-width", "RENORM.WIDTH", S32, 0);
+    VALUE_ARG_RECIPE_INT("-renorm-num", "RENORM.NUM", S32, 0);
+    VALUE_ARG_RECIPE_FLOAT("-renorm-width", "RENORM.WIDTH", F32);
     valueArgRecipeStr(arguments, recipe, "-renorm-mean", "RENORM.MEAN", recipe);
     valueArgRecipeStr(arguments, recipe, "-renorm-stdev", "RENORM.STDEV", recipe);
Index: /trunk/ppStack/src/ppStackLoop.c
===================================================================
--- /trunk/ppStack/src/ppStackLoop.c	(revision 20493)
+++ /trunk/ppStack/src/ppStackLoop.c	(revision 20494)
@@ -1022,4 +1022,21 @@
     }
 
+    if (psMetadataLookupBool(&mdok, recipe, "RENORM")) {
+        // Statistics for renormalisation
+        psStatsOptions renormMean = psStatsOptionFromString(psMetadataLookupStr(&mdok, recipe,
+                                                                                "RENORM.MEAN"));
+        psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(&mdok, recipe,
+                                                                                 "RENORM.STDEV"));
+        int renormNum = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); // Number of samples
+        float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot
+        psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
+        if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth,
+                                       renormMean, renormStdev, NULL)) {
+            psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances.");
+            psFree(outRO);
+            return false;
+        }
+    }
+
     if (psMetadataLookupBool(&mdok, recipe, "PHOTOMETRY")) {
         psTrace("ppStack", 1, "Photometering stacked image....\n");
Index: /trunk/ppStack/src/ppStackMatch.c
===================================================================
--- /trunk/ppStack/src/ppStackMatch.c	(revision 20493)
+++ /trunk/ppStack/src/ppStackMatch.c	(revision 20494)
@@ -17,6 +17,4 @@
 
 //#define TESTING                         // Enable debugging output
-
-
 
 #ifdef TESTING
@@ -339,5 +337,5 @@
     assert((*regions)->n == (*kernels)->n);
 
-    // Correct the variance for the chi^2
+    // Record chi^2
     {
         *chi2 = 0.0;
@@ -358,5 +356,4 @@
         float vf = psMetadataLookupF32(NULL, readout->parent->concepts, "CELL.VARFACTOR"); // Variance factor
         *chi2 /= vf * num;
-        psLogMsg("ppStack", PS_LOG_INFO, "Additional variance from chi^2: %f", *chi2);
     }
 
@@ -368,8 +365,6 @@
         psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(&mdok, recipe,
                                                                                  "RENORM.STDEV"));
-        int renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width for renormalisation box
-
-        psLogMsg("ppStack", PS_LOG_INFO, "Renormalising variance map.");
-        if (!pmReadoutWeightRenorm(readout, maskBad, renormMean, renormStdev, renormWidth, rng)) {
+
+        if (!pmReadoutWeightRenormPixels(readout, maskBad, renormMean, renormStdev, rng)) {
             psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances.");
             psFree(output);
