Index: trunk/ippToPsps/jython/gpc1db.py
===================================================================
--- trunk/ippToPsps/jython/gpc1db.py	(revision 37748)
+++ trunk/ippToPsps/jython/gpc1db.py	(revision 37749)
@@ -343,4 +343,35 @@
 
     '''
+    Gets a list of PSPS image IDs for this diff ID
+    '''
+    def getImageIDsForThisDiffID(self, diffID):
+
+        self.logger.debug("Querying GPC1 for image IDs for diff ID: " + str(diffID))
+
+        # JOIN stackInputSkyfile shoule use stack_id as well as warp_id, right? (maybe not -- the join to warp is first)
+        sql = "SELECT DISTINCT CONCAT(exp_id, SUBSTR(class_id, 3, 4)) FROM ( \
+               SELECT DISTINCT exp_id,class_id \
+               FROM warpSkyCellMap \
+               JOIN warpRun USING(warp_id) \
+               JOIN diffInputSkyfile on warp1 = warp_id \ 
+               WHERE diffInputSkyfile.diff_skyfile_id = " + str(diffID) + " AS a"
+
+        try:
+            rs = self.executeQuery(sql)
+        except:
+            self.logger.exception("Can't query for imageIDs")
+
+        imageIDs = []
+        while (rs.next()):
+            imageIDs.append(rs.getString(1))
+        rs.close()
+
+        return imageIDs
+
+    
+
+
+    
+    '''
     Gets some camera-stage meta data for this cam_id
     '''
