Index: trunk/ippToPsps/jython/stackbatch.py
===================================================================
--- trunk/ippToPsps/jython/stackbatch.py	(revision 38988)
+++ trunk/ippToPsps/jython/stackbatch.py	(revision 38995)
@@ -1387,8 +1387,68 @@
     '''
     Imports IPP tables from FITS file
+
+    Accepts a regular expression filter so not all tables need to be imported
+    '''
+    def importIppTables(self, columns="*", filter=""):
+        if self.config.useOhanaMYSQLtoFITS:
+            if not self.importIppTablesOhana():
+                self.logger.errorPair("problem running", "importIppTablesOhana")
+                return False
+        else:
+            if not self.importIppTablesStilts(columns, filter):
+                self.logger.errorPair("problem running", "importIppTablesStilts")
+                return False
+
+        return True
+
+    '''
+    Imports IPP tables from FITS file
+    Accepts a regular expression to match the tables so not all tables need to be imported
+    '''
+    def importIppTablesOhana(self, columns="*", tableRE=""):
+        
+        self.logger.infoPair("Importing ST tables using ", "Ohana")
+
+        self.tablesLoaded = []
+
+        count = 0
+        for filter in self.filters:
+            if self.stackIDs[filter] <= 0:  
+                self.logger.infoPair("no files for filter" , filter) 
+                continue
+
+            fileName = self.fits[filter].getPath()
+            
+            self.logger.infoPair("using filename:",fileName)
+            
+            ## output table names need to have "filter" prepended.  
+            ## add this as an option
+            self.scratchDb.loadFITStoMYSQL(fileName, "-tableprefix " + filter)
+            ## XXX table = stilts.tpipe(table, cmd='addcol table_index $0')
+
+            # get the list of tables in this file:
+            try:
+                tables = stilts.treads(fileName)
+            except:
+                self.logger.errorPair("STILTS could not import from", fileName)
+                return False
+            
+            for table in tables:
+                self.logger.debugPair("Read IPP table", table.name)
+                myTable = filter + table.name.replace(".", "_")
+                self.tablesLoaded.append(myTable)
+                count += 1
+
+        self.logger.infoPair("Done. Imported", "%d tables" % count)
+        self.indexIppTables()
+
+        return True
+
+    '''
+    Imports IPP tables from FITS file
     Accepts a regular expression to match the tables so not all tables need to be imported
     (This regex feature is not currently used...)
     '''
-    def importIppTables(self, columns="*", tableRE=""):
+    def importIppTablesStilts(self, columns="*", tableRE=""):
         
         if self.config.retry: return True
