Index: trunk/ippToPsps/jython/stackbatch.py
===================================================================
--- trunk/ippToPsps/jython/stackbatch.py	(revision 34640)
+++ trunk/ippToPsps/jython/stackbatch.py	(revision 34661)
@@ -75,4 +75,8 @@
        self.skycell = self.skycell[8:12]
        self.projectioncell = self.skycell
+
+       # proposed new values. Need to coordinate with the SkyCell table
+       # this fits in 32 bits for 0 < tessID < 214
+       # self.skycell = str( (tessID * (10000 * 1000)) + (int(self.projectioncell) * 1000) + cellID )
 
        self.analysisVer = meta[2];
@@ -611,5 +615,4 @@
                ,surveyID \
                FROM StackDetection"
-        self.logger.info(sql)
         self.scratchDb.execute(sql)
         # insert calibration information from dvoDetections into the Table
@@ -623,7 +626,5 @@
             a.expTime = b.expTime, \
             a.airMass = b.airMass   \
-            WHERE a.objID = b.objID AND a.ippDetectID = b.ippDetectID"
-	# XXXX: this qualifier assumes that there is only one stack being processed at a time
-        self.logger.info(sql)
+            WHERE a.stackDetectID = b.detectID"
         self.scratchDb.execute(sql)
         self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.config.dataRelease))
@@ -669,6 +670,4 @@
         self.scratchDb.execute("ALTER TABLE StackDetectionCalib CHANGE dec_ `dec` double")
 
-
-
         return True
 
@@ -696,5 +695,5 @@
         sql = "UPDATE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \
                a.ippObjID = b.ippObjID, \
-               a.stackDetectID = 10 * b.detectID + " + str(self.filterID) + ", \
+               a.stackDetectID = b.detectID, \
                a.objID = b.objID \
                WHERE a.ippDetectID = b.ippDetectID \
@@ -712,5 +711,5 @@
         sql = "UPDATE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \
                a.ippObjID = b.ippObjID, \
-               a.stackDetectID = 10 * b.detectID + " + str(self.filterID) + ", \
+               a.stackDetectID = b.detectID, \
                a.objID = b.objID, \
                a.infoFlag = b.flags << 45 | a.infoFlag \
