IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32493


Ignore:
Timestamp:
Oct 5, 2011, 4:19:56 PM (15 years ago)
Author:
rhenders
Message:

added min/max RA/Dec to constraints on DVO query

File:
1 edited

Legend:

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

    r32180 r32493  
    6060
    6161    '''
    62     Gets a list of ids in this DVO database for this stage, could be cam or staticsky (so far)
    63     '''
    64     def getIDsInThisDVODbForThisStage(self, dvoDb, batchType):
     62    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
     63    '''
     64    def getIDsInThisDVODbForThisStage(self, dvoDb, batchType, minRA=-999, maxRA=999, minDec=-999, maxDec=999):
    6565
    6666        if batchType == "P2": # TODO define these someplace
     
    7171                   JOIN minidvodbRun USING(minidvodb_name) \
    7272                   JOIN minidvodbProcessed USING(minidvodb_id) \
     73                   JOIN camRun ON (stage_id = cam_id) \
     74                   JOIN chipRun USING (chip_id) \
     75                   JOIN rawExp USING (exp_id) \
    7376                   WHERE minidvodbRun.minidvodb_group = '" + dvoDb + "' \
    7477                   AND minidvodbRun.state = 'merged' \
    7578                   AND minidvodbProcessed.fault = 0 \
    7679                   AND addRun.stage = '" + stage + "' \
    77                    AND addRun.state = 'full'"
     80                   AND addRun.state = 'full' \
     81                   AND decl BETWEEN RADIANS(" + str(minDec) + ") AND RADIANS(" + str(maxDec) + ") \
     82                   AND ra BETWEEN RADIANS(" + str(minRA) + ") AND RADIANS(" + str(maxRA) + ")"
    7883
    7984        elif batchType == "ST":       
    8085
    8186            stage = "staticsky"
    82             sql = "SELECT DISTINCT stack_id \
    83                    FROM staticskyInput \
     87            sql = "SELECT DISTINCT stack_id FROM staticskyInput \
    8488                   JOIN addRun ON(staticskyInput.sky_id = addRun.stage_id) \
    8589                   JOIN minidvodbRun USING(minidvodb_name) \
     
    9094                   AND addRun.stage = '" + stage + "' \
    9195                   AND addRun.state = 'full'"
    92            
     96
    9397        try:
    9498            rs = self.executeQuery(sql)
Note: See TracChangeset for help on using the changeset viewer.