Index: trunk/ippToPsps/jython/batch.py
===================================================================
--- trunk/ippToPsps/jython/batch.py	(revision 36722)
+++ trunk/ippToPsps/jython/batch.py	(revision 36723)
@@ -454,26 +454,46 @@
 
       filters = ["g","r","i","z","y"]
-
+      count = 0
       for f in filters:
+          skip = 0
           if (f == "g"):
-              fileName = self.gfits.getPath()
+              if self.gstackID > 0:  
+                  fileName = self.gfits.getPath()
+              else:
+                  skip = 1
           if (f == "r"):
-              fileName = self.rfits.getPath()
+              if self.rstackID > 0:
+                  fileName = self.rfits.getPath()
+              else:
+                  skip = 1
           if (f == "i"):
-              fileName = self.ifits.getPath()
+              if self.istackID > 0:
+                  fileName = self.ifits.getPath()
+              else:
+                  skip = 1
           if (f == "z"):
-              fileName = self.zfits.getPath()
+              if self.zstackID > 0:
+                  fileName = self.zfits.getPath()
+              else:
+                  skip = 1
           if (f == "y"):
-              fileName = self.yfits.getPath()
-
-
-          try:
+              if self.ystackID > 0:
+                  fileName = self.yfits.getPath()
+              else:
+                  skip = 1
+
+          if skip == 1:
+              self.logger.infoPair("no files for filter" , f) 
+          else:
+             self.logger.infoPair("using filename:",fileName)
+          
+             try:
               tables = stilts.treads(fileName)
-          except:
+             except:
               self.logger.errorPair("STILTS could not import from", fileName)
               return False
               
-          count = 0
-          for table in tables:
+             #count = 0
+             for table in tables:
               
               # print "import smf table ", table
@@ -481,5 +501,5 @@
               
               if not match: continue
-              self.logger.debugPair("Reading IPP table", table.name)
+              self.logger.infoPair("Reading IPP table", f + table.name)
               table = stilts.tpipe(table, cmd='addcol table_index $0')
                   
@@ -506,8 +526,8 @@
                   self.logger.exception("Problem writing table '" + f + table.name + "' to the database")
                       
-              self.logger.infoPair("Done. Imported", "%d tables" % count)
-              self.indexIppTables()
+      self.logger.infoPair("Done. Imported", "%d tables" % count)
+      self.indexIppTables()
                       
-              return True
+      return True
 
     '''
@@ -622,8 +642,10 @@
         # for OB, this imports object data from DVO
         if self.batchType == "ST":
+            self.logger.infoPair("did we get here","?")  
             if not self.importIppSTTables():
                 self.logger.errorPair("skipping this batch", "could not import ST IPP tables")
                 self.ippToPspsDb.updateProcessed(self.batchID, -1)
                 raise
+            self.logger.infoPair("we did the ST","yes")
         else:    
             # if not ST we do this 
@@ -636,5 +658,5 @@
                 self.ippToPspsDb.updateProcessed(self.batchID, -1)
                 raise
-
+        self.logger.infoPair("populatePspsTables","ok")
         if not self.populatePspsTables():
             if self.skipBatch:
