Index: trunk/ippToPsps/jython/gpc1db.py
===================================================================
--- trunk/ippToPsps/jython/gpc1db.py	(revision 33498)
+++ trunk/ippToPsps/jython/gpc1db.py	(revision 33499)
@@ -32,26 +32,25 @@
 
     '''
-    Gets a list of ids in this DVO database for this stage, could be cam or staticsky, for a box with defined center and side length
-    '''
-    def getIDsInThisDVODbForThisStageInThisBox(self, dvoDb, batchType, ra=180., dec=0., side=181.):
+    Gets a list of ids, ra and dec in this DVO database for this stage, could be cam or staticsky, for a box with defined center and side length
+    '''
+    def getItemsInThisDVODbForThisStageInThisBox(self, dvoDb, batchType, ra=180., dec=0., side=181.):
 
         halfSide = side/2.0
-        return self.getIDsInThisDVODbForThisStage(dvoDb, batchType, ra-halfSide, ra+halfSide, dec-halfSide, dec+halfSide)
-
-
-    '''
-    Gets a list of ids in this DVO database for this stage, could be cam or staticsky, and a box can be defined with equatorial coordinates
-    '''
-    def getIDsInThisDVODbForThisStage(self, dvoDb, batchType, minRA=-999, maxRA=999, minDec=-999, maxDec=999):
+        return self.getItemsInThisDVODbForThisStage(dvoDb, batchType, ra-halfSide, ra+halfSide, dec-halfSide, dec+halfSide)
+
+    '''
+    Gets a list of ids, ra and dec in this DVO database for this stage, could be cam or staticsky, and a box can be defined with equatorial coordinates
+    '''
+    def getItemsInThisDVODbForThisStage(self, dvoDb, batchType, minRA=-999, maxRA=999, minDec=-999, maxDec=999):
 
         self.logger.debugPair("GPC1 RA range", "%.2f -> %.2f" % (minRA, maxRA))
         self.logger.debugPair("GPC1 Dec range", "%.2f -> %.2f" % (minDec, maxDec))
 
-        ids = []
-
-        if batchType == "P2": # TODO define these someplace 
+        rows = [[],[],[]]
+
+        if batchType == "P2": # TODO define these some place 
 
             stage = "cam"
-            sql = "SELECT DISTINCT stage_id \
+            sql = "SELECT DISTINCT stage_id, DEGREES(ra), DEGREES(decl) \
                    FROM addRun \
                    JOIN minidvodbRun USING(minidvodb_name) \
@@ -73,5 +72,6 @@
 
             stage = "staticsky_multi"
-            sql = "SELECT DISTINCT stack_id FROM staticskyInput \
+            # no way to get RA/Decl for stacks, so default to provided min RA/Dec
+            sql = "SELECT DISTINCT stack_id, " + str(minRA) + ", " + str(minDec) + " FROM staticskyInput \
                    JOIN addRun ON(staticskyInput.sky_id = addRun.stage_id) \
                    JOIN minidvodbRun USING(minidvodb_name) \
@@ -85,14 +85,14 @@
         try:
             rs = self.executeQuery(sql)
-            while (rs.next()): ids.append(rs.getInt(1))
+            while (rs.next()): 
+               rows.append([rs.getInt(1), rs.getFloat(2), rs.getFloat(3)])
             rs.close()
         except:
             self.logger.exception("Can't query for ids in DVO")
-            return ids
-
-
-        self.logger.debug("Found %d items in DVO database '%s' for stage='%s'" % (len(ids), dvoDb, stage))
-
-        return ids
+            return rows
+
+        self.logger.debug("Found %d items in DVO database '%s' for stage='%s'" % (len(rows), dvoDb, stage))
+
+        return rows
 
     '''
