Index: branches/eam_branches/ipp-20110213/ppSim/src/Makefile.am
===================================================================
--- branches/eam_branches/ipp-20110213/ppSim/src/Makefile.am	(revision 30976)
+++ branches/eam_branches/ipp-20110213/ppSim/src/Makefile.am	(revision 30977)
@@ -48,5 +48,4 @@
 	ppSimLoop.c		  \
 	ppSimMergeReadouts.c	  \
-	ppSimDetections.c	  \
 	ppSimMergeSources.c	  \
 	ppSimMosaicChip.c	  \
Index: branches/eam_branches/ipp-20110213/ppSim/src/ppSimDetectionLimits.c
===================================================================
--- branches/eam_branches/ipp-20110213/ppSim/src/ppSimDetectionLimits.c	(revision 30976)
+++ branches/eam_branches/ipp-20110213/ppSim/src/ppSimDetectionLimits.c	(revision 30977)
@@ -3,4 +3,5 @@
 // compare injected sources (PPSIM.SOURCES) and measured fake sources (PPSIM.FAKE.SOURCES) 
 // to determine detection limits and recovered magnitude errors
+// XXX this function is not used
 bool ppSimDetectionLimits (pmConfig *config, pmFPAview *view) {
 
Index: branches/eam_branches/ipp-20110213/ppSim/src/ppSimDetections.c
===================================================================
--- branches/eam_branches/ipp-20110213/ppSim/src/ppSimDetections.c	(revision 30976)
+++ branches/eam_branches/ipp-20110213/ppSim/src/ppSimDetections.c	(revision 30977)
@@ -1,4 +1,5 @@
 # include "ppSim.h"
 
+// XXX this function is not used
 bool ppSimDetections (psImage *significance, psMetadata *recipe, psArray *sources) {
     psAssert (sources, "programming error: ppSimDetections passed NULL sources");
@@ -12,5 +13,5 @@
     float SIGMA_SMTH  = psMetadataLookupF32 (&status, recipe, "SIGMA_SMOOTH"); 
     psAssert (status, "SIGMA_SMOOTH missing: call psphotSignificanceImage first"); 
-    float effArea = 4.0*M_PI*PS_SQR(SIGMA_SMTH);
+    // float effArea = 4.0*M_PI*PS_SQR(SIGMA_SMTH);
 
     int row0 = significance->row0;
@@ -23,7 +24,5 @@
 	psAssert (peak, "peak is not defined for the source");
 
-	peak->value = significance->data.F32[peak->y-row0][peak->x-col0];
-	peak->SN = sqrt(peak->value*effArea);
-
+	peak->detValue = significance->data.F32[peak->y-row0][peak->x-col0];
     }
     return true;
Index: branches/eam_branches/ipp-20110213/ppSub/src/ppSubFlagNeighbors.c
===================================================================
--- branches/eam_branches/ipp-20110213/ppSub/src/ppSubFlagNeighbors.c	(revision 30976)
+++ branches/eam_branches/ipp-20110213/ppSub/src/ppSubFlagNeighbors.c	(revision 30977)
@@ -191,6 +191,6 @@
         if (!isfinite(src->peak->xf)) NEXT1; 
         if (!isfinite(src->peak->yf)) NEXT1; 
-        if (!isfinite(src->peak->SN)) NEXT1; 
-        if (src->peak->SN < MIN_SN) NEXT1; 
+        if (!isfinite(src->peak->detValue)) NEXT1; 
+        if (sqrt(src->peak->detValue) < MIN_SN) NEXT1; 
  
         if (!obj) NEXT2; 
@@ -213,6 +213,6 @@
 	    if (!isfinite(src->peak->xf)) NEXT1; 
 	    if (!isfinite(src->peak->yf)) NEXT1; 
-	    if (!isfinite(src->peak->SN)) NEXT1; 
-	    if (src->peak->SN < MIN_SN) NEXT1; 
+	    if (!isfinite(src->peak->detValue)) NEXT1; 
+	    if (sqrt(src->peak->detValue) < MIN_SN) NEXT1; 
 
 	    dx = src->peak->xf - obj->x; 
@@ -235,5 +235,5 @@
 	src = sources->data[Imin]; 
 
-	// fprintf (stderr, "j: %d, Imin: %d, obj x,y: %f, %f  src x,y: %f, %f, SN: %f, ID: %d\n", j, Imin, obj->x, obj->y, src->peak->xf, src->peak->yf, src->peak->SN, src->id);
+	// fprintf (stderr, "j: %d, Imin: %d, obj x,y: %f, %f  src x,y: %f, %f, SN: %f, ID: %d\n", j, Imin, obj->x, obj->y, src->peak->xf, src->peak->yf, sqrt(src->peak->detValue), src->id);
 
 	// add source to object
Index: branches/eam_branches/ipp-20110213/ppSub/src/ppSubMakePSF.c
===================================================================
--- branches/eam_branches/ipp-20110213/ppSub/src/ppSubMakePSF.c	(revision 30976)
+++ branches/eam_branches/ipp-20110213/ppSub/src/ppSubMakePSF.c	(revision 30977)
@@ -158,5 +158,5 @@
 psArray *ppSubSelectPSFSources(psArray *sources){
 
-    sources = psArraySort (sources, pmSourceSortBySN);
+    sources = psArraySort (sources, pmSourceSortByFlux);
 
     psArray *subset = psArrayAllocEmpty(MAX_NPSF);
Index: branches/eam_branches/ipp-20110213/psastro/src/psastroConvert.c
===================================================================
--- branches/eam_branches/ipp-20110213/psastro/src/psastroConvert.c	(revision 30976)
+++ branches/eam_branches/ipp-20110213/psastro/src/psastroConvert.c	(revision 30977)
@@ -58,5 +58,5 @@
     // sort in ascending magnitude order
     // psArraySort (inStars, psastroSortByMag);
-    // psVector *index = psArraySortIndex (sources, pmSourceSortBySN);
+    // psVector *index = psArraySortIndex (sources, pmSourceSortByFlux);
     psVector *index = psArraySortIndex (NULL, inStars, psastroSortByMag);
 
Index: branches/eam_branches/ipp-20110213/pswarp/src/pswarpTransformSources.c
===================================================================
--- branches/eam_branches/ipp-20110213/pswarp/src/pswarpTransformSources.c	(revision 30976)
+++ branches/eam_branches/ipp-20110213/pswarp/src/pswarpTransformSources.c	(revision 30977)
@@ -94,6 +94,7 @@
         // relative flux) that's OK.
         pmSource *new = pmSourceAlloc(); ///< New source
-        new->peak = pmPeakAlloc(xOut, yOut, source->peak->flux, PM_PEAK_LONE);
-        new->peak->flux = source->peak->flux;
+        new->peak = pmPeakAlloc(xOut, yOut, source->peak->detValue, PM_PEAK_LONE);
+        new->peak->rawFlux = source->peak->rawFlux;
+        new->peak->smoothFlux = source->peak->smoothFlux;
         new->type = source->type;
         new->mode = source->mode;
