Index: /trunk/psphot/src/psphotModelBackground.c
===================================================================
--- /trunk/psphot/src/psphotModelBackground.c	(revision 26451)
+++ /trunk/psphot/src/psphotModelBackground.c	(revision 26452)
@@ -146,4 +146,7 @@
     // XXXX we can thread this here by running blocks in parallel
 
+    int nFailures = 0;
+    psImageBackgroundInit();
+
     // measure clipped median for subimages
     psRegion ruffRegion = {0,0,0,0};
@@ -212,7 +215,10 @@
                 stats->options = PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV;
                 if (!psImageBackground(stats, &sample, subset, submask, maskVal, rng)) {
-                    psLogMsg ("psphot", PS_LOG_WARN, "Failed to estimate background using ROBUST_MEDIAN for "
-                               "(%dx%d, (row0,col0) = (%d,%d)",
-                               subset->numRows, subset->numCols, subset->row0, subset->col0);
+		    if ((nFailures < 3) || (nFailures % 100 == 0)) {
+			psLogMsg ("psphot", PS_LOG_WARN, "Failed to estimate background using ROBUST_MEDIAN for "
+				  "(%dx%d, (row0,col0) = (%d,%d)",
+				  subset->numRows, subset->numCols, subset->row0, subset->col0);
+		    }
+		    nFailures ++;
                     modelData[iy][ix] = modelStdevData[iy][ix] = NAN;
                 } else {
@@ -233,4 +239,8 @@
             psFree (submask);
         }
+    }
+
+    if (nFailures) {
+	psLogMsg ("psphot", PS_LOG_WARN, "Failed to estimate background for %d of %d subimages", nFailures, (model->numRows*model->numCols));
     }
 
