Index: /trunk/ppStack/src/ppStackCamera.c
===================================================================
--- /trunk/ppStack/src/ppStackCamera.c	(revision 20709)
+++ /trunk/ppStack/src/ppStackCamera.c	(revision 20710)
@@ -101,10 +101,4 @@
         psString psf = psMetadataLookupStr(&mdok, input, "PSF"); // Name of PSF
         psString sources = psMetadataLookupStr(&mdok, input, "SOURCES"); // Name of sources
-
-        float weighting = psMetadataLookupF32(&mdok, input, "WEIGHTING"); // Relative weighting
-        if (!mdok || isnan(weighting) || weighting == 0.0) {
-            psWarning("Component %s lacks WEIGHTING of type F32 --- assuming 1.0", item->name);
-            weighting = 1.0;
-        }
 
         // Add the image file
@@ -258,7 +252,4 @@
 #endif
 
-        psMetadataAddF32(imageFile->fpa->analysis, PS_LIST_TAIL, "PPSTACK.WEIGHTING", 0,
-                         "Relative weighting for image", weighting);
-
         i++;
     }
Index: /trunk/ppStack/src/ppStackMatch.c
===================================================================
--- /trunk/ppStack/src/ppStackMatch.c	(revision 20709)
+++ /trunk/ppStack/src/ppStackMatch.c	(revision 20710)
@@ -384,4 +384,7 @@
         (void)psBinaryOp(readout->image, readout->image, "+",
                          psScalarAlloc(- psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32));
+        psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "PPSTACK.WEIGHTING", 0,
+                         "Weighting by 1/noise^2 for stack",
+                         1.0 / PS_SQR(psStatsGetValue(bg, PS_STAT_ROBUST_STDEV)));
     }
     psFree(bg);
Index: /trunk/ppStack/src/ppStackReadout.c
===================================================================
--- /trunk/ppStack/src/ppStackReadout.c	(revision 20709)
+++ /trunk/ppStack/src/ppStackReadout.c	(revision 20710)
@@ -117,10 +117,11 @@
             continue;
         }
-        pmFPA *fpa = ro->parent->parent->parent; // Parent FPA
-
-        float weighting = psMetadataLookupF32(&mdok, fpa->analysis, "PPSTACK.WEIGHTING"); // Relative weight
+
+        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);
+            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);
         }
 
@@ -210,8 +211,7 @@
         pmReadout *ro = readouts->data[i];
         assert(ro);
-        pmFPA *fpa = ro->parent->parent->parent; // Parent FPA
 
         bool mdok;                      // Status of MD lookup
-        float weighting = psMetadataLookupF32(&mdok, fpa->analysis, "PPSTACK.WEIGHTING"); // Relative weight
+        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);
