Index: trunk/ippToPsps/jython/forcedwarpbatch.py
===================================================================
--- trunk/ippToPsps/jython/forcedwarpbatch.py	(revision 38901)
+++ trunk/ippToPsps/jython/forcedwarpbatch.py	(revision 38902)
@@ -226,10 +226,10 @@
     def populateForcedWarpMeta(self,num):
         forcedWarpID = self.number[num]
-        self.logger.infoPair("Processing table", "ForcedWarpMeta_"+forcedWarpID)
-
-        sql = "CREATE TABLE ForcedWarpMeta_"+forcedWarpID+" LIKE ForcedWarpMeta"
-        try: self.scratchDb.execute(sql)
-        except: pass
-
+        tableName = "ForcedWarpMeta_" + forcedWarpID
+
+        self.logger.infoPair("Processing table", tableName)
+
+        sql = "CREATE TABLE " + tableName + " LIKE ForcedWarpMeta"
+        self.scratchDb.execute(sql)
 
         header   = self.header[num]
@@ -237,52 +237,52 @@
         photoCalID = str(self.scratchDb.getPhotoCalID(header['IMAGEID']))       
 
+        # XXX hard-wired platescale : 0.25
+        pltscale = 0.25
+        pltscale2 = pltscale * pltscale
+
+        psfFwhmMajor = pltscale * self.getKeyFloat(header, "%.8f", 'FWHM_MAJ')
+        psfFwhmMinor = pltscale * self.getKeyFloat(header, "%.8f", 'FWHM_MIN')
+        psfFWHM = 0.5*(psfFwhmMajor + psfFwhmMinor)
+
         psfmodel_name = self.getKeyValue(header, 'PSFMODEL')
         psfmodelID    = self.scratchDb.getFitModelID(psfmodel_name)
 
-        sqlLine = sqlUtility("INSERT INTO ForcedWarpMeta_"+forcedWarpID+" (")
-        #batchID (below)
-        #surveyID (below)
-        #filterdID (below)
-
-#        self.logger.infoPair("building sql ","ok")
-
-        sqlLine.group("forcedWarpID", str(forcedWarpID))
-#        self.logger.infoPair("building sql ","1")
-	## MEH adding projectionID since defined now -- want str for pre-0?
-	sqlLine.group("projectionID",  str(self.projectionID))
-        sqlLine.group("skyCellID",     str(self.skycellID[num])) 
-        sqlLine.group("photoCalID",    photoCalID)
-#        self.logger.infoPair("building sql ","2") 
-      
-#        self.logger.infoPair("building sql ","3")
-        sqlLine.group("analysisVer",           str(self.analysisVer[num]))
- #       self.logger.infoPair("building sql ","3")
-
-        sqlLine.group("expTime",self.expTime[num])
- #       self.logger.infoPair("building sql ","3")
-
-#        sqlLine.group("astroScat",        self.getKeyFloat(header, "%.8f", 'CERROR'))
-#        sqlLine.group("photoScat",             self.getKeyFloat(self.header, "%.8f", 'ZPT_ERR'));
-#no nastro
-#        sqlLine.group("nAstroRef",      self.getKeyValue(header, 'NASTRO'))
-#        sqlLine.group("nPhotoRef",      self.getKeyValue(header, 'NASTRO'))
+        sqlLine = sqlUtility("INSERT INTO " + tableName + " (")
+
+        # batchID (below)
+        # surveyID (below)
+        # filterdID (below)
+
+        sqlLine.group("forcedWarpID",   str(forcedWarpID))
+	sqlLine.group("projectionID",   str(self.projectionID[num]))
+        sqlLine.group("skyCellID",      str(self.skycellID[num])) 
+        sqlLine.group("photoCalID",     photoCalID)
+        sqlLine.group("analysisVer",    str(self.analysisVer[num]))
+        sqlLine.group("expTime",        self.expTime[num])
+# no astrometry calibration for forced warp
+#       sqlLine.group("astroScat",      self.getKeyFloat(header, "%.8f", 'CERROR'))
+#       sqlLine.group("nAstroRef",      self.getKeyValue(header, 'NASTRO'))
+#       sqlLine.group("nPhotoRef",      self.getKeyValue(header, 'NASTRO'))
+#       sqlLine.group("photoScat",      self.getKeyFloat(self.header, "%.8f", 'ZPT_ERR'));
         sqlLine.group("psfModelID",     psfmodelID)
