- Timestamp:
- Apr 3, 2013, 12:52:33 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130307/ippToPsps/jython/detectionbatch.py
r35171 r35352 212 212 )" 213 213 214 print "frame meta sql: ", sql214 # print "frame meta sql: ", sql 215 215 216 216 self.scratchDb.execute(sql) … … 607 607 WHERE b.imageID = " + str(imageID) + \ 608 608 " INTO OUTFILE '" + dumpFile + "'" 609 print "sql: ", sql 610 self.scratchDb.execute(sql) 609 610 try: self.scratchDb.execute(sql) 611 except: 612 self.logger.info("failed to select data for detectionCalib") 613 self.logger.infoPair("sql: ", sql) 614 raise 611 615 612 616 sql = "LOAD DATA INFILE '" + dumpFile + "' INTO TABLE " + tableName 613 print "sql: ", sql 614 self.scratchDb.execute(sql) 617 try: self.scratchDb.execute(sql) 618 except: 619 self.logger.info("failed to load data from infile for detectionCalib") 620 self.logger.infoPair("sql: ", sql) 621 raise 615 622 616 623 ''' … … 655 662 656 663 # load corresponding header into memory 657 header = self.fits.findAndReadHeader(extname )664 header = self.fits.findAndReadHeader(extname, self.config.test) 658 665 if not header: 659 self.logger.errorPair("No header found for chip", chipname) 666 # XXX There is no way to check if we SHOULD find a given 667 # chip. We have to accept the absence of the header as 668 # information that the chip is not available. This 669 # message is too verbose, only print in test mode 670 if self.config.test: self.logger.errorPair("No header found for chip", chipname) 660 671 return False 661 672 … … 773 784 # this is a bit crude: if the chip is not present, this test will fail and the chip 774 785 # will be (correctly) skipped. would be better to carry that information explicitly ("chip is missing") 775 if not self.scratchDb.astrometricSolutionOK(chipname): 776 self.logger.info("| %5s | ------------- Bad astrometric solution : rejecting ------------ |" % chipname) 786 787 # XXX keep this in or not? 788 # if not self.scratchDb.astrometricSolutionOK(chipname): 789 # self.logger.info("| %5s | ------------- Bad astrometric solution : rejecting ------------ |" % chipname) 790 # return False 791 792 # does this chip exist in the DVO image table (if NOT, then skip it) 793 if not self.scratchDb.haveThisChip(self.imageIDs[chipname]): 794 self.logger.info("| %5s | ------------- Chip not in DVO : rejecting ------------ |" % chipname) 777 795 return False 796 778 797 self.logger.info("populate stuff "); 779 798 # populate remainder of tables … … 803 822 self.totalNullObjID = self.totalNullObjID + results['NULLOBJID'] 804 823 self.totalDetections = self.totalDetections + rowCount 824 825 fractionKept = float(rowCount) / float(results['ORIGINALTOTAL']) 826 # print "kept ", str(fractionKept), " detections from ", chipname 827 828 if fractionKept < 0.8: 829 # print "Too many rejected detections (", str(fractionKept), ", fail on exposure for", chipname 830 self.logger.infoPair("Too many rejected detections, fail on exposure for", chipname) 831 self.skipBatch = True 832 return False; 833 805 834 #self.logger.info("updated totals") 806 835 # check we have something in this Detection table TODO add this to table above 807 836 if rowCount < 1: 808 self.logger.infoPair("Skipping empty table for chipname", chipname) 837 self.logger.infoPair("Empty table for chip, fail on exposure", chipname) 838 self.skipBatch = True 809 839 return False; 810 840 … … 849 879 850 880 # loop through all OTAs again to update with DVO IDs 881 self.skipBatch = False 851 882 self.validChips = [] 852 883 self.tablesToExport = [] … … 872 903 873 904 if self.populatePspsTablesChip(ota, x, y, results, tables): otaCount = otaCount + 1 905 if self.skipBatch: 906 self.logger.error("fatal problem for exposure, skipping") 907 return False 874 908 875 909 if self.populatePspsTablesChip("Chip", 0, 0, results, tables): otaCount = otaCount + 1 910 911 if self.skipBatch: 912 self.logger.error("fatal problem for exposure, skipping") 913 return False 876 914 877 915 # print totals
Note:
See TracChangeset
for help on using the changeset viewer.
