Index: trunk/ippToPsps/jython/stackbatch.py
===================================================================
--- trunk/ippToPsps/jython/stackbatch.py	(revision 38939)
+++ trunk/ippToPsps/jython/stackbatch.py	(revision 38951)
@@ -261,6 +261,8 @@
         zpErr   = self.getKeyFloat(header, "%.8f", 'ZPT_ERR')
 
+        zpImage = self.scratchDb.getImageZeroPoint(stackID)
+
         # XXX zp correction should come from DVO
-        detectionThreshold = detectionThreshold + zp - 2.5 * math.log10(expTime)
+        detectionThreshold = detectionThreshold + zpImage - 2.5 * math.log10(expTime)
         
         # insert stack metadata into table
@@ -287,5 +289,5 @@
 #       sqlLine.group("psfFwhm_max",        fwhm_maj_uq)
         sqlLine.group("astroScat",          astroscat)
-        sqlLine.group("photoZero",          zp)
+        sqlLine.group("photoZero",          zpImage)
         sqlLine.group("photoScat",          zpErr)
         sqlLine.group("nAstroRef",          header['NASTRO'])
