Changeset 35369
- Timestamp:
- Apr 5, 2013, 6:16:49 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130307/ippToPsps/jython
- Files:
-
- 2 edited
-
detectionbatch.py (modified) (3 diffs)
-
scratchdb.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130307/ippToPsps/jython/detectionbatch.py
r35352 r35369 681 681 # store these for later 682 682 self.imageIDs[chipname] = header['IMAGEID'] 683 self.sourceIDs[chipname] = header['SOURCEID'] 683 684 684 685 # populate ImageMeta … … 702 703 # dictionary objects to hold imageIDs for later 703 704 self.imageIDs = {} 705 self.sourceIDs = {} 704 706 705 707 # loop through all OTAs and populate ImageMeta extensions … … 791 793 792 794 # does this chip exist in the DVO image table (if NOT, then skip it) 793 if not self.scratchDb.haveThisChip(self.imageIDs[chipname] ):795 if not self.scratchDb.haveThisChip(self.imageIDs[chipname], self.sourceIDs[chipname]): 794 796 self.logger.info("| %5s | ------------- Chip not in DVO : rejecting ------------ |" % chipname) 795 797 return False -
branches/eam_branches/ipp-20130307/ippToPsps/jython/scratchdb.py
r35352 r35369 370 370 Checks whether the given chipID is in the DVO Image table 371 371 ''' 372 def haveThisChip(self, imageID): 373 374 sql = "SELECT IMAGE_ID FROM " + self.dvoImagesTable + " WHERE IMAGE_ID = " + str(imageID) 375 376 try: 377 rs = self.executeQuery(sql) 378 rs.first() 372 def haveThisChip(self, imageID, sourceID): 373 374 sql = "SELECT EXTERN_ID FROM " \ 375 + self.dvoImagesTable + \ 376 " WHERE EXTERN_ID = " + str(imageID) + \ 377 " AND SOURCE_ID = " + str(sourceID) 378 379 try: 380 rs = self.executeQuery(sql) 381 382 if not rs: 383 print "missing result set for imageID query" 384 raise 385 386 # if no returned rows, return an error 387 if not rs.next(): 388 print "DVO lacks imageID ", imageID 389 print "sql: ", sql 390 return False 391 379 392 if rs.getInt(1) == int(imageID): 380 393 # print "DVO has imageID ", imageID 381 394 return True 395 382 396 else: 383 print "DVO lacks imageID", imageID397 print "DVO has wrong imageID? ", imageID 384 398 print "result was ", rs.getInt(1) 385 399 print "sql: ", sql 386 return False 400 raise 401 387 402 except: 388 403 print "DVO imageID query failed ", imageID 389 404 print "sql: ", sql 390 return False 391 405 raise 406 407 # how can I reach this? 392 408 return True 393 409
Note:
See TracChangeset
for help on using the changeset viewer.
