Changeset 38995 for trunk/ippToPsps/jython/stackbatch.py
- Timestamp:
- Oct 28, 2015, 8:29:33 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/stackbatch.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/stackbatch.py
r38988 r38995 1387 1387 ''' 1388 1388 Imports IPP tables from FITS file 1389 1390 Accepts a regular expression filter so not all tables need to be imported 1391 ''' 1392 def importIppTables(self, columns="*", filter=""): 1393 if self.config.useOhanaMYSQLtoFITS: 1394 if not self.importIppTablesOhana(): 1395 self.logger.errorPair("problem running", "importIppTablesOhana") 1396 return False 1397 else: 1398 if not self.importIppTablesStilts(columns, filter): 1399 self.logger.errorPair("problem running", "importIppTablesStilts") 1400 return False 1401 1402 return True 1403 1404 ''' 1405 Imports IPP tables from FITS file 1406 Accepts a regular expression to match the tables so not all tables need to be imported 1407 ''' 1408 def importIppTablesOhana(self, columns="*", tableRE=""): 1409 1410 self.logger.infoPair("Importing ST tables using ", "Ohana") 1411 1412 self.tablesLoaded = [] 1413 1414 count = 0 1415 for filter in self.filters: 1416 if self.stackIDs[filter] <= 0: 1417 self.logger.infoPair("no files for filter" , filter) 1418 continue 1419 1420 fileName = self.fits[filter].getPath() 1421 1422 self.logger.infoPair("using filename:",fileName) 1423 1424 ## output table names need to have "filter" prepended. 1425 ## add this as an option 1426 self.scratchDb.loadFITStoMYSQL(fileName, "-tableprefix " + filter) 1427 ## XXX table = stilts.tpipe(table, cmd='addcol table_index $0') 1428 1429 # get the list of tables in this file: 1430 try: 1431 tables = stilts.treads(fileName) 1432 except: 1433 self.logger.errorPair("STILTS could not import from", fileName) 1434 return False 1435 1436 for table in tables: 1437 self.logger.debugPair("Read IPP table", table.name) 1438 myTable = filter + table.name.replace(".", "_") 1439 self.tablesLoaded.append(myTable) 1440 count += 1 1441 1442 self.logger.infoPair("Done. Imported", "%d tables" % count) 1443 self.indexIppTables() 1444 1445 return True 1446 1447 ''' 1448 Imports IPP tables from FITS file 1389 1449 Accepts a regular expression to match the tables so not all tables need to be imported 1390 1450 (This regex feature is not currently used...) 1391 1451 ''' 1392 def importIppTables (self, columns="*", tableRE=""):1452 def importIppTablesStilts(self, columns="*", tableRE=""): 1393 1453 1394 1454 if self.config.retry: return True
Note:
See TracChangeset
for help on using the changeset viewer.
