IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 26, 2013, 6:47:49 AM (13 years ago)
Author:
eugene
Message:

trying to fix the definition of a box (roughly constant linear width)

File:
1 edited

Legend:

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

    r35185 r35203  
    44import sys
    55import os
     6import math
    67import logging
    78
     
    997998
    998999            self.skychunk.boxSize = rs.getDouble(10)
    999             self.skychunk.halfBox = self.skychunk.boxSize/2.0
    1000             self.skychunk.boxSizeWithBorder = self.skychunk.boxSize + (self.skychunk.BORDER * 2)
     1000            # self.skychunk.halfBox = self.skychunk.boxSize/2.0
     1001            # self.skychunk.boxSizeWithBorder = self.skychunk.boxSize + (self.skychunk.BORDER * 2)
    10011002
    10021003            self.skychunk.basePath = rs.getString(11)
     
    10311032    '''
    10321033    Gets id of box with these coords
     1034    XXX EAM : this code implies we can have multiple boxes at the same location for the same
     1035    XXX EAM : skychunk distinguished by having different sizes.  that seems quite bad
    10331036    '''
    10341037    def getBoxId(self, ra, dec):
     
    10371040               WHERE skychunk  = '" + self.skychunk.name + "' \
    10381041               AND ra_center = " + str(ra) + " \
    1039                AND dec_center = " + str(dec) + " \
    1040                AND box_side = " + str(self.skychunk.boxSize)
     1042               AND dec_center = " + str(dec)
     1043
     1044               # AND box_side = " + str(self.skychunk.boxSize)
    10411045
    10421046        id = -1
     
    13251329        boxDim['SIDE'] = rs.getFloat(3)
    13261330
     1331        # SIDE is the linear full-width of the box
     1332
     1333        # XXX EAM : need to do something special at the poles...
     1334        if (boxDim['DEC'] > 85): raise
     1335
     1336        # a given box centered at RA,DEC with (linear) size of SIDE has the following bounds
     1337        dR = 0.5*boxDim['SIDE'] / math.cos(math.radians(boxDim['DEC']))
     1338        dD = 0.5*boxDim['SIDE']
     1339
     1340        boxDim['minRA']  = boxDim['RA']  - dR
     1341        boxDim['maxRA']  = boxDim['RA']  + dR
     1342        boxDim['minDEC'] = boxDim['DEC'] - dD
     1343        boxDim['maxDEC'] = boxDim['DEC'] + dD
     1344
    13271345        return boxDim
    13281346
Note: See TracChangeset for help on using the changeset viewer.