Index: trunk/ippToPsps/jython/ipptopspsdb.py
===================================================================
--- trunk/ippToPsps/jython/ipptopspsdb.py	(revision 35203)
+++ trunk/ippToPsps/jython/ipptopspsdb.py	(revision 35204)
@@ -1037,11 +1037,19 @@
     def getBoxId(self, ra, dec):
 
+        # for the float comparison, need to use a small window
+        minRA = ra - 0.01
+        maxRA = ra + 0.01
+        minDEC = dec - 0.01
+        maxDEC = dec + 0.01
+
         sql = "SELECT id FROM box \
                WHERE skychunk  = '" + self.skychunk.name + "' \
-               AND ra_center = " + str(ra) + " \
-               AND dec_center = " + str(dec)
+               AND ra_center BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
+               AND dec_center BETWEEN " + str(minDEC) + " AND " + str(maxDEC)
 
                # AND box_side = " + str(self.skychunk.boxSize)
 
+        # print "sql for boxid: ", sql
+       
         id = -1
         try:
@@ -1140,8 +1148,12 @@
     def insertPending(self, box_id, batchType, ids):
 
+        # print "starting insert pending"
+
         # first delete old pending items
         self.execute("DELETE FROM pending \
                 WHERE box_id = " + str(box_id) + " \
                 AND batch_type = '" + batchType + "'")
+
+        # print "deleted old items"
 
         for id in ids:
@@ -1151,4 +1163,5 @@
                (" + str(box_id) + ", '" + batchType + "', " + str(id) + ")"
 
+            # print "sql: ", sql
             self.execute(sql)
 
@@ -1455,11 +1468,12 @@
     Gets all items in the all_pending temporary table within the bounds of this box
     '''
-    def getItemsInThisThisBox(self, ra, dec):
-
-        halfSide = self.skychunk.boxSize/2.0
-        minRa =  ra-halfSide
-        maxRa = ra+halfSide
-        minDec = dec-halfSide
-        maxDec = dec+halfSide
+    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 = []
@@ -1467,6 +1481,6 @@
         sql = "SELECT DISTINCT stage_id \
                FROM all_pending \
-               WHERE ra_bore BETWEEN " + str(minRa) + " AND " + str(maxRa) + " \
-               AND dec_bore BETWEEN " + str(minDec) + " AND " + str(maxDec)
+               WHERE ra_bore BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
+               AND dec_bore BETWEEN " + str(minDEC) + " AND " + str(maxDEC)
 
         try:
