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/queue.py

    r35203 r35204  
    88import sys
    99import os
     10import math
    1011import logging.config
    1112
     
    117118                    # starting positions
    118119
    119                     dD = 0.5*skychunk.boxSize
     120                    dD = 0.5*self.skychunk.boxSize
    120121                    dec = self.skychunk.minDec + dD
     122                    if (dec > 85): raise
     123
     124                    # print "dec, dD: ", dec, dD
    121125
    122126                    # a given box centered at RA,DEC with (linear) size of SIDE has the following bounds
    123                     dR = 0.5*skychunk.boxSize / math.cos(math.radians(dec))
     127                    dR = 0.5*self.skychunk.boxSize / math.cos(math.radians(dec))
    124128                    ra = self.skychunk.minRa + dR
    125129                   
     130                    # print "ra, dR: ", ra, dR
     131
     132                    # XXX not sure why this is not done with a for-loop...
    126133                    while dec <= self.skychunk.maxDec:
    127                        
    128                         # XXX EAM : need to do something special at the poles...
    129                         if (dec > 85): raise
    130 
    131134                        while ra <= self.skychunk.maxRa:
    132135           
     
    137140                           maxDEC = dec + dD
    138141
    139                            XXX EAM:
     142                           # this function inserts the box with given center and (linear) skychunk.boxSize
    140143                           box_id = self.ippToPspsDb.insertBox(ra, dec)
    141144           
    142                            XXX EAM:
    143                            ids = self.ippToPspsDb.getItemsInThisThisBox(ra, dec)
     145                           ids = self.ippToPspsDb.getItemsInThisBox(minRA, maxRA, minDEC, maxDEC)
    144146   
    145147                           self.logger.info("|    %5.1f    |    %5.1f    |  %9d  |  %9d  |" % (
     
    149151                                       len(ids)))
    150152               
     153                           # print "box_id: ", box_id
     154
    151155                           if len(ids) > 0: self.ippToPspsDb.insertPending(box_id, batchType, ids)
     156                           # print "inserted pending"
    152157                           ra = ra + 2*dR
    153 
    154                          dec = dec + 2*dD
    155 
    156                          dR = 0.5*skychunk.boxSize / math.cos(math.radians(dec))
    157                          ra = self.skychunk.minRa + dR
     158                           # print "new ra: ", ra
     159
     160                        dec = dec + 2*dD
     161                        if (dec > 85): raise
     162
     163                        dR = 0.5*self.skychunk.boxSize / math.cos(math.radians(dec))
     164                        ra = self.skychunk.minRa + dR
    158165
    159166                self.logger.info("+-------------+-------------+-------------+-------------+")
Note: See TracChangeset for help on using the changeset viewer.