Changeset 35204 for trunk/ippToPsps/jython/ipptopspsdb.py
- Timestamp:
- Feb 26, 2013, 8:50:05 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/ipptopspsdb.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/ipptopspsdb.py
r35203 r35204 1037 1037 def getBoxId(self, ra, dec): 1038 1038 1039 # for the float comparison, need to use a small window 1040 minRA = ra - 0.01 1041 maxRA = ra + 0.01 1042 minDEC = dec - 0.01 1043 maxDEC = dec + 0.01 1044 1039 1045 sql = "SELECT id FROM box \ 1040 1046 WHERE skychunk = '" + self.skychunk.name + "' \ 1041 AND ra_center = " + str(ra) + " \1042 AND dec_center = " + str(dec)1047 AND ra_center BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \ 1048 AND dec_center BETWEEN " + str(minDEC) + " AND " + str(maxDEC) 1043 1049 1044 1050 # AND box_side = " + str(self.skychunk.boxSize) 1045 1051 1052 # print "sql for boxid: ", sql 1053 1046 1054 id = -1 1047 1055 try: … … 1140 1148 def insertPending(self, box_id, batchType, ids): 1141 1149 1150 # print "starting insert pending" 1151 1142 1152 # first delete old pending items 1143 1153 self.execute("DELETE FROM pending \ 1144 1154 WHERE box_id = " + str(box_id) + " \ 1145 1155 AND batch_type = '" + batchType + "'") 1156 1157 # print "deleted old items" 1146 1158 1147 1159 for id in ids: … … 1151 1163 (" + str(box_id) + ", '" + batchType + "', " + str(id) + ")" 1152 1164 1165 # print "sql: ", sql 1153 1166 self.execute(sql) 1154 1167 … … 1455 1468 Gets all items in the all_pending temporary table within the bounds of this box 1456 1469 ''' 1457 def getItemsInThisThisBox(self, ra, dec): 1458 1459 halfSide = self.skychunk.boxSize/2.0 1460 minRa = ra-halfSide 1461 maxRa = ra+halfSide 1462 minDec = dec-halfSide 1463 maxDec = dec+halfSide 1470 def getItemsInThisBox(self, minRA, maxRA, minDEC, maxDEC): 1471 1472 # the old linear size is ill-conceived 1473 ## XX halfSide = self.skychunk.boxSize/2.0 1474 ## XX minRa = ra-halfSide 1475 ## XX maxRa = ra+halfSide 1476 ## XX minDec = dec-halfSide 1477 ## XX maxDec = dec+halfSide 1464 1478 1465 1479 ids = [] … … 1467 1481 sql = "SELECT DISTINCT stage_id \ 1468 1482 FROM all_pending \ 1469 WHERE ra_bore BETWEEN " + str(minR a) + " AND " + str(maxRa) + " \1470 AND dec_bore BETWEEN " + str(minD ec) + " AND " + str(maxDec)1483 WHERE ra_bore BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \ 1484 AND dec_bore BETWEEN " + str(minDEC) + " AND " + str(maxDEC) 1471 1485 1472 1486 try:
Note:
See TracChangeset
for help on using the changeset viewer.
