Index: trunk/psphot/src/psphotFitSourcesLinear.c
===================================================================
--- trunk/psphot/src/psphotFitSourcesLinear.c	(revision 41444)
+++ trunk/psphot/src/psphotFitSourcesLinear.c	(revision 42088)
@@ -217,4 +217,12 @@
     int Nsat = 0;
 
+    // track number kept at several stages of the analysis
+    int Nstep_0 = 0;
+    int Nstep_1 = 0;
+    int Nstep_2 = 0;
+    int Nstep_3 = 0;
+    int Nstep_4 = 0;
+    int Nstep_5 = 0;
+
     // select the sources which will be used for the fitting analysis
     for (int i = 0; i < sources->n; i++) {
@@ -246,4 +254,6 @@
         if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) continue;
 
+	Nstep_0++;
+
 	// XXX count saturated stars
         if (source->mode & PM_SOURCE_MODE_SATSTAR) {
@@ -255,4 +265,5 @@
             if (!pmSourceCacheModel (source, maskVal)) continue;
         }
+	Nstep_1++;
 
         // save the original coords
@@ -265,4 +276,5 @@
         if (x > AnalysisRegion.x1) continue;
         if (y > AnalysisRegion.y1) continue;
+	Nstep_2++;
 
 	// check the integral of the model : is it large enough?
@@ -283,4 +295,6 @@
             continue;
         }
+	Nstep_3++;
+
 	bool isPSF = false;
         pmModel *model = pmSourceGetModel (&isPSF, source);
@@ -306,5 +320,8 @@
         } 
         if (modelSum  < cutModelSum * normFlux) continue;
+	Nstep_4++;
+
         if (maskedSum < cutMaskedSum * normFlux) continue;
+	Nstep_5++;
 
 	// clear the 'mark' pixels and remask on the fit aperture 
@@ -322,4 +339,5 @@
     }
     psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "built fitSources: %f sec (%ld objects)\n", psTimerMark ("psphot.linear"), sources->n);
+    psLogMsg ("psphot.ensemble", PS_LOG_INFO, "Number of sources kept at each stage: %d %d %d %d %d %d\n", Nstep_0, Nstep_1, Nstep_2, Nstep_3, Nstep_4, Nstep_5);
 
     if (fitSources->n == 0) {
