Changeset 36709
- Timestamp:
- Apr 30, 2014, 4:28:10 PM (12 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/gpc1db.py
r36697 r36709 87 87 88 88 stage = "skycal" 89 sql = "SELECT DISTINCT s tack_id, radeg, decdeg FROM skycalRun \89 sql = "SELECT DISTINCT sky_id, radeg, decdeg FROM skycalRun \ 90 90 JOIN addRun ON(skycalRun.skycal_id = addRun.stage_id) \ 91 91 JOIN minidvodbRun USING(minidvodb_name) \ … … 499 499 500 500 501 ''' 502 grabs the stackID for a particular skyId, filter, and dvodb 503 the mapping of stack_id from sky_id is not unique unless 504 joined to the dvodb 505 ''' 506 def getStackIDsFromSkyID(self,dvoDb,skyID,filter): 507 508 self.logger.infoPair("finding stack_ids from gpc1 for sky_id ", skyID) 509 510 sql = "SELECT DISTINCT stack_id from skycalRun \ 511 JOIN addRun ON(skycalRun.skycal_id = addRun.stage_id) \ 512 JOIN minidvodbRun USING(minidvodb_name) \ 513 JOIN minidvodbProcessed USING(minidvodb_id) \ 514 JOIN mergedvodbRun USING(minidvodb_id) \ 515 JOIN mergedvodbProcessed USING(merge_id) \ 516 JOIN stackRun USING (stack_id) \ 517 WHERE mergedvodbRun.mergedvodb = '" + dvoDb + "' \ 518 AND minidvodbRun.state = 'merged' \ 519 AND minidvodbProcessed.fault = 0 \ 520 AND mergedvodbRun.state = 'full' \ 521 AND mergedvodbProcessed.fault = 0 \ 522 AND addRun.stage = 'skycal' \ 523 AND addRun.state = 'full' \ 524 AND filter = '" + filter + "' \ 525 AND sky_id = '" + skyID + "'" 526 527 try: 528 rs = self.executeQuery(sql) 529 while (rs.next()): 530 rows.append([rs.getInt(1)]) 531 rs.close() 532 except: 533 self.logger.exception("can't query for stackid in DVO") 534 self.logger.infoPair("failed sql:", sql) 535 return rows 536 537 self.logger.infoPair("number of stackIDs found ", len(rows)) 538 return rows -
trunk/ippToPsps/jython/loader.py
r36697 r36709 234 234 # loop round IDs of all items to be processed 235 235 self.ippToPspsDb.lockBatchTable() 236 self.logger.infoPair("heather:","lockbatchtable")236 #self.logger.infoPair("heather:","lockbatchtable") 237 237 unattemptedCount = 0 238 238 for id in ids: 239 self.logger.infoPair("heather:","in ids")240 self.logger.infoPair("heather:id",str(id))239 #self.logger.infoPair("heather:","in ids") 240 #self.logger.infoPair("heather:id",str(id)) 241 241 batchID = self.ippToPspsDb.createNewBatch(batchType, id) 242 self.logger.infoPair("heather:","creatednewbatch")243 self.logger.infoPair("heather:batchId", str(batchID))242 #self.logger.infoPair("heather:","creatednewbatch") 243 #self.logger.infoPair("heather:batchId", str(batchID)) 244 244 if batchID < 0: 245 245 unattemptedCount += 1 246 246 continue 247 self.logger.infoPair("heather:","passed logic")247 #self.logger.infoPair("heather:","passed logic") 248 248 self.ippToPspsDb.unlockTables() 249 self.logger.infoPair("heather:","unlock table")249 #self.logger.infoPair("heather:","unlock table") 250 250 self.ippToPspsDb.deletePendingItem(batchType, id) 251 self.logger.infoPair("heather:","deleted pending item")251 #self.logger.infoPair("heather:","deleted pending item") 252 252 253 253 # catch any raised exceptions in batch constructors 254 254 try: 255 255 if batchType == "P2": 256 self.logger.infoPair("defining P2 batch for cam_id:",id) 256 257 batch = DetectionBatch(self.logger, 257 258 self.config, … … 264 265 useFullTables) 265 266 elif batchType == "ST": 267 self.logger.infoPair("defining ST batch for sky_id:",id) 266 268 batch = StackBatch(self.logger, 267 269 self.config, … … 328 330 batchID, 329 331 useFullTables) 330 332 331 333 batch.run() 332 334 -
trunk/ippToPsps/jython/stackbatch.py
r36706 r36709 37 37 ippToPspsDb, 38 38 scratchDb, 39 s tackID,39 skyID, 40 40 batchID, 41 41 useFullTables): … … 48 48 ippToPspsDb, 49 49 scratchDb, 50 s tackID,50 skyID, 51 51 batchID, 52 52 "ST", 53 gpc1Db.getStackStageCmf(skychunk.dvoLabel, stackID), 53 "", 54 #gpc1Db.getStackStageCmf(skychunk.dvoLabel, stackID), 54 55 useFullTables) 55 56 56 57 # self.printline = 0 57 58 # # self.testprint() 58 59 self.logger.infoPair("did I get", "here"); 59 60 self.stackType = "DEEP_STACK" # TODO 60 61 … … 917 918 ''' 918 919 def populatePspsTables(self): 919 920 self.infoPair("starting","populatePspsTables"); 920 921 self.skipBatch = False 921 922 if not self.useFullTables: 923 if not self.getIDsFromDVO(): 924 return False 925 #self.logger.infoPair("populating","StackMeta") 926 self.populateStackMeta() 927 #self.logger.infoPair("populating","StackObject") 928 self.populateStackObject() 929 930 if self.stackType != "NIGHTLY_STACK": 931 #self.logger.infoPair("populating","StackModelFit") 932 self.populateStackModelFit() 933 #self.logger.infoPair("populating","StackApFlx") 934 self.populateStackApFlx() 935 #self.logger.infoPair("populating","StackToImage") 936 self.populateStackToImage() 937 #self.logger.infoPair("populating","StackObjectCalib") 938 self.populateStackObjectCalib() 939 940 self.setMinMaxObjID(["StackObject"]) 922 923 # HAF everything is commented out for now with ## 924 ##if not self.useFullTables: 925 ## if not self.getIDsFromDVO(): 926 ## return False 927 ##self.logger.infoPair("populating","StackMeta") 928 ##self.populateStackMeta() 929 ##self.logger.infoPair("populating","StackObject") 930 ##self.populateStackObject() 931 932 ##if self.stackType != "NIGHTLY_STACK": 933 ##self.logger.infoPair("populating","StackModelFit") 934 ##self.populateStackModelFit() 935 ##self.logger.infoPair("populating","StackApFlx") 936 ##self.populateStackApFlx() 937 ##self.logger.infoPair("populating","StackToImage") 938 ##self.populateStackToImage() 939 ##self.logger.infoPair("populating","StackObjectCalib") 940 ##self.populateStackObjectCalib() 941 942 ##self.setMinMaxObjID(["StackObject"]) 941 943 942 if self.totalDetections < 1:943 944 self.logger.error("No detections to publish")945 return False946 944 ##if self.totalDetections < 1: 945 946 ##self.logger.error("No detections to publish") 947 ##return False 948 self.infoPair("finishing","populatePspsTables"); 947 949 return True 948 950
Note:
See TracChangeset
for help on using the changeset viewer.
