Index: trunk/ippToPsps/jython/stackbatch.py
===================================================================
--- trunk/ippToPsps/jython/stackbatch.py	(revision 38602)
+++ trunk/ippToPsps/jython/stackbatch.py	(revision 38763)
@@ -252,5 +252,6 @@
         sqlLine.group("skyCellID",     str(self.skycellID))            
         sqlLine.group("photoCalID",    photoCalID) 
-        sqlLine.group("analysisVer",   str(self.analysisVer)) 
+        sqlLine.group("analysisVer",   str(self.analysisVer))
+        sqlLine.group("completMag",       self.getKeyFloat(header, "%.8f", 'FLIMIT'))
         sqlLine.group("expTime",       self.getKeyFloat(header, "%.5f", 'EXPTIME'))  
         sqlLine.group("psfModelID",    psfmodel)           
@@ -270,5 +271,5 @@
         sqlLine.group("pc002001",      self.getKeyFloat(header, "%.8e", 'PC002001')) 
         sqlLine.group("pc002002",      self.getKeyFloat(header, "%.8e", 'PC002002')) 
-        sqlLine.group("dataRelease",   str(self.skychunk.dataRelease))
+        sqlLine.group("processingVersion",   str(self.skychunk.processingVersion))
 
         sql = sqlLine.make(") VALUES ( ", ")")
@@ -288,5 +289,5 @@
         self.logger.infoPair("Procesing table", "StackObjectThin")
 
-        # insert the per-object data (IDs, random stack ID, dataRelease, etc)
+        # insert the per-object data (IDs, random stack ID, processingVersion, etc)
         self.selectDvoObjIDs()
 
@@ -363,5 +364,5 @@
 #            sqlLine.group("a."+filter+"skyErr",        "b.SKY_SIGMA / " + str(exptime))
             sqlLine.group("a."+filter+"infoFlag",      "b.FLAGS")
-            sqlLine.group("a."+filter+"infoFlag2",     "b.FLAGS2 | a."+filter+"infoFlag2")
+            sqlLine.group("a."+filter+"infoFlag2",     "b.FLAGS2")
             sqlLine.group("a."+filter+"nFrames",       "b.N_FRAMES")
 
@@ -1066,5 +1067,5 @@
     '''
     select objID (psps object ID) from dvo restricted to this set of imageIDs. also insert
-    ippObjID and several constants (for a skycell): surveyID, skyCellId, dataRelease
+    ippObjID and several constants (for a skycell): surveyID, skyCellId, processingVersion
     '''
     def selectDvoObjIDs(self):
@@ -1085,5 +1086,5 @@
  #       sqlLine.group("projectionID",     "'" + str(self.projectionID) + "'")
  #       sqlLine.group("skyCellID",        "'" + str(self.skycellID) + "'")
- #       sqlLine.group("dataRelease",      "'" + str(self.skychunk.dataRelease) + "'")
+ #       sqlLine.group("processingVersion",      "'" + str(self.skychunk.processingVersion) + "'")
    #     sqlLine.group("randomStackObjID", "FLOOR(RAND()*9223372036854775807)")
 
@@ -1122,5 +1123,5 @@
               , projectionID = '" + str(self.projectionID) + "'\
               , skycellID = '" + str(self.skycellID) + "'\
-              , dataRelease = '" + str(self.skychunk.dataRelease)  +"'"
+              , processingVersion = '" + str(self.skychunk.processingVersion)  +"'"
               
         try: self.scratchDb.execute(sql)
