Index: trunk/psphot/src/psphotSignificanceImage.c
===================================================================
--- trunk/psphot/src/psphotSignificanceImage.c	(revision 21183)
+++ trunk/psphot/src/psphotSignificanceImage.c	(revision 21366)
@@ -1,5 +1,5 @@
 # include "psphotInternal.h"
 
-// In this function, we smooth the image and weight, then generate the significance image :
+// In this function, we smooth the image and variance, then generate the significance image :
 // (S/N)^2.  If FWMH_X,Y have been recorded, use them, otherwise use PEAKS_SMOOTH_SIGMA for the
 // smoothing kernel.
@@ -10,5 +10,5 @@
     bool guess = false;
 
-    // smooth the image and weight map
+    // smooth the image and variance map
     psTimerStart ("psphot.smooth");
     bool oldThreads = psImageConvolveSetThreads(true); // Old value of threading in psImageConvolve
@@ -48,5 +48,5 @@
     psLogMsg("psphot", PS_LOG_MINUTIA, "smooth image: %f sec\n", psTimerMark("psphot.smooth"));
 
-    // Smooth the weight, applying the mask as we go.  The variance is smoothed by the PSF^2,
+    // Smooth the variance, applying the mask as we go.  The variance is smoothed by the PSF^2,
     // renomalized to maintain the input level of the variance.  We achieve this by smoothing
     // with a Gaussian with sigma = SIGMA_SMTH/sqrt(2) with unity normalization.  Note that
@@ -55,8 +55,8 @@
     // measurements based on apertures comparable to or larger than the smoothing kernel, the
     // effective per-pixel variance is maintained.
-    psImage *smooth_wt = psImageCopy(NULL, readout->weight, PS_TYPE_F32);
+    psImage *smooth_wt = psImageCopy(NULL, readout->variance, PS_TYPE_F32);
     psImageSmoothMask_Threaded(smooth_wt, smooth_wt, readout->mask, maskVal, SIGMA_SMTH * M_SQRT1_2,
                       NSIGMA_SMTH, minGauss);
-    psLogMsg("psphot", PS_LOG_MINUTIA, "smooth weight: %f sec\n", psTimerMark("psphot.smooth"));
+    psLogMsg("psphot", PS_LOG_MINUTIA, "smooth variance: %f sec\n", psTimerMark("psphot.smooth"));
 
     psImage *mask = readout->mask;
@@ -100,4 +100,12 @@
 
     float factor = guess ? 4.0 * M_PI * PS_SQR(SIGMA_SMTH) : 4.0 * M_PI * PS_SQR(SIGMA_SMTH);
+
+    // Correct the correction factor for the covariance produced by the (potentially multiple) smoothing
+    psKernel *kernel = psImageSmoothKernel(SIGMA_SMTH, NSIGMA_SMTH); // Kernel used for smoothing
+    psKernel *covar = psImageCovarianceCalculate(kernel, readout->covariance); // Covariance matrix
+    psFree(kernel);
+    factor /= psImageCovarianceFactor(covar);
+    psFree(covar);
+
     // record the effective area and significance scaling factor
     float effArea = 8.0 * M_PI * PS_SQR(SIGMA_SMTH);
