Changeset 32106
- Timestamp:
- Aug 16, 2011, 8:34:32 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/detectionbatch.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/detectionbatch.py
r32061 r32106 363 363 Populates the Detection table for this OTA 364 364 ''' 365 def populateDetectionTable(self, ota ):365 def populateDetectionTable(self, ota, results): 366 366 367 367 pspsTableName = "Detection_" + ota … … 378 378 sql = "DELETE FROM " + ippTableName + " WHERE PSF_INST_MAG < -17.5" 379 379 self.scratchDb.execute(sql) 380 DELETED = BEFORE - self.scratchDb.getRowCount(ippTableName) 381 self.logger.infoPair("Saturated detections", "%d deleted" % DELETED) 380 #DELETED = BEFORE - self.scratchDb.getRowCount(ippTableName) 381 results['SATDET'] = BEFORE - self.scratchDb.getRowCount(ippTableName) 382 #self.logger.infoPair("Saturated detections", "%d deleted" % DELETED) 382 383 383 384 # insert all detections into table … … 442 443 443 444 # now delete bad flux and bad chip positions 444 self.scratchDb.reportAndDeleteRowsWithNULLS(pspsTableName, "instFlux")445 self.scratchDb.reportAndDeleteRowsWithNULLS(pspsTableName, "peakADU")445 results['NULLINSTFLUX'] = self.scratchDb.reportAndDeleteRowsWithNULLS(pspsTableName, "instFlux") 446 results['NULLPEAKADU'] = self.scratchDb.reportAndDeleteRowsWithNULLS(pspsTableName, "peakADU") 446 447 447 448 ''' … … 638 639 tables = [] 639 640 otaCount = 0 641 results = {} 642 self.logger.info("+-------+---------------+---------------+---------------+---------------+---------------+") 643 self.logger.info("| OTA | Sat Det | NULL instFlux | NULL peak ADU | NULL obj ID | Remainder |") 644 self.logger.info("+-------+---------------+---------------+---------------+---------------+---------------+") 640 645 for x in range(self.startX, self.endX): 641 646 for y in range(self.startY, self.endY): … … 650 655 if ota not in sourceIDs: continue 651 656 652 self.logger.infoTitle("Processing " + ota)657 #self.logger.infoTitle("Processing " + ota) 653 658 654 659 # populate remainder of tables 655 self.populateDetectionTable(ota )660 self.populateDetectionTable(ota, results) 656 661 657 662 # now add DVO IDs 658 663 self.updateDvoIDs("Detection_" + ota, sourceIDs[ota], imageIDs[ota]) 659 self.scratchDb.reportAndDeleteRowsWithNULLS("Detection_" + ota, "objID")664 results['NULLOBJID'] = self.scratchDb.reportAndDeleteRowsWithNULLS("Detection_" + ota, "objID") 660 665 self.updateImageID("Detection_" + ota, x, y) 661 666 self.populateLikelihoods("Detection_" + ota) 662 663 # check we have something in this Detection table 664 if self.scratchDb.getRowCount("Detection_" + ota) < 1: 665 self.logger.infoPair("Skipping empty table for ota", ota) 667 rowCount = self.scratchDb.getRowCount("Detection_" + ota) 668 self.logger.info("| %5s | %13d | %13d | %13d | %13d | %13d |", 669 ota, 670 results['SATDET'], 671 results['NULLINSTFLUX'], 672 results['NULLPEAKADU'], 673 results['NULLOBJID'], 674 rowCount) 675 676 # check we have something in this Detection table TODO add this to table above 677 if rowCount < 1: 678 self.logger.debugPair("Skipping empty table for ota", ota) 666 679 continue; 667 680 … … 683 696 otaCount = otaCount + 1 684 697 698 # TODO print totals here 699 self.logger.info("+-------+---------------+---------------+---------------+---------------+---------------+") 700 685 701 # if we only have one table export, i.e. FrameMeta, then get out of here 686 702 if len(self.tablesToExport) == 1:
Note:
See TracChangeset
for help on using the changeset viewer.
