Index: /trunk/psModules/src/imcombine/pmPSFEnvelope.c
===================================================================
--- /trunk/psModules/src/imcombine/pmPSFEnvelope.c	(revision 18491)
+++ /trunk/psModules/src/imcombine/pmPSFEnvelope.c	(revision 18492)
@@ -34,5 +34,6 @@
 #define PEAK_FLUX 1.0e4                 // Peak flux for each source
 #define SKY_VALUE 0.0e0                 // Sky value for fake image
-#define WEIGHT_VAL 1.0                  // Weighting for image
+#define WEIGHT_VAL 10.0                 // Weighting for image
+#define WEIGHT_FACTOR 10.0              // Factor to multiply image by to get weighting
 #define PSF_STATS PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV // Statistics options for measuring PSF
 
@@ -199,6 +200,11 @@
     psFree(envelope);
 
-    // XXX This seems the best way to set the weight image so that pixels aren't rejected as "insignificant"
-    readout->weight = (psImage*)psBinaryOp(NULL, readout->image, "*", readout->image);
+    // XXX Setting the weight 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(PS_SQR(WEIGHT_VAL), PS_TYPE_F32));
     readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_MASK);
     psImageInit(readout->mask, 0);
@@ -258,5 +264,5 @@
     options->psfFieldYo = 0;
 
-    pmSourceFitModelInit (15, 0.01, WEIGHT_VAL, options->poissonErrorsPhotLMM);
+    pmSourceFitModelInit(50, 0.01, WEIGHT_VAL, false);
 
     pmPSFtry *try = pmPSFtryModel(fakes, modelName, options, 0, 0xff);
