Index: trunk/ippToPsps/jython/forcedobjectbatch.py
===================================================================
--- trunk/ippToPsps/jython/forcedobjectbatch.py	(revision 38884)
+++ trunk/ippToPsps/jython/forcedobjectbatch.py	(revision 39007)
@@ -114,5 +114,4 @@
         return True
 
-
     '''
     Updates table and generates pspsuniqueids
@@ -125,7 +124,4 @@
             self.logger.errorPair('failed sql',sql)
             raise
-
-
-
 
     '''
@@ -195,10 +191,11 @@
                    SET " + filter[1] + "PSFMagErr = null \
                    WHERE " + filter[1] + "PSFMagErr > " + str(cut)
-# taking out the cut since this is for mag, not flux
-
-    #       try: self.scratchDb.execute(sql)
-     #       except:
-     #           self.logger.errorPair("failed setting null meanmagerr","ForcedMeanObject")
-     #           raise
+
+            # NOTE: taking out the cut since this is for mag, not flux
+            # try: self.scratchDb.execute(sql)
+            # except:
+            # self.logger.errorPair("failed setting null meanmagerr","ForcedMeanObject")
+            # raise
+
         self.logger.infoPair("Calculating nDetections from", "n[filters]")
         for filter in filters:
@@ -275,5 +272,5 @@
                    " + cpyTable + " AS cpy ON (cpy.row = (ForcedMeanLensing.row* " + str(filterCount) + ")-(" + str(filterCount) + " - " + str(filter[0]) + ")) \
                    SET \
-                   ForcedMeanLensing." + filter[1] + "LensObjSmearX11 =  X11_SM_OBJ \
+                   ForcedMeanLensing."  + filter[1] + "LensObjSmearX11 =  X11_SM_OBJ \
                    ,ForcedMeanLensing." + filter[1] + "LensObjSmearX12 =  X12_SM_OBJ \
                    ,ForcedMeanLensing." + filter[1] + "LensObjSmearX22 =  X22_SM_OBJ \
@@ -321,10 +318,11 @@
         sqlLine = sqlUtility("INSERT INTO ForcedMeanObject (")
 
-        sqlLine.group("objID",           "EXT_ID") 
-        sqlLine.group("ippObjID",        "OBJ_ID + (CAT_ID << 32)") # NOTE: shift by 32 bits exactly
-        sqlLine.group("batchID",         "'" + str(self.batchID) + "'")
-        sqlLine.group("randomForcedObjID",        "RAND("+str(self.batchID)+")")
-        sqlLine.group("nDetections",      "'0'")
-        sqlLine.group("processingVersion",   str(self.skychunk.processingVersion))
+        sqlLine.group("objID",             "EXT_ID") 
+        sqlLine.group("ippObjID",          "OBJ_ID + (CAT_ID << 32)") # NOTE: shift by 32 bits exactly
+        sqlLine.group("batchID",           "'" + str(self.batchID) + "'")
+        sqlLine.group("randomForcedObjID", "RAND("+str(self.batchID)+")")
+        sqlLine.group("nDetections",       "'0'")
+        sqlLine.group("processingVersion", str(self.skychunk.processingVersion))
+
         sql = sqlLine.makeRaw(") SELECT ", " FROM " + cptTableName)
 
@@ -344,5 +342,4 @@
         self.updatePspsUniqueIDs()
 
-
         self.logger.infoPair("update ForcedMeanObject from ","cps table")
         self.updateForcedMeanObjectFromCps(cpsTableName)
@@ -350,11 +347,11 @@
         sqlLine = sqlUtility("INSERT INTO ForcedMeanLensing (")
 
-        sqlLine.group("objID",           "objID")
-        sqlLine.group("uniquePspsFOid","uniquePspsFOid")
+        sqlLine.group("objID",            "objID")
+        sqlLine.group("uniquePspsFOid",   "uniquePspsFOid")
         sqlLine.group("randomForcedObjID","randomForcedObjID")
-        sqlLine.group("ippObjID",        "ippObjID")
-        sqlLine.group("batchID",         "batchID")
+        sqlLine.group("ippObjID",         "ippObjID")
+        sqlLine.group("batchID",          "batchID")
         sqlLine.group("nDetections",      "nDetections")
-        sqlLine.group("processingVersion",   str(self.skychunk.processingVersion))
+        sqlLine.group("processingVersion", str(self.skychunk.processingVersion))
 
         sql = sqlLine.makeRaw(") SELECT ", " FROM ForcedMeanObject")
@@ -375,10 +372,12 @@
         self.logger.infoPair("Dropping row column from", "ForcedMeanObject table")
         self.scratchDb.dropColumn("ForcedMeanObject", "row")
+
         self.logger.infoPair("Dropping row column from", "ForcedMeanLensing table")
         self.scratchDb.dropColumn("ForcedMeanLensing", "row")
+
+        ##Don't do this till after MeanObject
         ##self.logger.infoPair("Purging from scratch Db", self.region + " region")
-
-        ##Don't do this till after MeanObject
         ##self.dvoForcedObjects.purgeRegion(self.region)
+
         self.logger.infoPair("setting minmaxobjid for ", "ForcedMeanObject table")
         self.setMinMaxObjID(["ForcedMeanObject"])
@@ -421,8 +420,3 @@
 
         self.dvoForcedObjects.purgeRegion(self.region)
-
-        #this is abuse of something but this is how I get the object batches to crash to further investigate them
-        
-#        rowCountAfter = self.scratchDb.getRowCount("Object")
         return True
-#        return False
