IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 14, 2012, 12:02:48 PM (14 years ago)
Author:
rhenders
Message:

Big changes to support a new Config class that encapuslates the xml config file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/scratchdb.py

    r33236 r33259  
    1919    Constructor
    2020    '''
    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")
    2323
    2424        if useFull:
     
    484484
    485485    '''
    486     Gets a list of PSPS image IDs for this stack ID
    487     '''
    488     def getDvoRegionsForThisBox(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):
    489489
    490490        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):
    491505
    492506        sql = "SELECT name FROM " + self.dvoSkyTable + " \
     
    498512        try:
    499513            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.