Index: trunk/ippToPsps/src/ippToPspsBatchDetection.c
===================================================================
--- trunk/ippToPsps/src/ippToPspsBatchDetection.c	(revision 28305)
+++ trunk/ippToPsps/src/ippToPspsBatchDetection.c	(revision 28423)
@@ -13,14 +13,8 @@
 #include "fitsio.h"
 
-// Gets flux from magnitude
+// Gets uncalibrated instrumental flux from magnitude
 static __inline bool ippToPsps_getFlux(const float zeroPoint, const float exposureTime, const float magnitude, float* flux) {
 
-    // use uncalibrated instrumental flux
     *flux = powf(10.0, -0.4*magnitude) / exposureTime;
-
-    // use calibrated flux in Janskys, where 3631 Jy is the zero point flux for the filter: constant over all filters because we're using AB magnitudes
-    //float flux = 3631 * powf(10.0, -0.4*(magnitude + zeroPoint)) / exposureTime;
-
-    //    printf("mag=%f\texpTime=%f\tzeroPoint=%f\tflux=%f\n", magnitude, exposureTime, zeroPoint, flux);
     return (!isfinite(*flux) || *flux < 0.000001) ? false : true;
 }
@@ -163,4 +157,5 @@
     uint32_t numInvalidFlux;
     long numDetectionsOut;
+    long totalDetectionsOut = 0;
     long removeList[MAXDETECT];
     long thisObjId;
@@ -365,8 +360,12 @@
                     extensionName, nDet, numDetectionsOut, unmatched, numOfDuplicates, numInvalidFlux);
 
+            totalDetectionsOut += numDetectionsOut;
+
             if (dvoDetections!= NULL) dvoFree(dvoDetections);
             SkyListFree(skylist);
         }
     }
+
+    psLogMsg("ippToPsps", PS_LOG_INFO, "Total detections for this exposure = %ld\n", totalDetectionsOut);
 
     for (uint32_t i=0; i<MAXDETECT;i++) free(assocDate[i]);
@@ -390,4 +389,6 @@
         if (fprintf(this->resultsFile, "%ld\n", maxObjID) < 1 ) 
             psError(PS_ERR_IO, false, "Unable to write max Object ID to'%s'\n", this->resultsPath);
+        if (fprintf(this->resultsFile, "%ld\n", totalDetectionsOut) < 1 ) 
+            psError(PS_ERR_IO, false, "Unable to write totalDetectionsOut to'%s'\n", this->resultsPath);
     }
 
