IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 26, 2013, 8:50:05 AM (13 years ago)
Author:
eugene
Message:

box sizes are linear dimensions; actual areas are now scaled by cos(DEC)

File:
1 edited

Legend:

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

    r35203 r35204  
    10371037    def getBoxId(self, ra, dec):
    10381038
     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
    10391045        sql = "SELECT id FROM box \
    10401046               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)
    10431049
    10441050               # AND box_side = " + str(self.skychunk.boxSize)
    10451051
     1052        # print "sql for boxid: ", sql
     1053       
    10461054        id = -1
    10471055        try:
     
    11401148    def insertPending(self, box_id, batchType, ids):
    11411149
     1150        # print "starting insert pending"
     1151
    11421152        # first delete old pending items
    11431153        self.execute("DELETE FROM pending \
    11441154                WHERE box_id = " + str(box_id) + " \
    11451155                AND batch_type = '" + batchType + "'")
     1156
     1157        # print "deleted old items"
    11461158
    11471159        for id in ids:
     
    11511163               (" + str(box_id) + ", '" + batchType + "', " + str(id) + ")"
    11521164
     1165            # print "sql: ", sql
    11531166            self.execute(sql)
    11541167
     
    14551468    Gets all items in the all_pending temporary table within the bounds of this box
    14561469    '''
    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
    14641478
    14651479        ids = []
     
    14671481        sql = "SELECT DISTINCT stage_id \
    14681482               FROM all_pending \
    1469                WHERE ra_bore BETWEEN " + str(minRa) + " AND " + str(maxRa) + " \
    1470                AND dec_bore BETWEEN " + str(minDec) + " AND " + str(maxDec)
     1483               WHERE ra_bore BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
     1484               AND dec_bore BETWEEN " + str(minDEC) + " AND " + str(maxDEC)
    14711485
    14721486        try:
Note: See TracChangeset for help on using the changeset viewer.