Index: /branches/eam_branches/20091201/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c
===================================================================
--- /branches/eam_branches/20091201/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c	(revision 26316)
+++ /branches/eam_branches/20091201/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c	(revision 26317)
@@ -304,4 +304,5 @@
         source->peak->dx   = dPAR[PM_PAR_XPOS];
         source->peak->dy   = dPAR[PM_PAR_YPOS];
+        source->peak->SN   = sqrt(source->peak->flux); // XXX a proxy: various functions sort by peak S/N
 
         source->pixWeight = psMetadataLookupF32 (&status, row, "PSF_QF");
Index: /branches/eam_branches/20091201/psphot/src/psphot.h
===================================================================
--- /branches/eam_branches/20091201/psphot/src/psphot.h	(revision 26316)
+++ /branches/eam_branches/20091201/psphot/src/psphot.h	(revision 26317)
@@ -182,5 +182,5 @@
 bool psphotVisualShowImage (pmReadout *readout);
 bool psphotVisualShowBackground (pmConfig *config, const pmFPAview *view, pmReadout *readout);
-bool psphotVisualShowSignificance (psImage *image);
+bool psphotVisualShowSignificance (psImage *image, float min, float max);
 bool psphotVisualShowPeaks (pmDetections *detections);
 bool psphotVisualShowFootprints (pmDetections *detections);
Index: /branches/eam_branches/20091201/psphot/src/psphotFindDetections.c
===================================================================
--- /branches/eam_branches/20091201/psphot/src/psphotFindDetections.c	(revision 26316)
+++ /branches/eam_branches/20091201/psphot/src/psphotFindDetections.c	(revision 26317)
@@ -39,6 +39,13 @@
     psImage *significance = psphotSignificanceImage (readout, recipe, pass, maskVal);
 
-    // display the backsub and backgnd images
-    psphotVisualShowSignificance (significance);
+    // display the significance image
+    psphotVisualShowSignificance (significance, -1.0, 25.0*25.0);
+
+    // XXX getting some strange results from significance image
+    {
+	psImage *lsig = (psImage *) psUnaryOp (NULL, significance, "log");
+	psphotVisualShowSignificance (lsig, 0.0, 4.0);
+	psFree (lsig);
+    }	
 
     // detect the peaks in the significance image
Index: /branches/eam_branches/20091201/psphot/src/psphotMergeSources.c
===================================================================
--- /branches/eam_branches/20091201/psphot/src/psphotMergeSources.c	(revision 26316)
+++ /branches/eam_branches/20091201/psphot/src/psphotMergeSources.c	(revision 26317)
@@ -124,4 +124,10 @@
         }
 
+	// use the existing peak information, otherwise generate a new peak
+	if (source->peak) {
+	    psArrayAdd (detections->peaks, 100, source->peak);
+	    continue;
+	}
+
         float flux = powf(10.0, -0.4 * source->psfMag);
         float xpos = model->params->data.F32[PM_PAR_XPOS];
Index: /branches/eam_branches/20091201/psphot/src/psphotSourceStats.c
===================================================================
--- /branches/eam_branches/20091201/psphot/src/psphotSourceStats.c	(revision 26316)
+++ /branches/eam_branches/20091201/psphot/src/psphotSourceStats.c	(revision 26317)
@@ -418,5 +418,5 @@
         psMetadataAddF32 (regionMD, PS_LIST_TAIL, "PSF.CLUMP.DY", PS_META_REPLACE, "psf clump center", psfClump.dY);
 
-        // psphotVisualPlotMoments (recipe, sources);
+        psphotVisualPlotMoments (recipe, analysis, sources);
 
         Sout[i] = sqrt(0.5*(psfClump.X + psfClump.Y)) / sigma[i];
Index: /branches/eam_branches/20091201/psphot/src/psphotVisual.c
===================================================================
--- /branches/eam_branches/20091201/psphot/src/psphotVisual.c	(revision 26316)
+++ /branches/eam_branches/20091201/psphot/src/psphotVisual.c	(revision 26317)
@@ -171,5 +171,5 @@
     if (kapa == -1) return false;
 
-    // psphotVisualShowMask (kapa, readout->mask, "mask", 2);
+    psphotVisualShowMask (kapa, readout->mask, "mask", 2);
     psphotVisualScaleImage (kapa, readout->variance, readout->mask, "variance", 1);
     psphotVisualScaleImage (kapa, readout->image, readout->mask, "image", 0);
@@ -204,5 +204,5 @@
 }
 
-bool psphotVisualShowSignificance (psImage *image) {
+bool psphotVisualShowSignificance (psImage *image, float min, float max) {
 
     if (!pmVisualIsVisual()) return true;
@@ -211,5 +211,5 @@
     if (kapa == -1) return false;
 
-    psphotVisualRangeImage (kapa, image, "signif", 2, -1.0, 25.0*25.0);
+    psphotVisualRangeImage (kapa, image, "signif", 2, min, max);
 
     pmVisualAskUser(NULL);
