Changeset 39305 for trunk/ippToPsps/jython/stackbatch.py
- Timestamp:
- Jan 5, 2016, 3:34:49 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/stackbatch.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/stackbatch.py
r39250 r39305 274 274 pltscale2 = pltscale * pltscale 275 275 276 psfFwhmMajor = pltscale * self.getKeyFloat(header, "%.8f", 'FWHM_MAJ') 277 psfFwhmMinor = pltscale * self.getKeyFloat(header, "%.8f", 'FWHM_MIN') 278 psfFWHM = 0.5*(psfFwhmMajor + psfFwhmMinor) 276 psfFwhmMajor = self.getKeyFloat(header, "%.8f", 'FWHM_MAJ') 277 if (psfFwhmMajor != "NULL"): psfFwhmMajor *= pltscale 278 279 psfFwhmMinor = self.getKeyFloat(header, "%.8f", 'FWHM_MIN') 280 if (psfFwhmMinor != "NULL"): psfFwhmMinor *= pltscale 281 282 psfFWHM = "NULL" 283 if (psfFwhmMajor != "NULL") and (psfFwhmMinor != "NULL"): 284 psfFWHM = 0.5*(psfFwhmMajor + psfFwhmMinor) 279 285 280 286 psfmodel_name = self.getKeyValue(header, 'PSFMODEL') … … 283 289 ast_cdx = self.getKeyFloat(header, "%.8f",'AST_CDX') 284 290 ast_cdy = self.getKeyFloat(header, "%.8f",'AST_CDY') 285 astroscat = math.sqrt(ast_cdx**2 + ast_cdy**2) 291 292 astroscat = "NULL" 293 if (ast_cdx != "NULL") and (ast_cdy != "NULL"): 294 astroscat = math.sqrt(ast_cdx**2 + ast_cdy**2) 286 295 287 296 # Convert detectionThreshold to appropriate magnitudes 288 magref = self.magref[filter]289 expTime = self.expTime[filter]290 zp = self.zpImage[filter]291 zpErr = self.zpError[filter]297 magref = "NULL" if (self.magref[filter] == "NULL") else float(self.magref[filter]) 298 expTime = "NULL" if (self.expTime[filter] == "NULL") else float(self.expTime[filter]) 299 zp = "NULL" if (self.zpImage[filter] == "NULL") else float(self.zpImage[filter]) 300 zpErr = "NULL" if (self.zpError[filter] == "NULL") else float(self.zpError[filter]) 292 301 293 302 # zp correction should comes from DVO (unless image is not in DVO) 294 303 zpImage = self.scratchDb.getImageZeroPoint(stackID) 295 if zpImage < 0.0: 304 305 if (zpImage == "NULL"): 296 306 zpImage = zp 297 307 298 detectionThreshold = magref + zpImage + 2.5 * math.log10(expTime) 308 detectionThreshold = "NULL" 309 if (magref != "NULL") and (zpImage != "NULL") and (expTime != "NULL"): 310 detectionThreshold = magref + zpImage + 2.5 * math.log10(expTime) 299 311 300 312 # insert stack metadata into table … … 1040 1052 exptimeString = str(self.getKeyFloat(header, "%.5f", "EXPTIME")) 1041 1053 1054 ## this is a serious problem: not sure we have to handle it. 1055 if (exptimeString == "NULL"): 1056 print "**** serious error: EXPTIME is NULL (missing or NAN)" 1057 os._exit(4) 1058 1042 1059 # generate the sql to do the necessary ops on the columns 1043 1060 sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + cmfTable + " AS b SET ")
Note:
See TracChangeset
for help on using the changeset viewer.
