Index: trunk/ippToPsps/jython/gaiaobjectbatch.py
===================================================================
--- trunk/ippToPsps/jython/gaiaobjectbatch.py	(revision 39785)
+++ trunk/ippToPsps/jython/gaiaobjectbatch.py	(revision 39786)
@@ -14,5 +14,5 @@
 from ipptopspsdb import IppToPspsDb
 from scratchdb import ScratchDb
-from dvoobjects import DvoObjects
+from dvogaiaobjects import DvoGaiaObjects
 from sqlUtility import sqlUtility
 
@@ -49,5 +49,5 @@
                dvoID,
                batchID,
-               "OB", 
+               "GO", 
                None)
 
@@ -84,4 +84,6 @@
     '''
     def alterPspsTables(self):
+        
+        self.scratchDb.execute("ALTER TABLE GaiaFrameCoordinate CHANGE dec_ `dec` double")
 
         return True
@@ -119,5 +121,6 @@
         cpsTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cps")
 
-        if False:
+        #if False:
+        #    self.
             # XXX EAM 20140724 : this is probably wrong : flux measurements can be 0.0 or negative: please review
         self.logger.info("Populating GaiaFrameCoordinate")
@@ -134,8 +137,8 @@
         sqlLine.group("batchID",         "'" + str(self.batchID) + "'")
         sqlLine.group("ra",          "RA_MEAN")
-        sqlLine.group("dec",         "DEC_MEAN")
+        sqlLine.group("`dec`",         "DEC_MEAN")
         sqlLine.group("raErr",       "RA_ERR")
         sqlLine.group("decErr",      "DEC_ERR")
-
+        sqlLine.group("gaiaFlag",     "FLAGS") 
         sql = sqlLine.makeRaw(") SELECT ", " FROM " + cptTableName)
 
@@ -179,9 +182,9 @@
             #count out of range
     
-            sql = "SELECT count(*) FROM gaiaFrameCoordinate where \
-                  gaiaFrameCoordinate.dec > " + str(decMax) + " \
-                  or gaiaFrameCoordinate.dec < " + str(decMin) + " \
-                  or gaiaFrameCoordinate.ra > " + str(raMax) + " \
-                  or gaiaFrameCoordinate.ra < " + str(raMin)       
+            sql = "SELECT count(*) FROM GaiaFrameCoordinate where \
+                  GaiaFrameCoordinate.`dec` > " + str(decMax) + " \
+                  or GaiaFrameCoordinate.`dec` < " + str(decMin) + " \
+                  or GaiaFrameCoordinate.ra > " + str(raMax) + " \
+                  or GaiaFrameCoordinate.ra < " + str(raMin)       
         
             rs = self.scratchDb.executeQuery(sql)
@@ -193,9 +196,9 @@
             
      
-            sql = "DELETE FROM gaiaFrameCoordinate where \
-                  gaiaFrameCoordinate.dec > (" + str(decMax) + " + .0033) or \
-                  gaiaFrameCoordinate.dec < (" + str(decMin) + " - .0033) or \
-                  gaiaFrameCoordinate.ra > (" + str(raMax) + " + .0033) or \
-                  gaiaFrameCoordinate.ra < (" + str(raMin) + " - .0033)" 
+            sql = "DELETE FROM GaiaFrameCoordinate where \
+                  GaiaFrameCoordinate.`dec` > (" + str(decMax) + " + .0033) or \
+                  GaiaFrameCoordinate.`dec` < (" + str(decMin) + " - .0033) or \
+                  GaiaFrameCoordinate.ra > (" + str(raMax) + " + .0033) or \
+                  GaiaFrameCoordinate.ra < (" + str(raMin) + " - .0033)" 
             self.logger.infoPair("Deleting", str(nToDelete) + " objects outside of ra/dec range")
     
@@ -203,5 +206,5 @@
                 self.scratchDb.execute(sql)
             except:
-                self.logger.errorPair("Couldn't cull outsiders from gaiaFrameCoordinate table", sql)
+                self.logger.errorPair("Couldn't cull outsiders from GaiaFrameCoordinate table", sql)
                 raise
 
@@ -210,9 +213,9 @@
         self.logger.infoPair("updatePspsUniqueIDs","end")
 
-        self.logger.infoPair("Dropping row column from", "gaiaFrameCoordinate table")
-        self.scratchDb.dropColumn("gaiaFrameCoordinate", "row")
-        self.logger.infoPair("Dropped row column", "gaiaFrameCoordinate")
-
-        self.setMinMaxObjID(["gaiaFrameCoordinate"])
+        self.logger.infoPair("Dropping row column from", "GaiaFrameCoordinate table")
+        self.scratchDb.dropColumn("GaiaFrameCoordinate", "row")
+        self.logger.infoPair("Dropped row column", "GaiaFrameCoordinate")
+
+        self.setMinMaxObjID(["GaiaFrameCoordinate"])
 
         return True
@@ -234,6 +237,6 @@
 
         ### force objID uniqueness on *** ObjectThin ***
-        self.logger.infoPair("Forcing uniqueness on", "objID in gaiaFrameCoordinate table")
-        rowCountBefore = self.scratchDb.getRowCount("gaiaFrameCoordinate")
+        self.logger.infoPair("Forcing uniqueness on", "objID in GaiaFrameCoordinate table")
+        rowCountBefore = self.scratchDb.getRowCount("GaiaFrameCoordinate")
 
         # XXX EAM : note that in mysql versions later than 5.1, this fails
@@ -246,9 +249,9 @@
             self.scratchDb.execute("set session old_alter_table=1")
             
-        self.scratchDb.execute("ALTER IGNORE TABLE gaiaFrameCoordinate ADD UNIQUE INDEX(objID)")
+        self.scratchDb.execute("ALTER IGNORE TABLE GaiaFrameCoordinate ADD UNIQUE INDEX(objID)")
         if self.scratchDb.version > 5.1:
             self.scratchDb.execute("set session old_alter_table=0")
 
-        rowCountAfter = self.scratchDb.getRowCount("gaiaFrameCoordinate")
+        rowCountAfter = self.scratchDb.getRowCount("GaiaFrameCoordinate")
         self.logger.infoPair("Number of duplicated objIDs removed", "%d out of %d" % ((rowCountBefore - rowCountAfter), rowCountBefore))
 