-        sqlLine.group("psfFwhm_mean",   self.getKeyFloat(header, "%.8f", 'FWHM_MAJ'))
-        sqlLine.group("psfFwhm_max",    self.getKeyFloat(header, "%.8f", 'FW_MJ_UQ'))
-        sqlLine.group("photoZero",        self.getKeyFloat(self.header, "%.8f", 'FP.ZP'))
-        #photoColor -- how do I set this? it's also not set in stack meta
-        sqlLine.group("ctype1",                self.getKeyValue(header, 'CTYPE1'));
-        sqlLine.group("ctype2",                self.getKeyValue(header, 'CTYPE2'));
-        sqlLine.group("crval1",                self.getKeyFloat(header, "%.8f", 'CRVAL1'));
-        sqlLine.group("crval2",                self.getKeyFloat(header, "%.8f", 'CRVAL2'));
-        sqlLine.group("crpix1",                self.getKeyFloat(header, "%.8f", 'CRPIX1'));
-        sqlLine.group("crpix2",                self.getKeyFloat(header, "%.8f", 'CRPIX2'));
-        sqlLine.group("cdelt1",                self.getKeyFloat(header, "%.8e", 'CDELT1'));
-        sqlLine.group("cdelt2",                self.getKeyFloat(header, "%.8e", 'CDELT2'));
-        sqlLine.group("pc001001",              self.getKeyFloat(header, "%.8e", 'PC001001'));
-        sqlLine.group("pc001002",              self.getKeyFloat(header, "%.8e", 'PC001002'));
-        sqlLine.group("pc002001",              self.getKeyFloat(header, "%.8e", 'PC002001'));
-        sqlLine.group("pc002002",              self.getKeyFloat(header, "%.8e", 'PC002002'));
-
+        sqlLine.group("psfFWHM",        psfFWHM)
+        sqlLine.group("psfWidMajor",    psfFwhmMajor)
+        sqlLine.group("psfWidMinor",    psfFwhmMinor)
+        # sqlLine.group("psfFwhm_mean",   self.getKeyFloat(header, "%.8f", 'FWHM_MAJ'))
+        # sqlLine.group("psfFwhm_max",    self.getKeyFloat(header, "%.8f", 'FW_MJ_UQ'))
+        sqlLine.group("photoZero",      self.getKeyFloat(self.header, "%.8f", 'FP.ZP'))
+        # photoColor -- how do I set this? it's also not set in stack meta
+        sqlLine.group("ctype1",         self.getKeyValue(header, 'CTYPE1'));
+        sqlLine.group("ctype2",         self.getKeyValue(header, 'CTYPE2'));
+        sqlLine.group("crval1",         self.getKeyFloat(header, "%.8f", 'CRVAL1'));
+        sqlLine.group("crval2",         self.getKeyFloat(header, "%.8f", 'CRVAL2'));
+        sqlLine.group("crpix1",         self.getKeyFloat(header, "%.8f", 'CRPIX1'));
+        sqlLine.group("crpix2",         self.getKeyFloat(header, "%.8f", 'CRPIX2'));
+        sqlLine.group("cdelt1",         self.getKeyFloat(header, "%.8e", 'CDELT1'));
+        sqlLine.group("cdelt2",         self.getKeyFloat(header, "%.8e", 'CDELT2'));
+        sqlLine.group("pc001001",       self.getKeyFloat(header, "%.8e", 'PC001001'));
+        sqlLine.group("pc001002",       self.getKeyFloat(header, "%.8e", 'PC001002'));
+        sqlLine.group("pc002001",       self.getKeyFloat(header, "%.8e", 'PC002001'));
+        sqlLine.group("pc002002",       self.getKeyFloat(header, "%.8e", 'PC002002'));
 
         sql = sqlLine.make(") VALUES ( ", ")")
@@ -293,13 +293,13 @@
             raise
 
-            # note hardcoded pltscale
-        self.scratchDb.updateRecalStats("ForcedWarpMeta_"+forcedWarpID, header['IMAGEID'], "0.25");
-
-        self.scratchDb.updateAllRows("ForcedWarpMeta_"+forcedWarpID, "batchID", str(self.batchID))
-        self.scratchDb.updateAllRows("ForcedWarpMeta_"+forcedWarpID, "surveyID", str(self.surveyID))
-#        self.scratchDb.updateFilterID("ForcedWarpMeta", self.filterID)
-        self.scratchDb.updateFilterID("ForcedWarpMeta_"+forcedWarpID,self.filterName[num][0])
-        self.scratchDb.updateAllRows("ForcedWarpMeta_"+forcedWarpID, "processingVersion", str(self.skychunk.processingVersion))
-        #self.tablesToExport.append("ForcedWarpMeta")
+        # note hardcoded pltscale
+        self.scratchDb.updateRecalStats(tableName, header['IMAGEID'], "0.25");
+
+        self.scratchDb.updateAllRows(tableName, "batchID", str(self.batchID))
+        self.scratchDb.updateAllRows(tableName, "surveyID", str(self.surveyID))
+        # self.scratchDb.updateFilterID(tableName, self.filterID)
+        self.scratchDb.updateFilterID(tableName, self.filterName[num][0])
+        self.scratchDb.updateAllRows(tableName, "processingVersion", str(self.skychunk.processingVersion))
+        # self.tablesToExport.append("ForcedWarpMeta")
        
     '''
@@ -375,5 +375,5 @@
         sqlLine.group("FpsfQfPerfect",     "PSF_QF_PERFECT")
         sqlLine.group("FpsfChiSq",         "PSF_CHISQ")
-        sqlLine.group("FpsfLikelihood",    "psfLikelihood(EXT_NSIGMA)")
+#       sqlLine.group("FpsfLikelihood",    "psfLikelihood(EXT_NSIGMA)") -- deprecated in r38867 (not measured in FW cmfs)
         sqlLine.group("FmomentXX",         "MOMENTS_XX * PLTSCALE * PLTSCALE")
         sqlLine.group("FmomentXY",         "MOMENTS_XY * PLTSCALE * PLTSCALE")
Index: trunk/ippToPsps/jython/gpc1db.py
===================================================================
--- trunk/ippToPsps/jython/gpc1db.py	(revision 38901)
+++ trunk/ippToPsps/jython/gpc1db.py	(revision 38902)
@@ -516,6 +516,4 @@
         return fits
 
- 
-
     '''
     get diff stage cmf name
