Index: trunk/psphot/src/psphotOutput.c
===================================================================
--- trunk/psphot/src/psphotOutput.c	(revision 34795)
+++ trunk/psphot/src/psphotOutput.c	(revision 34796)
@@ -202,4 +202,5 @@
     int nEXT = 0;
     int nForced = 0;
+    int nDetections = sources != NULL ? sources->n : 0;
 
     // count the number of sources which will be written and other sub-types
@@ -232,4 +233,5 @@
 
     psMetadataAddS32 (header, PS_LIST_TAIL, "NSTARS",   PS_META_REPLACE, "Number of sources", nSrc);
+    psMetadataAddS32 (header, PS_LIST_TAIL, "NDET",     PS_META_REPLACE, "Number of detections", nDetections);
     psMetadataAddS32 (header, PS_LIST_TAIL, "NDET_EXT", PS_META_REPLACE, "Number of extended sources", nEXT);
     psMetadataAddS32 (header, PS_LIST_TAIL, "NDET_CR",  PS_META_REPLACE, "Number of cosmic rays", nCR);
@@ -313,4 +315,5 @@
     psMetadataItemSupplement (&status, header, analysis, "NSTARS");
 
+    psMetadataItemSupplement (&status, header, analysis, "NDET");
     psMetadataItemSupplement (&status, header, analysis, "NDET_EXT");
     psMetadataItemSupplement (&status, header, analysis, "NDET_CR");
