Index: trunk/psModules/src/imcombine/pmPSFEnvelope.c
===================================================================
--- trunk/psModules/src/imcombine/pmPSFEnvelope.c	(revision 21183)
+++ trunk/psModules/src/imcombine/pmPSFEnvelope.c	(revision 21363)
@@ -36,6 +36,6 @@
 #define PEAK_FLUX 1.0e4                 // Peak flux for each source
 #define SKY_VALUE 0.0e0                 // Sky value for fake image
-#define WEIGHT_VAL 3.0                  // Weighting for image
-#define WEIGHT_FACTOR 10.0              // Factor to multiply image by to get weighting
+#define VARIANCE_VAL 3.0                // Variance for image
+#define VARIANCE_FACTOR 10.0            // Factor to multiply image by to get variance
 #define PSF_STATS PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV // Statistics options for measuring PSF
 #define SOURCE_FIT_ITERATIONS 100       // Number of iterations for source fitting
@@ -149,5 +149,5 @@
             pmModel *model = pmModelFromPSFforXY(psf, x, y, PEAK_FLUX); // Model for source
             psAssert (model, "failed to generate model: should this be an error or not?");
-            float srcRadius = model->modelRadius(model->params, PS_SQR(WEIGHT_VAL)); // Radius for source
+            float srcRadius = model->modelRadius(model->params, PS_SQR(VARIANCE_VAL)); // Radius for source
             if (srcRadius > maxRadius) {
                 maxRadius = srcRadius;
@@ -216,11 +216,12 @@
     psFree(envelope);
 
-    // XXX Setting the weight seems to be an art
+    // XXX Setting the variance seems to be an art
     // Can't set it too high so that pixels are rejected as insignificant
     // Can't set it too low so that it's hard to get to the minimum
     // Have also tried:
-    // *** readout->weight = (psImage*)psBinaryOp(NULL, readout->image, "*", readout->image);
-    // *** readout->weight = (psImage*)psBinaryOp(NULL, readout->image, "*", psScalarAlloc(WEIGHT_FACTOR, PS_TYPE_F32));
-    readout->weight = (psImage*)psBinaryOp(NULL, readout->image, "+", psScalarAlloc(WEIGHT_VAL, PS_TYPE_F32));
+    // *** readout->variance = (psImage*)psBinaryOp(NULL, readout->image, "*", readout->image);
+    // *** readout->variance = (psImage*)psBinaryOp(NULL, readout->image, "*", psScalarAlloc(VARIANCE_FACTOR, PS_TYPE_F32));
+    readout->variance = (psImage*)psBinaryOp(NULL, readout->image, "+",
+                                             psScalarAlloc(VARIANCE_VAL, PS_TYPE_F32));
     readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);
     psImageInit(readout->mask, 0);
@@ -242,9 +243,9 @@
 
         psFree(source->pixels);
-        psFree(source->weight);
+        psFree(source->variance);
         psFree(source->maskView);
         psFree(source->maskObj);
         source->pixels = NULL;
-        source->weight = NULL;
+        source->variance = NULL;
         source->maskView = NULL;
         source->maskObj = NULL;
@@ -280,5 +281,5 @@
     options->psfFieldYo = 0;
 
-    pmSourceFitModelInit(SOURCE_FIT_ITERATIONS, 0.01, WEIGHT_VAL, true);
+    pmSourceFitModelInit(SOURCE_FIT_ITERATIONS, 0.01, VARIANCE_VAL, true);
 
     pmPSFtry *try = pmPSFtryModel(fakes, modelName, options, 0, 0xff);
