- Timestamp:
- Nov 10, 2015, 3:09:38 PM (11 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 3 edited
-
detectionbatch.py (modified) (2 diffs)
-
diffbatch.py (modified) (1 diff)
-
stackbatch.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/detectionbatch.py
r39094 r39097 372 372 sqlLine = sqlUtility("INSERT INTO " + tableName + "(") 373 373 374 nInjected = int(self.getKeyInt(header, 0, 'DETEFF.NUM')) 375 detectionThreshold = self.getKeyFloat(header, "%.8f", 'DETEFF.MAGREF') 376 expTime = self.getKeyFloat(header, "%.8f", 'EXPTIME') 377 zp = self.getKeyFloat(header, "%.8f", 'ZPT_OBS') 378 379 zpImage = self.scratchDb.getImageZeroPoint(self.imageIDs[ota]) 380 381 # XXX zp correction should come from DVO 382 detectionThreshold = detectionThreshold + zpImage + 2.5 * math.log10(expTime) 383 384 374 385 sqlLine.group("frameID", str(self.expID)) 375 sqlLine.group("magref", self.getKeyFloat(header,"%.8f","DETEFF.MAGREF")) 386 sqlLine.group("magref", detectionThreshold) 387 sqlLine.group("nInjected", nInjected) 376 388 sql = sqlLine.make(") VALUES ( ", ")") 377 389 … … 1063 1075 ## regex only works for -stilts import 1064 1076 regex = ".*" 1065 1077 1066 1078 ## for a quick test, just do the first chip: 1067 1079 if self.config.test and self.config.camera == "gpc1": -
trunk/ippToPsps/jython/diffbatch.py
r39094 r39097 507 507 header = self.header[num] 508 508 zpImage = self.getKeyFloat(header,"%.8f","FPA.ZP") 509 expTime = self.getKeyFloat(header, "%.8f", 'EXPTIME') 509 510 510 511 if zpImage == 0.0: 511 512 self.logger.infoPair("CZW If this value for the zeropoint is zero, the getImageZeroPoint call is likely still broken", str(zpImage)) 512 513 513 magref = self.getKeyFloat(header,"%.8f","DETEFF.MAGREF") + zpImage 514 515 deteffHeader = self.posFits[num].findAndReadHeader("SkyChip.deteff", self.config.test) 516 if not deteffHeader: 517 if self.config.test: self.logger.errorPair("No header found for Skychip.deteff for", filter) 518 return False 519 520 magref = self.getKeyFloat(deteffHeader,"%.8f","DETEFF.MAGREF") + zpImage + 2.5 * math.log10(expTime) 514 521 self.logger.infoPair("Found zeropoint and set magref", str(magref)) 522 523 nInjected = int(self.getKeyInt(deteffHeader, 0, 'DETEFF.NUM')) 524 515 525 516 526 sqlLine = sqlUtility("INSERT INTO " + ippTableName + "(") 517 527 sqlLine.group("diffImageID", str(diffSkyFileID)) 518 528 sqlLine.group("magref", magref) 529 sqlLine.group("nInjected", nInjected) 519 530 sql = sqlLine.make(") VALUES ( ", ")") 520 531 -
trunk/ippToPsps/jython/stackbatch.py
r39094 r39097 265 265 266 266 # Convert detectionThreshold to appropriate magnitudes 267 detectionThreshold = self.getKeyFloat(header, "%.8f", 'DETEFF.MAGREF') 267 # Grab this from the appropriate extension. 268 deteffHeader = self.fits[filter].findAndReadHeader("SkyChip.deteff", self.config.test) 269 if not deteffHeader: 270 if self.config.test: self.logger.errorPair("No header found for Skychip.deteff for", filter) 271 return False 272 273 detectionThreshold = self.getKeyFloat(deteffHeader, "%.8f", 'DETEFF.MAGREF') 268 274 expTime = self.getKeyFloat(header, "%.8f", 'EXPTIME') 269 275 zp = self.getKeyFloat(header, "%.8f", 'ZPT_OBS') … … 1168 1174 1169 1175 header = self.headerSet[filter] 1176 1177 # Convert detectionThreshold to appropriate magnitudes 1178 # Grab this from the appropriate extension. 1179 deteffHeader = self.fits[filter].findAndReadHeader("SkyChip.deteff", self.config.test) 1180 if not deteffHeader: 1181 if self.config.test: self.logger.errorPair("No header found for Skychip.deteff for", filter) 1182 return False 1183 1184 detectionThreshold = self.getKeyFloat(deteffHeader, "%.8f", 'DETEFF.MAGREF') 1185 expTime = self.getKeyFloat(header, "%.8f", 'EXPTIME') 1186 zp = self.getKeyFloat(header, "%.8f", 'ZPT_OBS') 1187 zpErr = self.getKeyFloat(header, "%.8f", 'ZPT_ERR') 1188 1189 # zp correction should comes from DVO (unless image is not in DVO) 1190 zpImage = self.scratchDb.getImageZeroPoint(stackID) 1191 if zpImage < 0.0: 1192 zpImage = zp 1193 1194 detectionThreshold = detectionThreshold + zpImage + 2.5 * math.log10(expTime) 1195 nInjected = int(self.getKeyInt(deteffHeader, 0, 'DETEFF.NUM')) 1196 1170 1197 zpImage = self.scratchDb.getImageZeroPoint(stackImageID) 1171 1198 if zpImage < 0.0: … … 1176 1203 sqlLine.group("stackImageID", str(stackImageID)) 1177 1204 sqlLine.group("magref", magref) 1205 sqlLine.group("nInjected", nInjected) 1178 1206 sql = sqlLine.make(") VALUES ( ", ")") 1179 1207
Note:
See TracChangeset
for help on using the changeset viewer.
