IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 29, 2015, 10:50:19 AM (11 years ago)
Author:
eugene
Message:

generate the table_index columns; update diff and forcedwarp to use fits_to_mysql

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/batch.py

    r38995 r38999  
    466466    '''
    467467    Imports IPP tables from FITS file
    468 
    469     Accepts a regular expression filter so not all tables need to be imported
    470468    '''
    471469    def importIppTablesOhana(self):
     
    473471        self.logger.infoPair("Importing IPP tables", "using fits_to_mysql")
    474472
     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
    475485        ## use stilts to get a list of the tables from the header
    476486        try:
    477             tables = stilts.treads(self.fits.getPath())
     487            tables = stilts.treads(fileName)
    478488        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
    490492        for table in tables:
    491 
    492493            # example of listing all columns in a table:
    493494            ## print "-----table: " + table.name
Note: See TracChangeset for help on using the changeset viewer.