- Timestamp:
- Mar 5, 2013, 2:23:09 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130207/ippToPsps
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
jython/queue.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130207/ippToPsps
- Property svn:mergeinfo changed
/trunk/ippToPsps (added) merged: 35170-35171,35173-35175,35177-35179,35181-35188,35190-35191,35203-35204,35216-35218,35222-35226,35232-35233
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130207/ippToPsps/jython/queue.py
r35097 r35235 8 8 import sys 9 9 import os 10 import math 10 11 import logging.config 11 12 … … 15 16 from dvoobjects import DvoObjects 16 17 from batch import Batch 18 from scratchdb import ScratchDb 17 19 18 20 ''' … … 27 29 super(Queue, self).__init__(argv) 28 30 31 print "inited ipptopsps" 32 29 33 # create various objects 30 34 self.gpc1Db = Gpc1Db(self.logger, self.config) 35 print "connect to gpc1" 36 31 37 self.datastore = Datastore(self.logger, self.skychunk, self.ippToPspsDb) 32 38 39 print "made datastore" 40 41 # connect to scratch database 42 self.scratchDb = ScratchDb(self.logger, self.config) 43 44 print "connect to scratchdb" 45 33 46 try: 34 self.dvoObjects = DvoObjects(self.logger, self.config, self.skychunk, self.ippToPspsDb )47 self.dvoObjects = DvoObjects(self.logger, self.config, self.skychunk, self.ippToPspsDb, self.scratchDb) 35 48 except: 36 49 self.exitProgram("Unable to create instance of DvoObject") 37 50 raise 51 52 print "got objects" 38 53 39 54 self.skychunk.printAll() … … 56 71 for batchType in self.skychunk.batchTypes: 57 72 58 self.logger.infoTitle("Previous failed datastore loads")59 self.publishAnyUnpublishedBatches(batchType)73 # self.logger.infoTitle("Previous failed datastore loads") 74 # self.publishAnyUnpublishedBatches(batchType) 60 75 61 76 # get totals for whole area to check if there is anything to do … … 116 131 117 132 # starting positions 118 ra = self.skychunk.minRa + self.skychunk.halfBox 119 dec = self.skychunk.minDec + self.skychunk.halfBox 120 121 while ra <= self.skychunk.maxRa: 122 while dec <= self.skychunk.maxDec: 133 134 dD = 0.5*self.skychunk.boxSize 135 dec = self.skychunk.minDec + dD 136 if (dec > 85): raise 137 138 # print "dec, dD: ", dec, dD 139 140 # a given box centered at RA,DEC with (linear) size of SIDE has the following bounds 141 dR = 0.5*self.skychunk.boxSize / math.cos(math.radians(dec)) 142 ra = self.skychunk.minRa + dR 143 144 # print "ra, dR: ", ra, dR 145 146 # XXX not sure why this is not done with a for-loop... 147 while dec <= self.skychunk.maxDec: 148 while ra <= self.skychunk.maxRa: 123 149 150 # a given box centered at RA,DEC with (linear) size of SIDE has the following bounds 151 minRA = ra - dR 152 maxRA = ra + dR 153 minDEC = dec - dD 154 maxDEC = dec + dD 155 156 # this function inserts the box with given center and (linear) skychunk.boxSize 124 157 box_id = self.ippToPspsDb.insertBox(ra, dec) 125 158 126 ids = self.ippToPspsDb.getItemsInThis ThisBox(ra, dec)159 ids = self.ippToPspsDb.getItemsInThisBox(minRA, maxRA, minDEC, maxDEC) 127 160 128 161 self.logger.info("| %5.1f | %5.1f | %9d | %9d |" % ( … … 132 165 len(ids))) 133 166 167 # print "box_id: ", box_id 168 134 169 if len(ids) > 0: self.ippToPspsDb.insertPending(box_id, batchType, ids) 135 136 dec = dec + self.skychunk.boxSize 137 dec = self.skychunk.minDec + self.skychunk.halfBox 138 ra = ra + self.skychunk.boxSize 139 170 # print "inserted pending" 171 ra = ra + 2*dR 172 # print "new ra: ", ra 173 174 dec = dec + 2*dD 175 if (dec > 85): raise 176 177 dR = 0.5*self.skychunk.boxSize / math.cos(math.radians(dec)) 178 ra = self.skychunk.minRa + dR 179 140 180 self.logger.info("+-------------+-------------+-------------+-------------+") 141 181
Note:
See TracChangeset
for help on using the changeset viewer.
