- Timestamp:
- Dec 12, 2017, 10:59:53 AM (9 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 2 edited
-
ippjytest (modified) (1 diff)
-
testCode.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/ippjytest
r39304 r40271 14 14 set JARDIR = $datadir/jar 15 15 set JYDIR = $datadir/jython 16 #set JYDIR = .16 set JYDIR = . 17 17 18 18 setenv IPPTOPSPS_DATA $datadir/ipptopsps -
trunk/ippToPsps/jython/testCode.py
r39134 r40271 46 46 def importIppTables(self): 47 47 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 48 54 try: 49 55 tables = stilts.treads(self.filename) … … 54 60 for table in tables: 55 61 56 print "import smftable " + table.name62 print "import table " + table.name 57 63 58 64 # need to generate an index on the IPP_IDET column 59 65 # 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 61 72 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 63 91 64 92 # drop any previous tables before import … … 69 97 70 98 # 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) 80 108 81 109 return True … … 103 131 print "alt word1" 104 132 133 self.importIppTables() 105 134 106 135 # self.connectMysql(argv)
Note:
See TracChangeset
for help on using the changeset viewer.
