Index: branches/simmosaic_branches/psphot/src/psphotFindPeaks.c
===================================================================
--- branches/simmosaic_branches/psphot/src/psphotFindPeaks.c	(revision 24860)
+++ branches/simmosaic_branches/psphot/src/psphotFindPeaks.c	(revision 27839)
@@ -13,10 +13,15 @@
     psArray *peaks = pmPeaksInImage (significance, threshold);
     if (peaks == NULL) {
-	// XXX should we be sending back an empty array instead of NULL?
-        // XXX this may also be due to a programming or config error
+	// we only get a NULL peaks array due to a programming or config error. 
+	// this will result in a failure.
+        psError(PSPHOT_ERR_DATA, false, "no peaks found in this image");
+        return NULL;
+    }
+
+    if (peaks->n == 0) {
         // XXX do we need to set something in the readout->analysis to indicate that
         // we tried and failed to find peaks (something in the header data)
-        psError(PSPHOT_ERR_DATA, false, "no peaks found in this image");
-        return false;
+	psLogMsg ("psphot", PS_LOG_INFO, "no peaks found in this image");
+	return peaks;
     }
 
@@ -31,4 +36,10 @@
         peak->SN = sqrt(peak->value);
         peak->flux = readout->image->data.F32[peak->y-row0][peak->x-col0];
+	// if (peak->flux / peak->value > 5.0/12.0) {
+	//     psWarning ("odd peak levels (1)");
+	// }
+	// if (peak->value / peak->flux > 5*12.0) {
+	//     psWarning ("odd peak levels (2)");
+	// }
 	if (readout->variance && isfinite (peak->dx)) {
 	    peak->dx *= sqrt(readout->variance->data.F32[peak->y-row0][peak->x-col0]);
