Index: trunk/ppSub/src/ppSubReadout.c
===================================================================
--- trunk/ppSub/src/ppSubReadout.c	(revision 20523)
+++ trunk/ppSub/src/ppSubReadout.c	(revision 20554)
@@ -118,4 +118,15 @@
     bool dual = psMetadataLookupBool(&mdok, recipe, "DUAL"); // Dual convolution?
 
+    // Statistics for renormalisation
+    psStatsOptions renormMean = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe, "RENORM.MEAN"));
+    psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe, "RENORM.STDEV"));
+    if (renormMean == PS_STAT_NONE || renormStdev == PS_STAT_NONE) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "Unable to parse renormalisation statistics from recipe.");
+        return false;
+    }
+    int renormNum = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); // Number of samples for renormalisation
+    float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot
+
     psString interpModeStr = psMetadataLookupStr(&mdok, recipe, "INTERPOLATION"); // Interpolation mode
     psImageInterpolateMode interpMode = psImageInterpolateModeFromString(interpModeStr); // Interp
@@ -356,17 +367,4 @@
 
         if (psMetadataLookupBool(&mdok, recipe, "RENORM")) {
-            // Statistics for renormalisation
-            psStatsOptions renormMean = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe,
-                                                                                    "RENORM.MEAN"));
-            psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe,
-                                                                                     "RENORM.STDEV"));
-            if (renormMean == PS_STAT_NONE || renormStdev == PS_STAT_NONE) {
-                psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                        "Unable to parse renormalisation statistics from recipe.");
-                psFree(outRO);
-                return false;
-            }
-            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,
@@ -439,10 +437,10 @@
     outRO->mask = (psImage*)psBinaryOp(outRO->mask, inConv->mask, "|", refConv->mask);
 
-    outRO->data_exists = outCell->data_exists = outCell->parent->data_exists = true;
-
-    pmReadoutMaskApply(outRO, maskBad);
-
     psFree(inConv);
     psFree(refConv);
+
+    outRO->data_exists = outCell->data_exists = outCell->parent->data_exists = true;
+
+    pmReadoutMaskApply(outRO, maskBad);
 
 #ifdef TESTING
@@ -460,27 +458,4 @@
         psFree(outRO);
         return false;
-    }
-
-    if (psMetadataLookupBool(&mdok, recipe, "RENORM")) {
-        // Statistics for renormalisation
-        psStatsOptions renormMean = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe,
-                                                                                "RENORM.MEAN"));
-        psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe,
-                                                                                 "RENORM.STDEV"));
-        if (renormMean == PS_STAT_NONE || renormStdev == PS_STAT_NONE) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                    "Unable to parse renormalisation statistics from recipe.");
-            psFree(outRO);
-            return false;
-        }
-        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;
-        }
     }
 
@@ -562,4 +537,14 @@
         }
 
+        if (psMetadataLookupBool(&mdok, recipe, "RENORM")) {
+            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;
+            }
+        }
+
         // Need to ensure aperture residual is not calculated
         psMetadata *psphotRecipe = psMetadataLookupMetadata(NULL, config->recipes, PSPHOT_RECIPE); // Recipe
@@ -636,4 +621,14 @@
     }
 
+    // Renormalising for pixels, because that's what magic desires
+    if (psMetadataLookupBool(&mdok, recipe, "RENORM")) {
+        psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
+        if (!pmReadoutWeightRenormPixels(outRO, maskValue, renormMean, renormStdev, NULL)) {
+            psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances.");
+            psFree(outRO);
+            return false;
+        }
+    }
+
     // Copy astrometry over
     pmFPA *refFPA = refRO->parent->parent->parent; // Reference FPA
