Index: trunk/ippToPsps/jython/forcedgalaxybatch.py
===================================================================
--- trunk/ippToPsps/jython/forcedgalaxybatch.py	(revision 38965)
+++ trunk/ippToPsps/jython/forcedgalaxybatch.py	(revision 39007)
@@ -70,5 +70,4 @@
         self.logger.infoPair("DVO INDEX", "%d" % self.id)
 
-
     '''
     Overriden from batch base class to import directly from DVO for forced galaxy shape parameters
@@ -109,5 +108,4 @@
         return True
 
-
     '''
     Applies indexes to the IPP Tables
@@ -120,9 +118,6 @@
     '''
     def updatePspsUniqueIDs(self):
-        sql = "UPDATE ForcedGalaxyShape set uniquePspspFGid = (("+str(self.batchID)+"*1000000000 ) + row)"
-        try: self.scratchDb.execute(sql)
-        except:
-            self.logger.errorPair('failed sql', sql)
-            raise
+        sql = "UPDATE ForcedGalaxyShape set uniquePspsFGid = (("+str(self.batchID)+"*1000000000 ) + row)"
+        self.scratchDb.execute(sql)
 
     '''
@@ -145,28 +140,6 @@
 
             # This is going to need to join elsewhere to get all the fields?
-            # XippDetectID, XforcedSummaryID
-            # Ra, Dec, RaErr, DecErr
-            
-            # This won't work, as we need to join on modeltype/obj_id/filter
-#                + cpqTable + " AS cpq ON (cpq.row = (ForcedGalaxyShape.row* " + str(filterCount) + ")-(" + str(filterCount) + " - " + str(filter[0]) + ")) " \ 
-#                + " ForcedGalaxyShape." + filter[1] + "GalModelType               = MODEL_TYPE," \
-
+            # XforcedSummaryID, Ra, Dec, RaErr, DecErr
             # Should GalChiSq fold in Npix somehow? 
-#             sql = "UPDATE ForcedGalaxyShape JOIN " \
-#                + cpqTable + " AS cpq ON (cpq.row = (ForcedGalaxyShape.row* " + str(filterCount) + ")-(" + str(filterCount) + " - " + str(filter[0]) + ")) " \ 
-#                 + " SET " + \
-#                 + " ForcedGalaxyShape." + filter[1] + "ippDetectID                = DET_ID," \
-#                 + " ForcedGalaxyShape." + filter[1] + "forcedSummaryID            = IMAGE_ID," \
-#                 + " ForcedGalaxyShape." + filter[1] + "GalMajor                   = MAJOR_AXIS," \
-#                 + " ForcedGalaxyShape." + filter[1] + "GalMajorErr                = MAJOR_AXIS_ERR," \
-#                 + " ForcedGalaxyShape." + filter[1] + "GalMinor                   = MINOR_AXIS," \
-#                 + " ForcedGalaxyShape." + filter[1] + "GalMinorErr                = MINOR_AXIS_ERR," \
-#                 + " ForcedGalaxyShape." + filter[1] + "GalMag                     = MAG," \
-#                 + " ForcedGalaxyShape." + filter[1] + "GalMagErr                  = MAG_ERR," \
-#                 + " ForcedGalaxyShape." + filter[1] + "GalRa                      = RA," \
-#                 + " ForcedGalaxyShape." + filter[1] + "GalDec                     = DEC," \
-#                 + " ForcedGalaxyShape." + filter[1] + "GalRaErr                   = RA_ERR," \
-#                 + " ForcedGalaxyShape." + filter[1] + "GalDecErr                  = DEC_ERR," \
-#                 + " ForcedGalaxyShape." + filter[1] + "GalChisq                   = CHISQ "
 
             sqlLine = sqlUtility("UPDATE ForcedGalaxyShape AS a, " + cpqTable + " AS b SET")
@@ -179,23 +152,18 @@
             sqlLine.group("a." + filter[1] + "GalMag",          "b.MAG")
             sqlLine.group("a." + filter[1] + "GalMagErr",       "b.MAG_ERR")
-# These fields don't exist.
-#            sqlLine.group("a." + filter[1] + "GalRa",           "b.RA")
-#            sqlLine.group("a." + filter[1] + "GalDec",          "b.DEC")
-#            sqlLine.group("a." + filter[1] + "GalRaErr",        "b.RA_ERR")
-#            sqlLine.group("a." + filter[1] + "GalDecErr",       "b.DEC_ERR")
             sqlLine.group("a." + filter[1] + "GalChisq",        "b.CHISQ")
+
+            # These fields don't exist.
+            # sqlLine.group("a." + filter[1] + "GalRa",           "b.RA")
+            # sqlLine.group("a." + filter[1] + "GalDec",          "b.DEC")
+            # sqlLine.group("a." + filter[1] + "GalRaErr",        "b.RA_ERR")
+            # sqlLine.group("a." + filter[1] + "GalDecErr",       "b.DEC_ERR")
+
             sql = sqlLine.makeEquals("WHERE a.objID = b.OBJ_ID AND a.galModelType = b.MODEL_TYPE AND b.Photcode = " + photcode)
-            
-
-            try: self.scratchDb.execute(sql)
-            except:
-                self.logger.errorPair("failed update ForcedGalaxyShape", sql)
-                raise
-
-        
-
-
-    '''
-    Populate ForcedGalaxyShape table
+
+            self.scratchDb.execute(sql)
+
+    '''
+    Populate ForcedGalaxyShape table with basic IDs
     '''
     def populateForcedGalaxyShapeTable(self):
@@ -212,6 +180,6 @@
         # uniquePspsFGid is set elsewhere
         sqlLine.group("ippObjID",   "OBJ_ID + (CAT_ID << 32)")
-        # batchID isn't in the schema.
-#        sqlLine.group("batchID",    "'" + str(self.batchID) + "'")
+        # batchID isn't in the schema, should it be?
+        # sqlLine.group("batchID",    "'" + str(self.batchID) + "'")
         # surveyID is set where?
         sqlLine.group("randomForcedGalID",      "RAND("+str(self.batchID)+")")
@@ -219,9 +187,5 @@
         sql = sqlLine.makeRaw(") SELECT ", " FROM " + cptTableName)
 
-        try:
-            self.scratchDb.execute(sql)
-        except:
-            self.logger.errorPair("Couldn't populate Forced Galaxy table from cpt", sql)
-            raise
+        self.scratchDb.execute(sql)
 
         self.logger.infoPair("Adding 'row' columns to", "Forced Galaxy, cpt tables")
@@ -234,5 +198,4 @@
         self.logger.infoPair("update ForcedGalaxyShape from ","cpq table")
         self.updateForcedGalaxyShapeFromCpq(cpqTableName)
-
         
         self.logger.infoPair("Dropping row column from ", "ForcedGalaxyShape table")
@@ -242,5 +205,7 @@
         self.setMinMaxObjID(["ForcedGalaxyShape"])
         self.logger.infoPair("checking if we have detections", "ForcedGalaxyShape table")
+
         rowcount = self.scratchDb.getRowCount("ForcedGalaxyShape")
+
         if rowcount == 0:
             self.logger.infoPair("skipping this one", "ForcedGalaxyShape")
@@ -256,5 +221,2 @@
         
         if not self.populateForcedGalaxyShapeTable(): return False
-
-        # My example is removing objID duplicates.  Since ForcedGalaxyShape can have multiple models for a given object, I'm not doing that.
-
