Index: trunk/ippToPsps/jython/batch.py
===================================================================
--- trunk/ippToPsps/jython/batch.py	(revision 33234)
+++ trunk/ippToPsps/jython/batch.py	(revision 33235)
@@ -27,8 +27,4 @@
     '''
     Constructor
-
-    >>> batch = Batch(1,2,3,4,5,6,7)
-    >>> print batch.pspsVoTableFilePath
-    "../config/2/tables.vot"
     '''
     def __init__(self, 
@@ -41,5 +37,6 @@
                  batchID,
                  batchType, 
-                 fits): 
+                 fits,
+                 useFullTables): 
 
         self.everythingOK = False
@@ -48,4 +45,5 @@
         self.doc = doc
         self.fits = fits
+        self.useFullTables = useFullTables
 
         # set up logging
@@ -82,5 +80,4 @@
         self.dvoGpc1Label = self.doc.find("dvo/gpc1Label").text
         self.dvoLocation = self.doc.find("dvo/location").text
-        self.useFullTables = int(self.doc.find("dvo/useFullTables").text)
         self.scratchDb = ScratchDb(logger, self.doc, self.useFullTables)
 
@@ -496,6 +493,6 @@
     def getIDsFromDVO(self):
 
-        if self.scratchDb.getRowCount("dvoMeta") < 1:
-            self.logger.error("No DVO IDs found in dvoMeta")
+        if self.scratchDb.getRowCount(self.scratchDb.dvoImagesTable) < 1:
+            self.logger.errorInfo("No DVO images found in", self.scratchDb.dvoImagesTable)
             return False
 
Index: trunk/ippToPsps/jython/detectionbatch.py
===================================================================
--- trunk/ippToPsps/jython/detectionbatch.py	(revision 33234)
+++ trunk/ippToPsps/jython/detectionbatch.py	(revision 33235)
@@ -38,5 +38,6 @@
                  ippToPspsDb,
                  camID,
-                 batchID):
+                 batchID,
+                 useFullTables):
 
        super(DetectionBatch, self).__init__(
@@ -49,5 +50,6 @@
                batchID,
                "P2", 
-               gpc1Db.getCameraStageSmf(camID))
+               gpc1Db.getCameraStageSmf(camID),
+               useFullTables)
 
        if not self.everythingOK: return
@@ -322,5 +324,5 @@
                ," + self.safeDictionaryAccess(header, 'DAPMIFIT') + " \
                ,'" + self.safeDictionaryAccess(header, 'DETECTOR') + "' \
-               ," + str(self.scratchDb.getDvoImageFlags(header['SOURCEID'], header['IMAGEID'])) + " \
+               ," + str(self.scratchDb.getDvoImageFlags(header['IMAGEID'])) + " \
                ,'" + self.safeDictionaryAccess(header, 'DETREND.MASK') + "' \
                ,'" + self.safeDictionaryAccess(header, 'DETREND.DARK') + "' \
@@ -416,6 +418,4 @@
                ,momentYY \
                ,apMag \
-               ,kronFlux \
-               ,kronFluxErr \
                ,infoFlag \
                ,sky \
@@ -448,6 +448,4 @@
                ,MOMENTS_YY \
                ,AP_MAG \
-               ,KRON_FLUX \
-               ,KRON_FLUX_ERR \
                ,FLAGS\
                ,SKY \
@@ -545,6 +543,5 @@
         self.populateFrameMeta()
      
-        # dictionary objects to hold sourceIDs and imageIDs for later
-        self.sourceIDs = {}
+        # dictionary objects to hold imageIDs for later
         self.imageIDs = {}
 
@@ -578,5 +575,4 @@
 
                 # store these for later
-                self.sourceIDs[ota] = header['SOURCEID']
                 self.imageIDs[ota] = header['IMAGEID']
 
@@ -614,7 +610,7 @@
     Updates provided table with DVO IDs from DVO table
     '''
-    def updateDvoIDs(self, table, sourceID, externID):
-
-        imageID = self.scratchDb.getImageIDFromExternID(sourceID, externID)
+    def updateDvoIDs(self, table, externID):
+
+        imageID = self.scratchDb.getImageIDFromExternID(externID)
         self.logger.debug("Updating table '" + table + "' with DVO IDs using imageID = %d" % imageID)
         sql = "UPDATE IGNORE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \
@@ -624,5 +620,4 @@
                a.infoFlag = b.flags << 32 | a.infoFlag \
                WHERE a.ippDetectID = b.ippDetectID \
-               AND b.sourceID = " + str(sourceID) + " \
                AND b.imageID = " + str(imageID)
 
@@ -655,5 +650,5 @@
 
                 ota = "XY%d%d" % (x, y)
-                if ota not in self.sourceIDs: continue
+                if ota not in self.imageIDs: continue
 
                 #self.logger.infoTitle("Processing " + ota)
@@ -666,5 +661,5 @@
 
                 # now add DVO IDs
-                self.updateDvoIDs("Detection_" + ota, self.sourceIDs[ota], self.imageIDs[ota])
+                self.updateDvoIDs("Detection_" + ota, self.imageIDs[ota])
                 results['NULLOBJID'] = self.scratchDb.reportAndDeleteRowsWithNULLS("Detection_" + ota, "objID")
                 self.updateImageID("Detection_" + ota, x, y) 
@@ -693,5 +688,5 @@
                 # update ImageMeta with count of detections for this OTA and photoCodeID
                 sql = "UPDATE ImageMeta_" + ota + " \
-                       SET nDetect = %d, photoCalID = %d" % (self.scratchDb.getRowCount("Detection_" + ota), self.scratchDb.getPhotoCalID(self.sourceIDs[ota], self.imageIDs[ota]))
+                       SET nDetect = %d, photoCalID = %d" % (self.scratchDb.getRowCount("Detection_" + ota), self.scratchDb.getPhotoCalID(self.imageIDs[ota]))
                 self.scratchDb.execute(sql)
 
@@ -760,5 +755,5 @@
        else : regex = ".*.psf"
   
-       columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG KRON_FLUX KRON_FLUX_ERR FLAGS SKY SKY_SIGMA EXT_NSIGMA"
+       columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG FLAGS SKY SKY_SIGMA EXT_NSIGMA"
 
        return super(DetectionBatch, self).importIppTables(columns, regex)
Index: trunk/ippToPsps/jython/initbatch.py
===================================================================
--- trunk/ippToPsps/jython/initbatch.py	(revision 33234)
+++ trunk/ippToPsps/jython/initbatch.py	(revision 33235)
@@ -40,5 +40,6 @@
                batchID,
                "IN", 
-               None)
+               None,
+               0)
 
        self.outputFitsFile = "00000000.FITS";
Index: trunk/ippToPsps/jython/stackbatch.py
===================================================================
--- trunk/ippToPsps/jython/stackbatch.py	(revision 33234)
+++ trunk/ippToPsps/jython/stackbatch.py	(revision 33235)
@@ -35,5 +35,6 @@
                  ippToPspsDb,
                  stackID,
-                 batchID):
+                 batchID,
+                 useFullTables):
 
        super(StackBatch, self).__init__(
@@ -46,5 +47,6 @@
                batchID,
                "ST", 
-               gpc1Db.getStackStageCmf(configDoc.find("dvo/gpc1Label").text, stackID))
+               gpc1Db.getStackStageCmf(configDoc.find("dvo/gpc1Label").text, stackID),
+               useFullTables)
 
        if not self.everythingOK: return
