Index: trunk/ippToPsps/jython/stackbatch.py
===================================================================
--- trunk/ippToPsps/jython/stackbatch.py	(revision 39707)
+++ trunk/ippToPsps/jython/stackbatch.py	(revision 39728)
@@ -733,6 +733,16 @@
         # sersic fit has an extra parameter
         if (ippModelType == "PS_MODEL_SERSIC"):
-            sqlLine.group("a." + filter + model + "Nu",    "1 / (2.0 * b.EXT_PAR_07)")
-            sqlLine.group("a." + filter + model + "NuErr", "'0.1'") # this is not measured at the moment
+            testSQL = 'show columns FROM rSkyChip_xfit LIKE "EXT_PAR_07"'
+            have_ext_par_07 = 1
+            try:
+                rs = self.scratchDb.execute(sql)
+            except:
+                have_ext_par_07 = 0
+            if have_ext_par_07 == 1:
+                sqlLine.group("a." + filter + model + "Nu",    "1 / (2.0 * b.EXT_PAR_07)")
+                sqlLine.group("a." + filter + model + "NuErr", "'0.1'") # this is not measured at the moment
+
+            ### I think, if ippModelType = PS_MODEL_SERSIC, and EXT_PAR_07 does not exist, then Nu, Nerr = null
+            
 
         # missing these two fields?
@@ -1532,5 +1542,7 @@
         self.logger.infoPair("populating","StackToFrame") 
         self.populateStackToFrame()
-        
+        self.logger.infoPair("removing frameID"," duplicates")
+        self.scratchDb.execute("ALTER IGNORE TABLE StackToFrame ADD UNIQUE INDEX(frameID)")
+
         self.setMinMaxObjID(["StackObjectThin"])
 
