Index: /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertGalaxies.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertGalaxies.c	(revision 34053)
+++ /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertGalaxies.c	(revision 34054)
@@ -2,6 +2,6 @@
 static char *defaultModel = "PS_MODEL_SERSIC";
 
-float imageSum (psImage *image) {
-    float sum = 0.0;
+double imageSum (psImage *image) {
+    double sum = 0.0;
     for (int iy = 0; iy < image->numRows; iy++) {
 	for (int ix = 0; ix < image->numCols; ix++) {
Index: /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertStars.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertStars.c	(revision 34053)
+++ /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertStars.c	(revision 34054)
@@ -79,4 +79,6 @@
     FILE *outfile = fopen (outname, "w");
 
+    float radius = -1.0;
+
     // add sources to the readout image & variance
     psTrace("ppSim", 1, "Inserting %ld stars...\n", stars->n);
@@ -90,4 +92,6 @@
         float xChip = PM_FPA_TO_CHIP(star->x, x0Chip, xParityChip);
         float yChip = PM_FPA_TO_CHIP(star->y, y0Chip, yParityChip);
+	xChip = (int) xChip;
+	yChip = (int) yChip;
 
         // Position on the cell and peak flux
@@ -106,11 +110,16 @@
         float flux = star->flux * expCorr->data.F32[(int)yCell][(int)xCell];
 
+	// XXX test:
+	flux = star->flux * expCorr->data.F32[0][0];
+
 	// instantiate a model for the PSF at this location, set desired flux
 	pmModel *model = pmModelFromPSFforXY (psf, xChip, yChip, 1.0);
 	pmModelSetFlux (model, flux);
 
-	float radius = model->modelRadius (model->params, nSigmaLim * roughNoise);
-	radius = PS_MAX (radius, 1.0);
-	radius = 20.0;
+	// we will set the radius on the first object, and leave it there for everyone else
+	if (radius < 0) {
+	  radius = model->modelRadius (model->params, nSigmaLim * roughNoise);
+	  radius = PS_MIN (radius, 50.0);
+	}
 
 	// construct a source, with model flux pixels set, based on the model
@@ -137,7 +146,7 @@
 	} else {
 	    // insert the source flux in the image
-	    float sum1 = imageSum(source->pixels);
+	    double sum1 = imageSum(source->pixels);
 	    pmSourceAddWithOffset (source, PM_MODEL_OP_FULL, 0xff, dX, dY);
-	    float sum2 = imageSum(source->pixels);
+	    double sum2 = imageSum(source->pixels);
 	    starFlux = sum2 - sum1;
 	    
@@ -154,5 +163,5 @@
 	    RESET(source->blends);
 	}
-	fprintf (outfile, "%8.3f %8.3f %10.2f  %2d  %7.3f %5.3f  %5.3f %5.3f %5.3f %5.3f  :  %f %f\n", star->x, star->y, starFlux, 0, source->psfMag, source->psfMagErr, axes.major, axes.minor, axes.theta, par8, model->params->data.F32[PM_PAR_I0], radius);
+	fprintf (outfile, "%8.3f %8.3f %10.5f  %2d  %7.3f %5.3f  %5.3f %5.3f %5.3f %5.3f  :  %f %f\n", star->x, star->y, starFlux, 0, source->psfMag, source->psfMagErr, axes.major, axes.minor, axes.theta, par8, model->params->data.F32[PM_PAR_I0], radius);
 
 	// add the sources to the source array
