Changeset 31322 for trunk/ippToPsps/jython/batch.py
- Timestamp:
- Apr 19, 2011, 10:57:22 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/batch.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/batch.py
r31305 r31322 63 63 64 64 # get survey ID from init table 65 sql = "SELECT surveyID fromSurvey WHERE name = '" + self.survey + "'"65 sql = "SELECT surveyID FROM Survey WHERE name = '" + self.survey + "'" 66 66 try: 67 67 rs = self.localStmt.executeQuery(sql) … … 109 109 110 110 # create DVO table 111 self.createDvoTable() 111 self.createDvoTables() 112 113 114 ''' 115 Gets photcode (aka photoCalID from dvo table) 116 ''' 117 def getPhotoCalID(self): 118 119 photcode = -1 120 121 sql = "SELECT photcode FROM dvoMeta" 122 try: 123 rs = self.localStmt.executeQuery(sql) 124 rs.first() 125 photcode = rs.getInt(1) 126 except: 127 self.logger.exception("Unable to get photcode from dvo table") 128 129 130 return photcode 112 131 113 132 ''' … … 367 386 try: 368 387 self.localStmt.execute(sql) 369 except: 370 self.logger.warn("Index already in place on '" + column + "' for table '" + table + "'")388 except: pass 389 #self.logger.warn("Index already in place on '" + column + "' for table '" + table + "'") 371 390 372 391 … … 399 418 table = stilts.tpipe(table, cmd='replaceval -Infinity null *') 400 419 table = stilts.tpipe(table, cmd='replaceval Infinity null *') 401 #params = table.parameters()402 #print params403 420 404 421 try: … … 533 550 def updateDvoIDs(self, table): 534 551 535 self.logger.info("Updating table '" + table + "' with DVO IDs...") 536 sql = "UPDATE " + table + " AS a, dvo AS b SET \ 537 a.ippObjID = b.ippObjID, \ 538 a.objID = b.objID \ 539 WHERE a.ippDetectID = b.ippDetectID" 540 self.localStmt.execute(sql) 541 self.logger.info("...done") 542 552 self.logger.info("Not implemented in base-class") 543 553 544 554 ''' 545 555 Creates a table for for ID matching 546 556 ''' 547 def createDvoTable(self): 548 549 self.logger.info("Creating DVO table for ID matching") 550 sql = "DROP TABLE dvo" 551 self.localStmt.execute(sql) 552 sql = "CREATE TABLE dvo (ippDetectID BIGINT PRIMARY KEY, detectID BIGINT, ippObjID BIGINT, objID BIGINT)" 553 self.localStmt.execute(sql) 554 557 def createDvoTables(self): 558 559 self.logger.info("Creating DVO meta and detection tables") 560 sql = "DROP TABLE dvoMeta" 561 try: self.localStmt.execute(sql) 562 except: pass 563 564 sql = "DROP TABLE dvoDetection" 565 try: self.localStmt.execute(sql) 566 except: pass 567 568 sql = "CREATE TABLE dvoMeta ( \ 569 flags INT, \ 570 photcode INT \ 571 )" 572 573 try: self.localStmt.execute(sql) 574 except: 575 self.logger.error("Unable to create DVO meta-data database tablei") 576 577 sql = "CREATE TABLE dvoDetection ( \ 578 ippDetectID BIGINT PRIMARY KEY, \ 579 detectID BIGINT, \ 580 ippObjID BIGINT, \ 581 objID BIGINT \ 582 )" 583 584 try: self.localStmt.execute(sql) 585 except: 586 self.logger.error("Unable to create DVO detection database table") 555 587 556 588 ''' … … 582 614 self.logger.info("...done") 583 615 616 if self.getRowCount("dvoDetection") < 1: 617 self.logger.error("No DVO IDs found") 618 return False 619 620 return True 621
Note:
See TracChangeset
for help on using the changeset viewer.
