Changeset 38951 for trunk/ippToPsps/jython/detectionbatch.py
- Timestamp:
- Oct 23, 2015, 9:50:16 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/detectionbatch.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/detectionbatch.py
r38929 r38951 199 199 def populateImageMetaTable(self, ota, header): 200 200 201 # does this chip exist in the DVO image table? (if NOT, then skip it) 202 if not self.scratchDb.haveThisChip(self.imageIDs[ota], self.sourceIDs[ota]): 203 self.logger.info("| %5s | ------------- Chip not in DVO : rejecting ------------ |" % ota) 204 return False 205 201 206 # the supplied 'header' matches this chip 202 207 # self.header is the PHU header for this smf … … 231 236 zp = self.getKeyFloat(header, "%.8f", 'ZPT_OBS') 232 237 238 zpImage = self.scratchDb.getImageZeroPoint(self.imageIDs[ota]) 239 233 240 # XXX zp correction should come from DVO 234 detectionThreshold = detectionThreshold + zp - 2.5 * math.log10(expTime)241 detectionThreshold = detectionThreshold + zpImage - 2.5 * math.log10(expTime) 235 242 236 243 # insert image metadata into table … … 246 253 sqlLine.group("astroScat", astroscat) 247 254 sqlLine.group("photoScat", self.getKeyFloat(header, "%.8f", 'ZPT_ERR')) 248 sqlLine.group("photoZero", zp )255 sqlLine.group("photoZero", zpImage) 249 256 sqlLine.group("nAstroRef", self.getKeyValue(header, 'NASTRO')) 250 257 sqlLine.group("nPhotoRef", self.getKeyValue(header, 'NASTRO')) … … 629 636 630 637 # populate ImageMeta 631 self.populateImageMetaTable(chipname, header) 638 if not self.populateImageMetaTable(chipname, header): 639 self.logger.infoPair("skipping chip: ", chipname) 640 return False 641 632 642 self.updateImageID("ImageMeta_" + chipname, x, y) 633 643 … … 810 820 ota = x*10+y 811 821 812 813 822 self.logger.info("add psps unique p2 ids") 814 823 self.updatePspsUniqueIDs("Detection_" + chipname, ota) … … 901 910 if x==7 and y==7: continue 902 911 912 # skip chips which were not loaded 903 913 ota = "XY%d%d" % (x, y) 904 914 extension = ota + ".psf" 905 915 if extension not in self.tablesLoaded: continue 906 916 907 if self.populatePspsTablesChip(ota, x, y, results, tables): otaCount = otaCount + 1 917 # skip chips which had a problem (e.g., not in DVO) 918 if not self.populatePspsTablesChip(ota, x, y, results, tables): 919 if self.skipBatch: 920 self.logger.error("fatal problem for exposure, skipping") 921 return False 922 continue 923 924 otaCount = otaCount + 1 925 self.populateImageDetEffMetaTablePart2(ota) 926 927 extension = "Chip.psf" 928 if extension in self.tablesLoaded: 929 if not self.populatePspsTablesChip("Chip", 0, 0, results, tables): 930 print "--- skipped Chip.psf" 908 931 if self.skipBatch: 909 932 self.logger.error("fatal problem for exposure, skipping") 910 933 return False 911 912 self.populateImageDetEffMetaTablePart2(ota) 913 914 915 extension = "Chip.psf" 916 if extension in self.tablesLoaded: 917 if self.populatePspsTablesChip("Chip", 0, 0, results, tables): otaCount = otaCount + 1 918 if self.skipBatch: 919 self.logger.error("fatal problem for exposure, skipping") 920 return False 934 else: 935 otaCount = otaCount + 1 936 937 print "--- tried Chip.psf" 921 938 922 939 # print totals … … 931 948 self.logger.info("+-------+---------------+---------------+---------------+---------------+---------------+") 932 949 950 print "--- tried Chip.psf (2)" 951 933 952 # if we only have one table export, i.e. FrameMeta, then get out of here (skip batch, but do not abort) 934 953 if len(self.tablesToExport) == 1:
Note:
See TracChangeset
for help on using the changeset viewer.
