Changeset 38999 for trunk/ippToPsps/jython/batch.py
- Timestamp:
- Oct 29, 2015, 10:50:19 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/batch.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/batch.py
r38995 r38999 466 466 ''' 467 467 Imports IPP tables from FITS file 468 469 Accepts a regular expression filter so not all tables need to be imported470 468 ''' 471 469 def importIppTablesOhana(self): … … 473 471 self.logger.infoPair("Importing IPP tables", "using fits_to_mysql") 474 472 473 count = 0 474 self.tablesLoaded = [] 475 476 fileName = self.fits.getPath() 477 478 # this option is equivalent to the stilts "addcol table_index $0" call 479 fitsOptions = " -sequence-column table_index" 480 fitsOptions += " -sequence-column-start 1" 481 482 ## *** actually write the FITS data to mysql 483 self.scratchDb.loadFITStoMYSQL(fileName, fitsOptions) 484 475 485 ## use stilts to get a list of the tables from the header 476 486 try: 477 tables = stilts.treads( self.fits.getPath())487 tables = stilts.treads(fileName) 478 488 except: 479 self.logger.errorPair("STILTS could not import from", self.fits.getPath()) 480 return False 481 482 self.scratchDb.loadFITStoMYSQL(self.fits.getPath()) 483 484 ## may need to do this with direct sql: 485 # table = stilts.tpipe(table, cmd='addcol table_index $0') 486 487 self.tablesLoaded = [] 488 489 count = 0 489 self.logger.errorPair("STILTS could not import from", fileName) 490 return False 491 490 492 for table in tables: 491 492 493 # example of listing all columns in a table: 493 494 ## print "-----table: " + table.name
Note:
See TracChangeset
for help on using the changeset viewer.
