Index: branches/eam_branches/ipp-20121219/ippToPsps/jython/stackbatch.py
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/jython/stackbatch.py	(revision 35052)
+++ branches/eam_branches/ipp-20121219/ippToPsps/jython/stackbatch.py	(revision 35053)
@@ -737,4 +737,7 @@
         self.scratchDb.execute(sql)
 
+        imageID = self.scratchDb.getImageIDFromExternID(self.header['IMAGEID'])
+        self.logger.infoPair("obtained","imageID")
+
         # insert calibration information from dvoDetections into the Table
         sql = "UPDATE " + tableName + " AS a, "  + self.scratchDb.dvoDetectionTable + " AS b \
@@ -747,5 +750,6 @@
             a.expTime = b.expTime, \
             a.airMass = b.airMass   \
-            WHERE a.stackDetectID = b.detectID"
+            WHERE a.stackDetectID = b.detectID \
+            AND b.imageID = " + str(imageID)
         self.scratchDb.execute(sql)
         self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.config.dataRelease))
