Index: trunk/ippToPsps/jython/gpc1db.py
===================================================================
--- trunk/ippToPsps/jython/gpc1db.py	(revision 39165)
+++ trunk/ippToPsps/jython/gpc1db.py	(revision 39544)
@@ -286,4 +286,6 @@
         rs.close()
 
+        
+
         return addIDs
 
@@ -331,4 +333,5 @@
             self.logger.exception("Can't query for addIDs using :" + sql )
 
+
         addIDs = []
         while (rs.next()):
@@ -402,4 +405,6 @@
         if not rs.first():
             self.logger.errorPair("Can't query for", "forced warp meta data")
+            self.logger.errorPair("this failed", sql)
+
             os._exit(3)
 
@@ -506,4 +511,5 @@
         if len(files) < 1: return None
         fits = Fits(self.logger, self.config, files[0])
+        self.logger.infoPair("cmf file",files[0])
         return fits
 
@@ -651,4 +657,69 @@
 
         return imageIDs
+
+
+
+    '''
+    Gets a list of PSPS image IDs for this diff ID
+    '''
+    def getWarpSkyFileIDforThisAddIDforFW(self, addID):
+
+        self.logger.debug("Querying GPC1 for stage_extra1 for add ID: " + str(addID))
+
+
+        sql = "select warp_skyfile_id from addRun join fullForceInput \
+              on stage_id = ff_id and stage = 'fullforce' and stage_extra1 = warp_id \
+              join fullForceRun using (ff_id) \
+              join fullForceResult using (ff_id, warp_id) \
+              JOIN skycalRun using (skycal_id) \
+              join stackRun using (stack_id) \
+              join warpImfile using (warp_id, skycell_id) \
+              where add_id = "+str(addID)
+        try:
+            rs = self.executeQuery(sql)
+        except:
+            self.logger.infoPair("failed sql:",sql)
+            self.logger.exception("Can't query for imageIDs")
+            
+
+        #imageIDs = []
+        #while (rs.next()):
+        #    imageIDs.append(rs.getString(1))
+        #rs.close()
+
+        rs.first()
+        imageID=rs.getString(1)
+        rs.close()
+        return imageID
+
+    '''
+    Gets a list of PSPS image IDs for this diff ID
+    '''
+    def getWarpSkyFileIDforThisAddIDforST(self, addID):
+
+        self.logger.debug("Querying GPC1 for stage_extra1 for add ID: " + str(addID))
+
+
+        sql = "select warp_skyfile_id from addRun join skycalRun \
+              on stage_id = skycal_id and stage = 'skycal' \
+              join stackRun using (stack_id) \
+              join warpImfile using (warp_id, skycell_id) \
+              where add_id = "+str(addID)
+        try:
+            rs = self.executeQuery(sql)
+        except:
+            self.logger.infoPair("failed sql:",sql)
+            self.logger.exception("Can't query for imageIDs")
+            
+
+        #imageIDs = []
+        #while (rs.next()):
+        #    imageIDs.append(rs.getString(1))
+        #rs.close()
+
+        rs.first()
+        imageID=rs.getString(1)
+        rs.close()
+        return imageID
 
     
@@ -882,4 +953,5 @@
         # if we get here, then the cmf is readable, now check the stack_id
         fits = Fits(self.logger, self.config, files[0])
+        print self.logger.infoPair("cmf file",files[0])
         return fits
 
