Changeset 38902
- Timestamp:
- Oct 20, 2015, 3:23:48 PM (11 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 2 edited
-
forcedwarpbatch.py (modified) (4 diffs)
-
gpc1db.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/forcedwarpbatch.py
r38890 r38902 226 226 def populateForcedWarpMeta(self,num): 227 227 forcedWarpID = self.number[num] 228 self.logger.infoPair("Processing table", "ForcedWarpMeta_"+forcedWarpID)229 230 s ql = "CREATE TABLE ForcedWarpMeta_"+forcedWarpID+" LIKE ForcedWarpMeta"231 try: self.scratchDb.execute(sql) 232 except: pass233 228 tableName = "ForcedWarpMeta_" + forcedWarpID 229 230 self.logger.infoPair("Processing table", tableName) 231 232 sql = "CREATE TABLE " + tableName + " LIKE ForcedWarpMeta" 233 self.scratchDb.execute(sql) 234 234 235 235 header = self.header[num] … … 237 237 photoCalID = str(self.scratchDb.getPhotoCalID(header['IMAGEID'])) 238 238 239 # XXX hard-wired platescale : 0.25 240 pltscale = 0.25 241 pltscale2 = pltscale * pltscale 242 243 psfFwhmMajor = pltscale * self.getKeyFloat(header, "%.8f", 'FWHM_MAJ') 244 psfFwhmMinor = pltscale * self.getKeyFloat(header, "%.8f", 'FWHM_MIN') 245 psfFWHM = 0.5*(psfFwhmMajor + psfFwhmMinor) 246 239 247 psfmodel_name = self.getKeyValue(header, 'PSFMODEL') 240 248 psfmodelID = self.scratchDb.getFitModelID(psfmodel_name) 241 249 242 sqlLine = sqlUtility("INSERT INTO ForcedWarpMeta_"+forcedWarpID+" (") 243 #batchID (below) 244 #surveyID (below) 245 #filterdID (below) 246 247 # self.logger.infoPair("building sql ","ok") 248 249 sqlLine.group("forcedWarpID", str(forcedWarpID)) 250 # self.logger.infoPair("building sql ","1") 251 ## MEH adding projectionID since defined now -- want str for pre-0? 252 sqlLine.group("projectionID", str(self.projectionID)) 253 sqlLine.group("skyCellID", str(self.skycellID[num])) 254 sqlLine.group("photoCalID", photoCalID) 255 # self.logger.infoPair("building sql ","2") 256 257 # self.logger.infoPair("building sql ","3") 258 sqlLine.group("analysisVer", str(self.analysisVer[num])) 259 # self.logger.infoPair("building sql ","3") 260 261 sqlLine.group("expTime",self.expTime[num]) 262 # self.logger.infoPair("building sql ","3") 263 264 # sqlLine.group("astroScat", self.getKeyFloat(header, "%.8f", 'CERROR')) 265 # sqlLine.group("photoScat", self.getKeyFloat(self.header, "%.8f", 'ZPT_ERR')); 266 #no nastro 267 # sqlLine.group("nAstroRef", self.getKeyValue(header, 'NASTRO')) 268 # sqlLine.group("nPhotoRef", self.getKeyValue(header, 'NASTRO')) 250 sqlLine = sqlUtility("INSERT INTO " + tableName + " (") 251 252 # batchID (below) 253 # surveyID (below) 254 # filterdID (below) 255 256 sqlLine.group("forcedWarpID", str(forcedWarpID)) 257 sqlLine.group("projectionID", str(self.projectionID[num])) 258 sqlLine.group("skyCellID", str(self.skycellID[num])) 259 sqlLine.group("photoCalID", photoCalID) 260 sqlLine.group("analysisVer", str(self.analysisVer[num])) 261 sqlLine.group("expTime", self.expTime[num]) 262 # no astrometry calibration for forced warp 263 # sqlLine.group("astroScat", self.getKeyFloat(header, "%.8f", 'CERROR')) 264 # sqlLine.group("nAstroRef", self.getKeyValue(header, 'NASTRO')) 265 # sqlLine.group("nPhotoRef", self.getKeyValue(header, 'NASTRO')) 266 # sqlLine.group("photoScat", self.getKeyFloat(self.header, "%.8f", 'ZPT_ERR')); 269 267 sqlLine.group("psfModelID", psfmodelID) 270 sqlLine.group("psfFwhm_mean", self.getKeyFloat(header, "%.8f", 'FWHM_MAJ')) 271 sqlLine.group("psfFwhm_max", self.getKeyFloat(header, "%.8f", 'FW_MJ_UQ')) 272 sqlLine.group("photoZero", self.getKeyFloat(self.header, "%.8f", 'FP.ZP')) 273 #photoColor -- how do I set this? it's also not set in stack meta 274 sqlLine.group("ctype1", self.getKeyValue(header, 'CTYPE1')); 275 sqlLine.group("ctype2", self.getKeyValue(header, 'CTYPE2')); 276 sqlLine.group("crval1", self.getKeyFloat(header, "%.8f", 'CRVAL1')); 277 sqlLine.group("crval2", self.getKeyFloat(header, "%.8f", 'CRVAL2')); 278 sqlLine.group("crpix1", self.getKeyFloat(header, "%.8f", 'CRPIX1')); 279 sqlLine.group("crpix2", self.getKeyFloat(header, "%.8f", 'CRPIX2')); 280 sqlLine.group("cdelt1", self.getKeyFloat(header, "%.8e", 'CDELT1')); 281 sqlLine.group("cdelt2", self.getKeyFloat(header, "%.8e", 'CDELT2')); 282 sqlLine.group("pc001001", self.getKeyFloat(header, "%.8e", 'PC001001')); 283 sqlLine.group("pc001002", self.getKeyFloat(header, "%.8e", 'PC001002')); 284 sqlLine.group("pc002001", self.getKeyFloat(header, "%.8e", 'PC002001')); 285 sqlLine.group("pc002002", self.getKeyFloat(header, "%.8e", 'PC002002')); 286 268 sqlLine.group("psfFWHM", psfFWHM) 269 sqlLine.group("psfWidMajor", psfFwhmMajor) 270 sqlLine.group("psfWidMinor", psfFwhmMinor) 271 # sqlLine.group("psfFwhm_mean", self.getKeyFloat(header, "%.8f", 'FWHM_MAJ')) 272 # sqlLine.group("psfFwhm_max", self.getKeyFloat(header, "%.8f", 'FW_MJ_UQ')) 273 sqlLine.group("photoZero", self.getKeyFloat(self.header, "%.8f", 'FP.ZP')) 274 # photoColor -- how do I set this? it's also not set in stack meta 275 sqlLine.group("ctype1", self.getKeyValue(header, 'CTYPE1')); 276 sqlLine.group("ctype2", self.getKeyValue(header, 'CTYPE2')); 277 sqlLine.group("crval1", self.getKeyFloat(header, "%.8f", 'CRVAL1')); 278 sqlLine.group("crval2", self.getKeyFloat(header, "%.8f", 'CRVAL2')); 279 sqlLine.group("crpix1", self.getKeyFloat(header, "%.8f", 'CRPIX1')); 280 sqlLine.group("crpix2", self.getKeyFloat(header, "%.8f", 'CRPIX2')); 281 sqlLine.group("cdelt1", self.getKeyFloat(header, "%.8e", 'CDELT1')); 282 sqlLine.group("cdelt2", self.getKeyFloat(header, "%.8e", 'CDELT2')); 283 sqlLine.group("pc001001", self.getKeyFloat(header, "%.8e", 'PC001001')); 284 sqlLine.group("pc001002", self.getKeyFloat(header, "%.8e", 'PC001002')); 285 sqlLine.group("pc002001", self.getKeyFloat(header, "%.8e", 'PC002001')); 286 sqlLine.group("pc002002", self.getKeyFloat(header, "%.8e", 'PC002002')); 287 287 288 288 sql = sqlLine.make(") VALUES ( ", ")") … … 293 293 raise 294 294 295 # note hardcoded pltscale296 self.scratchDb.updateRecalStats( "ForcedWarpMeta_"+forcedWarpID, header['IMAGEID'], "0.25");297 298 self.scratchDb.updateAllRows( "ForcedWarpMeta_"+forcedWarpID, "batchID", str(self.batchID))299 self.scratchDb.updateAllRows( "ForcedWarpMeta_"+forcedWarpID, "surveyID", str(self.surveyID))300 # self.scratchDb.updateFilterID("ForcedWarpMeta", self.filterID)301 self.scratchDb.updateFilterID( "ForcedWarpMeta_"+forcedWarpID,self.filterName[num][0])302 self.scratchDb.updateAllRows( "ForcedWarpMeta_"+forcedWarpID, "processingVersion", str(self.skychunk.processingVersion))303 # self.tablesToExport.append("ForcedWarpMeta")295 # note hardcoded pltscale 296 self.scratchDb.updateRecalStats(tableName, header['IMAGEID'], "0.25"); 297 298 self.scratchDb.updateAllRows(tableName, "batchID", str(self.batchID)) 299 self.scratchDb.updateAllRows(tableName, "surveyID", str(self.surveyID)) 300 # self.scratchDb.updateFilterID(tableName, self.filterID) 301 self.scratchDb.updateFilterID(tableName, self.filterName[num][0]) 302 self.scratchDb.updateAllRows(tableName, "processingVersion", str(self.skychunk.processingVersion)) 303 # self.tablesToExport.append("ForcedWarpMeta") 304 304 305 305 ''' … … 375 375 sqlLine.group("FpsfQfPerfect", "PSF_QF_PERFECT") 376 376 sqlLine.group("FpsfChiSq", "PSF_CHISQ") 377 sqlLine.group("FpsfLikelihood", "psfLikelihood(EXT_NSIGMA)")377 # sqlLine.group("FpsfLikelihood", "psfLikelihood(EXT_NSIGMA)") -- deprecated in r38867 (not measured in FW cmfs) 378 378 sqlLine.group("FmomentXX", "MOMENTS_XX * PLTSCALE * PLTSCALE") 379 379 sqlLine.group("FmomentXY", "MOMENTS_XY * PLTSCALE * PLTSCALE") -
trunk/ippToPsps/jython/gpc1db.py
r38891 r38902 516 516 return fits 517 517 518 519 520 518 ''' 521 519 get diff stage cmf name
Note:
See TracChangeset
for help on using the changeset viewer.
