Changeset 35204
- Timestamp:
- Feb 26, 2013, 8:50:05 AM (13 years ago)
- Location:
- trunk/ippToPsps
- Files:
-
- 1 added
- 3 edited
-
jython/ipptopspsdb.py (modified) (5 diffs)
-
jython/queue.py (modified) (4 diffs)
-
test/fulltest.sh (modified) (1 diff)
-
test/widetest.sh (added)
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: -
trunk/ippToPsps/jython/queue.py
r35203 r35204 8 8 import sys 9 9 import os 10 import math 10 11 import logging.config 11 12 … … 117 118 # starting positions 118 119 119 dD = 0.5*s kychunk.boxSize120 dD = 0.5*self.skychunk.boxSize 120 121 dec = self.skychunk.minDec + dD 122 if (dec > 85): raise 123 124 # print "dec, dD: ", dec, dD 121 125 122 126 # a given box centered at RA,DEC with (linear) size of SIDE has the following bounds 123 dR = 0.5*s kychunk.boxSize / math.cos(math.radians(dec))127 dR = 0.5*self.skychunk.boxSize / math.cos(math.radians(dec)) 124 128 ra = self.skychunk.minRa + dR 125 129 130 # print "ra, dR: ", ra, dR 131 132 # XXX not sure why this is not done with a for-loop... 126 133 while dec <= self.skychunk.maxDec: 127 128 # XXX EAM : need to do something special at the poles...129 if (dec > 85): raise130 131 134 while ra <= self.skychunk.maxRa: 132 135 … … 137 140 maxDEC = dec + dD 138 141 139 XXX EAM:142 # this function inserts the box with given center and (linear) skychunk.boxSize 140 143 box_id = self.ippToPspsDb.insertBox(ra, dec) 141 144 142 XXX EAM: 143 ids = self.ippToPspsDb.getItemsInThisThisBox(ra, dec) 145 ids = self.ippToPspsDb.getItemsInThisBox(minRA, maxRA, minDEC, maxDEC) 144 146 145 147 self.logger.info("| %5.1f | %5.1f | %9d | %9d |" % ( … … 149 151 len(ids))) 150 152 153 # print "box_id: ", box_id 154 151 155 if len(ids) > 0: self.ippToPspsDb.insertPending(box_id, batchType, ids) 156 # print "inserted pending" 152 157 ra = ra + 2*dR 153 154 dec = dec + 2*dD 155 156 dR = 0.5*skychunk.boxSize / math.cos(math.radians(dec)) 157 ra = self.skychunk.minRa + dR 158 # print "new ra: ", ra 159 160 dec = dec + 2*dD 161 if (dec > 85): raise 162 163 dR = 0.5*self.skychunk.boxSize / math.cos(math.radians(dec)) 164 ra = self.skychunk.minRa + dR 158 165 159 166 self.logger.info("+-------------+-------------+-------------+-------------+") -
trunk/ippToPsps/test/fulltest.sh
r35188 r35204 26 26 27 27 set mkgpc1 = 0 28 set initdb = 129 set initscratch = 128 set initdb = 0 29 set initscratch = 0 30 30 set camqueue = 1 31 set initbatch = 132 set cambatch = 131 set initbatch = 0 32 set cambatch = 0 33 33 set stackqueue = 0 34 34 set stackbatch = 0
Note:
See TracChangeset
for help on using the changeset viewer.
