Index: trunk/ippToPsps/jython/forcedgalaxybatch.py
===================================================================
--- trunk/ippToPsps/jython/forcedgalaxybatch.py	(revision 39008)
+++ trunk/ippToPsps/jython/forcedgalaxybatch.py	(revision 39027)
@@ -137,6 +137,13 @@
 
         for filter in filters:
-            filterID = self.scratchDb.getFilterId(filter[1])
-            photcode = self.scratchDb.getPhotoCalID("GPC1." + filter[1] + ".ForcedWarp")
+            filterID = self.scratchDb.getFilterID(filter[1])
+
+            photcodeName = "NONE"
+            if self.config.camera == "gpc1":
+                photcodeName = "GPC1." + filter[1] + ".ForcedWarp"
+            if self.config.camera == "simtest":
+                photcodeName = "SIMTEST." + filter[1] + ".ForcedWarp"
+
+            photcode = self.scratchDb.getPhotcodeByName(photcodeName)
 
             # This is going to need to join elsewhere to get all the fields?
@@ -161,5 +168,5 @@
             # sqlLine.group("a." + filter[1] + "GalDecErr",       "b.DEC_ERR")
 
-            sql = sqlLine.makeEquals("WHERE a.objID = b.OBJ_ID AND a.galModelType = b.MODEL_TYPE AND b.Photcode = " + photcode)
+            sql = sqlLine.makeEquals("WHERE a.objID = b.OBJ_ID AND a.galModelType = b.MODEL_TYPE AND b.Photcode = " + str(photcode))
 
             self.scratchDb.execute(sql)
@@ -192,5 +199,5 @@
         self.logger.infoPair("Adding 'row' columns to", "Forced Galaxy, cpt tables")
         self.scratchDb.addRowCountColumn("ForcedGalaxyShape", "row")
-        self.scratchDb.addRowCountColumn(cpsTableName, "row")
+        self.scratchDb.addRowCountColumn(cpqTableName, "row")
 
         self.logger.infoPair("generating unique ids for ","ForcedGalaxyShape")
@@ -221,3 +228,6 @@
     def populatePspsTables(self):
         
-        if not self.populateForcedGalaxyShapeTable(): return False
+        if not self.populateForcedGalaxyShapeTable(): 
+            return False
+            
+        return True
