IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40271 for trunk


Ignore:
Timestamp:
Dec 12, 2017, 10:59:53 AM (9 years ago)
Author:
eugene
Message:

set up tests

Location:
trunk/ippToPsps/jython
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/ippjytest

    r39304 r40271  
    1414set JARDIR = $datadir/jar
    1515set JYDIR = $datadir/jython
    16 # set JYDIR = .
     16set JYDIR = .
    1717
    1818setenv IPPTOPSPS_DATA $datadir/ipptopsps
  • trunk/ippToPsps/jython/testCode.py

    r39134 r40271  
    4646    def importIppTables(self):
    4747
     48        if len(sys.argv) != 2:
     49            print "USAGE: ippjython testCode.py (filename)"
     50            os._exit(2)
     51
     52        self.filename = sys.argv[1]
     53
    4854        try:
    4955            tables = stilts.treads(self.filename)
     
    5460        for table in tables:
    5561
    56             print "import smf table " + table.name
     62            print "import table " + table.name
    5763
    5864            # need to generate an index on the IPP_IDET column
    5965            # table = stilts.tpipe(table, cmd='addcol table_index $0')
    60             table = stilts.tpipe(table, cmd='explodeall')
     66            try:
     67                table = stilts.tpipe(table, cmd='explodeall')
     68            except Exception,e:
     69                # print the error, wait a few secs then try again
     70                print str(e)
     71                return False
    6172
    62             print "read smf table " + table.name
     73            try:
     74                myColumns = table.columns()
     75            except Exception,e:
     76                # print the error, wait a few secs then try again
     77                print str(e)
     78                return False
     79
     80            print "got myColumns"
     81
     82            try:
     83                for column in myColumns:
     84                    print "got column " + column.name
     85            except Exception,e:
     86                # print the error, wait a few secs then try again
     87                print str(e)
     88                return False
     89
     90            print "read table " + table.name
    6391
    6492            # drop any previous tables before import
     
    6997
    7098            # IPP FITS files are littered with infinities, so remove these
    71             print "Removing Infinity values from all columns"
    72             table = stilts.tpipe(table, cmd='replaceval -Infinity null *')
    73             table = stilts.tpipe(table, cmd='replaceval Infinity null *')
    74 
    75             try:
    76                 table.write(self.url + '#' + table.name)
    77             except:
    78                 print "Problem writing table '" + table.name + "' to the database"
    79                 os._exit(4)
     99            ## print "Removing Infinity values from all columns"
     100            ## table = stilts.tpipe(table, cmd='replaceval -Infinity null *')
     101            ## table = stilts.tpipe(table, cmd='replaceval Infinity null *')
     102            ##
     103            ## try:
     104            ##     table.write(self.url + '#' + table.name)
     105            ## except:
     106            ##     print "Problem writing table '" + table.name + "' to the database"
     107            ##     os._exit(4)
    80108
    81109        return True
     
    103131            print "alt word1"
    104132       
     133        self.importIppTables()
    105134
    106135        # self.connectMysql(argv)
Note: See TracChangeset for help on using the changeset viewer.