Index: branches/eam_branches/ipp-20121219/ippToPsps/jython/detectionbatch.py
===================================================================
--- branches/eam_branches/ipp-20121219/ippToPsps/jython/detectionbatch.py	(revision 35078)
+++ branches/eam_branches/ipp-20121219/ippToPsps/jython/detectionbatch.py	(revision 35079)
@@ -76,15 +76,8 @@
        self.outputFitsPath = "%s/%s" % (self.localOutPath, self.outputFitsFile)
 
-       # if test mode
-       if self.config.test:
-           self.startX = 3
-           self.endX = 4
-           self.startY = 3
-           self.endY = 4
-       else:
-           self.startX = 0
-           self.endX = 8
-           self.startY = 0
-           self.endY = 8
+       self.startX = 0
+       self.endX = 8
+       self.startY = 0
+       self.endY = 8
 
        #self.startX = 1
@@ -588,4 +581,9 @@
         except: pass
 
+        externID = self.imageIDs[ota]
+
+        imageID = self.scratchDb.getImageIDFromExternID(externID)
+        self.logger.infoPair("obtained","imageID")
+
         dumpFile = "/tmp/datadump/genetest.xx.dat"
         files = glob.glob(dumpFile)
@@ -614,5 +612,6 @@
          JOIN " + self.scratchDb.dvoDetectionTable + " as b \
          ON (a.objID = b.objID AND a.detectID = b.detectID) \
-         INTO OUTFILE '" + dumpFile + "'"
+         WHERE b.imageID = " + str(imageID) + 
+         " INTO OUTFILE '" + dumpFile + "'"
         print "sql: ", sql
         self.scratchDb.execute(sql)
