- Timestamp:
- Jan 31, 2012, 4:28:37 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/gpc1db.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/gpc1db.py
r33145 r33186 32 32 33 33 ''' 34 Gets a list of ids in this DVO database for this stage, could be cam or staticsky, for a box with defined center and side length 35 ''' 36 def getIDsInThisDVODbForThisStageInThisBox(self, dvoDb, batchType, ra=180., dec=0., side=181.): 37 38 halfSide = side/2.0 39 return self.getIDsInThisDVODbForThisStage(dvoDb, batchType, ra-halfSide, ra+halfSide, dec-halfSide, dec+halfSide) 40 41 42 ''' 34 43 Gets a list of ids in this DVO database for this stage, could be cam or staticsky, and a box can be defined with equatorial coordinates 35 44 ''' 36 45 def getIDsInThisDVODbForThisStage(self, dvoDb, batchType, minRA=-999, maxRA=999, minDec=-999, maxDec=999): 46 47 self.logger.debugPair("GPC1 RA range", "%.2f -> %.2f" % (minRA, maxRA)) 48 self.logger.debugPair("GPC1 Dec range", "%.2f -> %.2f" % (minDec, maxDec)) 49 50 ids = [] 37 51 38 52 if batchType == "P2": # TODO define these someplace … … 71 85 try: 72 86 rs = self.executeQuery(sql) 87 while (rs.next()): ids.append(rs.getInt(1)) 88 rs.close() 73 89 except: 74 90 self.logger.exception("Can't query for ids in DVO") 75 76 ids = [] 77 while (rs.next()): 78 ids.append(rs.getInt(1)) 79 80 rs.close() 91 return ids 92 81 93 82 94 self.logger.debug("Found %d items in DVO database '%s' for stage='%s'" % (len(ids), dvoDb, stage))
Note:
See TracChangeset
for help on using the changeset viewer.
