Index: /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertGalaxies.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertGalaxies.c	(revision 34056)
+++ /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertGalaxies.c	(revision 34057)
@@ -2,4 +2,7 @@
 static char *defaultModel = "PS_MODEL_SERSIC";
 
+// this is used to measure the inserted flux as a difference of 2 large numbers : must use
+// 'double' or we get floating point errors and trends on a scale of ~0.005 mags at > -10 mags
+// instrumental
 double imageSum (psImage *image) {
     double sum = 0.0;
@@ -165,7 +168,7 @@
 	
 	// 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);
 	float flux = sum2 - sum1;
 
Index: /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertStars.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertStars.c	(revision 34056)
+++ /branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertStars.c	(revision 34057)
@@ -6,5 +6,5 @@
     PTR = NULL;
 
-float imageSum (psImage *image);
+double imageSum (psImage *image);
 
 bool ppSimInsertStars (pmReadout *readout, psImage *expCorr, psArray *stars, pmConfig *config) {
@@ -111,5 +111,5 @@
 
 	// XXX test:
-	flux = star->flux * expCorr->data.F32[0][0];
+	// flux = star->flux * expCorr->data.F32[0][0];
 
 	// instantiate a model for the PSF at this location, set desired flux
@@ -145,5 +145,7 @@
 	    readout->image->data.F32[(int)(yCell)][(int)(xCell)] += flux;
 	} else {
-	    // insert the source flux in the image
+	    // insert the source flux in the image and measure inserted flux
+	    // this is a difference of 2 large numbers : must use 'double' or we get floating
+	    // point errors and trends on a scale of ~0.005 mags at > -10 mags instrumental
 	    double sum1 = imageSum(source->pixels);
 	    pmSourceAddWithOffset (source, PM_MODEL_OP_FULL, 0xff, dX, dY);
