Index: trunk/ippToPsps/jython/gpc1db.py
===================================================================
--- trunk/ippToPsps/jython/gpc1db.py	(revision 35994)
+++ trunk/ippToPsps/jython/gpc1db.py	(revision 36201)
@@ -49,9 +49,9 @@
     NB this uses Bill's potentially temporary 'skycells' database when finding RA/Dec for stacks.
     '''
-    def getItemsInThisDVODbForThisStage(self, dvoDb, batchType, minRA=-999, maxRA=999, minDec=-999, maxDec=999):
+    def getItemsInThisDVODbForThisStage(self, dvoDb, batchType, minRA=-999, maxRA=999, minDec=-999, maxDec=999, tstart="0000-00-00 00:00:00", tend = "0000-00-00 00:00:00"):
 
         self.logger.debugPair("GPC1 RA range", "%.2f -> %.2f" % (minRA, maxRA))
         self.logger.debugPair("GPC1 Dec range", "%.2f -> %.2f" % (minDec, maxDec))
-
+        
         rows = []
 
@@ -80,5 +80,7 @@
                    AND addRun.state = 'full' \
                    AND decl BETWEEN RADIANS(" + str(minDec) + ") AND RADIANS(" + str(maxDec) + ") \
-                   AND ra BETWEEN RADIANS(" + str(minRA) + ") AND RADIANS(" + str(maxRA) + ")"
+                   AND ra BETWEEN RADIANS(" + str(minRA) + ") AND RADIANS(" + str(maxRA) + ") \
+                   AND dateobs >= '" + tstart + "'\
+                   AND dateobs <= '" + tend  + "'"
 
         elif batchType == "ST":       
