Changeset 33259 for trunk/ippToPsps/jython/scratchdb.py
- Timestamp:
- Feb 14, 2012, 12:02:48 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/scratchdb.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/scratchdb.py
r33236 r33259 19 19 Constructor 20 20 ''' 21 def __init__(self, logger, doc, useFull=0):22 super(ScratchDb, self).__init__(logger, doc, "localdatabase")21 def __init__(self, logger, config, useFull=0): 22 super(ScratchDb, self).__init__(logger, config, "localdatabase") 23 23 24 24 if useFull: … … 484 484 485 485 ''' 486 Gets a list of PSPS image IDs for this stack ID487 ''' 488 def getDvoRegions ForThisBox(self, minRa, maxRa, minDec, maxDec):486 Gets a list of DVO regions that overlap with the defined box 487 ''' 488 def getDvoRegions(self, minRa, maxRa, minDec, maxDec): 489 489 490 490 self.logger.debug("Querying DVO SkyTable for FITS files in this region") 491 492 regions = [] 493 self.getDvoRegionsForThisBox(regions, minRa, maxRa, minDec, maxDec) 494 495 # deal with 0/360 boundary 496 if minRa < 0: self.getDvoRegionsForThisBox(regions, minRa + 360, 361 ,minDec, maxDec) 497 if maxRa > 360: self.getDvoRegionsForThisBox(regions, 0, maxRa - 360 ,minDec, maxDec) 498 499 return regions 500 501 ''' 502 Gets a list of DVO regions that overlap with the defined box 503 ''' 504 def getDvoRegionsForThisBox(self, regions, minRa, maxRa, minDec, maxDec): 491 505 492 506 sql = "SELECT name FROM " + self.dvoSkyTable + " \ … … 498 512 try: 499 513 rs = self.executeQuery(sql) 500 except: 501 self.logger.exception("Can't query for imageIDs") 502 503 files = [] 504 while (rs.next()): 505 files.append(rs.getString(1)) 506 rs.close() 507 508 return files 509 510 514 while (rs.next()): regions.append(rs.getString(1)) 515 rs.close() 516 except: 517 self.logger.exception("Can't query for DVO regions") 518 519
Note:
See TracChangeset
for help on using the changeset viewer.
