Index: trunk/ppStack/src/ppStackLoop.c
===================================================================
--- trunk/ppStack/src/ppStackLoop.c	(revision 20659)
+++ trunk/ppStack/src/ppStackLoop.c	(revision 20711)
@@ -444,4 +444,6 @@
     psVector *matchChi2 = psVectorAlloc(num, PS_TYPE_F32); // chi^2 for stamps when matching
     psVectorInit(matchChi2, NAN);
+    psVector *weightings = psVectorAlloc(num, PS_TYPE_F32); // Combination weightings for images (1/noise^2)
+    psVectorInit(weightings, NAN);
     for (int i = 0; i < num; i++) {
         psTrace("ppStack", 2, "Convolving input %d of %d to target PSF....\n", i, num);
@@ -482,5 +484,5 @@
         psArray *sources = haveSources ? globalSources : indSources->data[i]; // Sources for matching
         psTimerStart("PPSTACK_MATCH");
-        if (!ppStackMatch(readout, &regions, &kernels, &matchChi2->data.F32[i],
+        if (!ppStackMatch(readout, &regions, &kernels, &matchChi2->data.F32[i], &weightings->data.F32[i],
                           sources, targetPSF, rng, config)) {
             psErrorStackPrint(stderr, "Unable to match image %d --- ignoring.", i);
@@ -718,4 +720,5 @@
             psArrayAdd(job->args, 1, subRegions);
             psArrayAdd(job->args, 1, subKernels);
+            psArrayAdd(job->args, 1, weightings);
             psArrayAdd(job->args, 1, matchChi2);
             if (!psThreadJobAddPending(job)) {
@@ -725,4 +728,5 @@
                 psFree(stack);
                 psFree(inputMask);
+                psFree(weightings);
                 psFree(matchChi2);
                 psFree(view);
@@ -961,4 +965,5 @@
             psArrayAdd(job->args, 1, outRO);
             psArrayAdd(job->args, 1, rejected);
+            psArrayAdd(job->args, 1, weightings);
             if (!psThreadJobAddPending(job)) {
                 psFree(job);
