Index: trunk/psphot/src/psphotChoosePSF.c
===================================================================
--- trunk/psphot/src/psphotChoosePSF.c	(revision 19907)
+++ trunk/psphot/src/psphotChoosePSF.c	(revision 19908)
@@ -1,3 +1,18 @@
 # include "psphotInternal.h"
+
+void psphotCountPSFStars (psArray *sources) {
+
+    int nPSF = 0;
+
+    // select the candidate PSF stars (pointers to original sources)
+    for (int i = 0; i < sources->n; i++) {
+        pmSource *source = sources->data[i];
+        if (source->mode & PM_SOURCE_MODE_PSFSTAR) {
+	    nPSF ++;
+	}
+    }
+
+    fprintf (stderr, "N PSF: %d\n", nPSF);
+}
 
 // try PSF models and select best option
@@ -87,4 +102,6 @@
 
     psArray *stars = psArrayAllocEmpty (sources->n);
+
+    // psphotCountPSFStars (sources);
 
     // select the candidate PSF stars (pointers to original sources)
@@ -100,7 +117,12 @@
         }
     }
+
+    // psphotCountPSFStars (sources);
+
     // check that the identified psf stars sufficiently cover the region; if not, extend the
     // limits somewhat
     psphotCheckStarDistribution (stars, sources, options);
+
+    // psphotCountPSFStars (sources);
 
     psLogMsg ("psphot.pspsf", PS_LOG_DETAIL, "selected candidate %ld PSF objects\n", stars->n);
@@ -295,4 +317,6 @@
     psMetadataAddF32 (recipe, PS_LIST_TAIL, "DSY_STDV", PS_META_REPLACE, "stdev of mean-corrected dSYY", nSy);
 
+    // psphotCountPSFStars (sources);
+
     // unset the PSFSTAR flag for stars not used for PSF model
     for (int i = 0; i < try->sources->n; i++) {
@@ -302,4 +326,6 @@
         }
     }
+
+    // psphotCountPSFStars (sources);
 
     // build a PSF residual image
@@ -402,4 +428,6 @@
     }
 
+    // psphotCountPSFStars (sources);
+
     char *modelName = pmModelClassGetName (psf->type);
     psLogMsg ("psphot.pspsf", PS_LOG_INFO, "select psf model: %f sec\n", psTimerMark ("psphot"));
