Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotEfficiency.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotEfficiency.c	(revision 30218)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotEfficiency.c	(revision 30219)
@@ -31,6 +31,15 @@
     assert(covarFactor);
 
+    // apply the amplitude of kernel^2 to the covarFactor (why?)
+    // XXX this is simply undoing the scale scalculate in psImageCovarianceCalculateFactor
+    // if this is the right solution, make this extra calculation optional (and explain...)
     psKernel *kernel = psImageSmoothKernel(smoothSigma, smoothNsigma); // Kernel used for smoothing
-    *covarFactor = psImageCovarianceCalculateFactor(kernel, ro->covariance);
+    double sum2 = 0.0;                                               // Sum of kernel squared
+    for (int y = kernel->yMin; y <= kernel->yMax; y++) {
+        for (int x = kernel->xMin; x <= kernel->xMax; x++) {
+            sum2 += PS_SQR(kernel->kernel[y][x]);
+        }
+    }
+    *covarFactor = sum2 * psImageCovarianceCalculateFactor(kernel, ro->covariance);
     psFree(kernel);
 
@@ -70,4 +79,5 @@
     float fluxLim = 2.0 * *norm * peakLim; // Limiting flux in original
     *magLim = -2.5 * log10f(fluxLim);
+    psTrace("psphot.fake", 1, "Covar Factor:  %f\n", *covarFactor);
     psTrace("psphot.fake", 1, "Limiting peak: %f\n", peakLim);
     psTrace("psphot.fake", 1, "Limiting flux: %f\n", fluxLim);
