Index: /branches/eam_branches/ipp-20140717/ippToPsps/jython/ipptopspsdb.py
===================================================================
--- /branches/eam_branches/ipp-20140717/ippToPsps/jython/ipptopspsdb.py	(revision 37170)
+++ /branches/eam_branches/ipp-20140717/ippToPsps/jython/ipptopspsdb.py	(revision 37171)
@@ -166,119 +166,4 @@
 
         return ids
-
-    ## '''
-    ## XXX EAM : removed this function and made it more explicit (with an additional block)
-    ## Returns a list of merged batch IDs that are merged but not yet deleted
-    ## '''
-    ## def getMergedButNotDeletedBatchIDs(self, batchType, column):
-    ## 
-    ##     sql = "SELECT DISTINCT batch_id \
-    ##            FROM batch \
-    ##            WHERE timestamp > '" + self.skychunk.epoch + "' \
-    ##            AND batch_type = '" + batchType + "' \
-    ##            AND dvo_db = '" + self.skychunk.dvoLabel + "' \
-    ##            AND merged = 1 \
-    ##            AND " + column + " = 0"
-    ## 
-    ##     ids = []
-    ##     try:
-    ##         rs = self.executeQuery(sql)
-    ##         while (rs.next()): ids.append(rs.getInt(1))
-    ##         rs.close()
-    ##     except:
-    ##         self.logger.exception("Can't query for merged batch ids in ipptopsps Db")
-    ## 
-    ##     self.logger.debug("Found %d merged but un-deleted items" % len(ids))
-    ## 
-    ##     return ids
-
-    ## '''
-    ## Returns a list of batch IDs marked as 'purged' but not yet deleted
-    ## XXX EAM : removed this function and made it more explicit (with an additional block)
-    ## '''
-    ## def getPurgedButNotDeletedBatchIDs(self, batchType, column):
-    ## 
-    ##     sql = "SELECT DISTINCT batch_id \
-    ##            FROM batch \
-    ##            WHERE timestamp > '" + self.skychunk.epoch + "' \
-    ##            AND batch_type = '" + batchType + "' \
-    ##            AND dvo_db = '" + self.skychunk.dvoLabel + "' \
-    ##            AND purged = 1 \
-    ##            AND " + column + " = 0"
-    ## 
-    ##     ids = []
-    ##     try:
-    ##         rs = self.executeQuery(sql)
-    ##         while (rs.next()): ids.append(rs.getInt(1))
-    ##         rs.close()
-    ##     except:
-    ##         self.logger.exception("Can't query for merged batch ids in ipptopsps Db")
-    ## 
-    ## 
-    ##     self.logger.debug("Found %d merged but un-deleted items" % len(ids))
-    ## 
-    ##     return ids
-
-    ## '''
-    ## Returns a list of processed batch IDs that have been loaded to the ODM but not yet deleted
-    ## '''
-    ## def getLoadedToODMButNotDeletedBatchIDs(self, batchType, column):
-    ## 
-    ##     sql = "SELECT DISTINCT batch_id \
-    ##            FROM batch \
-    ##            WHERE timestamp > '" + self.skychunk.epoch + "' \
-    ##            AND batch_type = '" + batchType + "' \
-    ##            AND dvo_db = '" + self.skychunk.dvoLabel + "' \
-    ##            AND (loaded_to_ODM = -1 OR merge_worthy = 1) \
-    ##            AND " + column + " = 0"
-    ## 
-    ##     ids = []
-    ##     try:
-    ##         rs = self.executeQuery(sql)
-    ##         while (rs.next()): ids.append(rs.getInt(1))
-    ##         rs.close()
-    ##     except:
-    ##         self.logger.exception("Can't query for merged batch ids in ipptopsps Db")
-    ## 
-    ##     self.logger.debug("Found %d merged but un-deleted items" % len(ids))
-    ## 
-    ##     return ids
-
-    # '''
-    # Returns a list of merged batch IDs that are not deleted from local disk
-    # '''
-    # def getMergedButNotDeletedFromLocalDisk(self, batchType):
-    #     return self.getMergedButNotDeletedBatchIDs(batchType, "deleted_local")
-
-    ## '''
-    ## Returns a list of processed batch IDs that are loaded to the ODM, but not deleted from local disk
-    ## '''
-    ## def getLoadedToODMButNotDeletedFromLocalDisk(self, batchType):
-    ##     return self.getLoadedToODMButNotDeletedBatchIDs(batchType, "deleted_local")
-    ## 
-    ## '''
-    ## Returns a list of processed batch IDs that are loaded to the ODM, but not deleted from datastore
-    ## '''
-    ## def getLoadedToODMButNotDeletedFromDatastore(self, batchType):
-    ##     return self.getLoadedToODMButNotDeletedBatchIDs(batchType, "deleted_datastore")
-    ## 
-    ## '''
-    ## Returns a list of processed batch IDs that are loaded to the ODM, but not deleted from DXLayer
-    ## '''
-    ## def getLoadedToODMButNotDeletedFromDXLayer(self, batchType):
-    ##     return self.getLoadedToODMButNotDeletedBatchIDs(batchType, "deleted_dxlayer")
-
-    ## '''
-    ## Returns a list of purged  batch IDs that not deleted from local disk
-    ## '''
-    ## def getPurgedButNotDeletedFromLocalDisk(self, batchType):
-    ##     return self.getPurgedButNotDeletedBatchIDs(batchType, "deleted_local")
-    ## 
-    ## '''
-    ## Returns a list of purged batch IDs that are not deleted from datastore
-    ## '''
-    ## def getPurgedButNotDeletedFromDatastore(self, batchType):
-    ##     return self.getPurgedButNotDeletedBatchIDs(batchType, "deleted_datastore")
-
 
     '''
@@ -1700,7 +1585,5 @@
             pass
 
-        # XXX EAM : 20140727: for now this is not temporary (for debugging)
-        # self.execute("CREATE TEMPORARY TABLE all_pending (stage_id bigint(20), ra_bore float, dec_bore float)")
-        self.execute("CREATE TABLE all_pending (stage_id bigint(20), ra_bore float, dec_bore float)")
+        self.execute("CREATE TEMPORARY TABLE all_pending (stage_id bigint(20), ra_bore float, dec_bore float)")
         for row in rows:
 
@@ -1714,22 +1597,4 @@
         count = self.getRowCount("all_pending")
         self.logger.infoPair("Items written to Db", "%d" % count)
-
-        # try:
-        #     self.execute("DROP TABLE all_pending_alt")
-        # except:
-        #     pass
-        # 
-        # self.execute("CREATE TABLE all_pending_alt (stage_id bigint(20), ra_bore float, dec_bore float)")
-        # for row in rows:
-        #     try:
-        #         sql = "INSERT INTO all_pending_alt (stage_id, ra_bore, dec_bore) \
-        #                VALUES (%d, %f, %f)" % (row[0], row[1], row[2]) 
-        #         print "sql 2: ", sql
-        #         self.execute(sql)
-        #     except: continue
-        # 
-        # count = self.getRowCount("all_pending_alt")
-        # self.logger.infoPair("Items written to alt Db", "%d" % count)
-
 
     '''
@@ -1765,11 +1630,4 @@
     def getItemsInThisBox(self, minRA, maxRA, minDEC, maxDEC):
 
-        # the old linear size is ill-conceived
-        ## XX halfSide = self.skychunk.boxSize/2.0
-        ## XX minRa =  ra-halfSide
-        ## XX maxRa = ra+halfSide
-        ## XX minDec = dec-halfSide
-        ## XX maxDec = dec+halfSide
-
         ids = []
 
