Changeset 1614 for branches/alma/python/scantable.py
- Timestamp:
- 08/06/09 15:48:39 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/python/scantable.py
r1613 r1614 6 6 from asap import linecatalog 7 7 from asap import _n_bools, mask_not, mask_and, mask_or 8 from taskinit import *9 8 10 9 class scantable(Scantable): … … 57 56 asaplog.push(s) 58 57 #print asaplog.pop().strip() 59 print_log( )58 print_log('ERROR') 60 59 return 61 60 raise IOError(s) … … 75 74 if rcParams['verbose']: 76 75 #print msg 77 casalog.post( msg, 'WARN' ) 76 asaplog.push( msg ) 77 print_log( 'ERROR' ) 78 78 return 79 79 else: … … 124 124 if rcParams['verbose']: 125 125 #print msg 126 casalog.post( msg, 'WARN' ) 126 asaplog.push( msg ) 127 print_log( 'ERROR' ) 127 128 return 128 129 else: … … 164 165 if rcParams['verbose']: 165 166 #print "Please specify a scanno to drop from the scantable" 166 casalog.post( "Please specify a scanno to drop from the scantable", 'WARN' ) 167 asaplog.push( 'Please specify a scanno to drop from the scantable' ) 168 print_log( 'ERROR' ) 167 169 return 168 170 else: … … 177 179 if rcParams['verbose']: 178 180 #print "Couldn't find any match." 179 casalog.post( "Couldn't find any match.", 'WARN' ) 181 print_log() 182 asaplog.push( "Couldn't find any match." ) 183 print_log( 'ERROR' ) 180 184 return 181 185 else: raise … … 191 195 if rcParams['verbose']: 192 196 #print "Couldn't find any match." 193 casalog.post( "Couldn't find any match.", 'WARN' ) 197 print_log() 198 asaplog.push( "Couldn't find any match." ) 199 print_log( 'ERROR' ) 194 200 else: 195 201 raise … … 218 224 #print "Please specify a scan no or name to " \ 219 225 # "retrieve from the scantable" 220 casalog.post( "Please specify a scan no or name to retrieve from the scantable", 'WARN' ) 226 asaplog.push( 'Please specify a scan no or name to retrieve from the scantable' ) 227 print_log( 'ERROR' ) 221 228 return 222 229 else: … … 248 255 if rcParams['verbose']: 249 256 #print msg 250 casalog.post( msg, 'WARN' ) 257 asaplog.push( msg ) 258 print_log( 'ERROR' ) 251 259 else: 252 260 raise TypeError(msg) … … 254 262 if rcParams['verbose']: 255 263 #print "Couldn't find any match." 256 casalog.post( "Couldn't find any match.", 'WARN' ) 264 print_log() 265 asaplog.push( "Couldn't find any match." ) 266 print_log( 'ERROR' ) 257 267 else: raise 258 268 … … 284 294 if rcParams['verbose']: 285 295 #print msg 286 casalog.post( msg, 'WARN' ) 296 asaplog.push( msg ) 297 print_log( 'ERROR' ) 287 298 else: 288 299 raise IOError(msg) … … 454 465 f.close() 455 466 for xx in x: 456 casalog.post( xx ) 467 asaplog.push( xx ) 468 print_log() 457 469 #else: 458 470 #retval = { 'axesnames': ['scanno', 'beamno', 'ifno', 'polno', 'cycleno'], … … 534 546 out += "--------------------------------------------------\n" 535 547 if rcParams['verbose']: 536 #print "--------------------------------------------------" 537 #print " %s" % (label) 538 #print "--------------------------------------------------" 539 #print out 540 casalog.post( "--------------------------------------------------" ) 541 casalog.post( " %s" % (label) ) 542 casalog.post( "--------------------------------------------------" ) 543 casalog.post( out ) 548 usr=os.environ['USER'] 549 tmpfile='/tmp/tmp_'+usr+'_casapy_asap_scantable_row_callback' 550 f=open(tmpfile,'w') 551 print >> f, "--------------------------------------------------" 552 print >> f, " %s" % (label) 553 print >> f, "--------------------------------------------------" 554 print >> f, out 555 f.close() 556 f=open(tmpfile,'r') 557 x=f.readlines() 558 f.close() 559 for xx in x: 560 asaplog.push( xx ) 561 print_log() 544 562 # disabled because the vector seems more useful 545 563 #retval = {'axesnames': axesnames, 'axes': axes, 'data': outvec} … … 729 747 if rcParams['verbose']: 730 748 #print msg 731 casalog.post( msg, 'WARN' ) 749 asaplog.push( msg ) 750 print_log( 'ERROR' ) 732 751 else: 733 752 raise TypeError(msg) … … 749 768 if rcParams['verbose']: 750 769 #print msg 751 casalog.post( msg, 'WARN' ) 770 print_log() 771 asaplog.push( msg ) 772 print_log( 'ERROR' ) 752 773 else: 753 774 raise … … 796 817 if rcParams['verbose']: 797 818 #print msg 798 casalog.post( msg, 'WARN' ) 819 print_log() 820 asaplog.push( msg ) 821 print_log( 'ERROR' ) 799 822 return 800 823 else: raise … … 828 851 if rcParams['verbose']: 829 852 #print msg 830 casalog.post( msg, 'WARN' ) 853 print_log() 854 asaplog.push( msg ) 855 print_log( 'ERROR' ) 831 856 return 832 857 else: raise … … 1148 1173 if rcParams['verbose']: 1149 1174 #print msg 1150 casalog.post( msg, 'WARN' ) 1175 asaplog.push( msg ) 1176 print_log( 'ERROR' ) 1151 1177 else: 1152 1178 raise IOError(msg) … … 1207 1233 if rcParams['verbose']: 1208 1234 #print msg 1209 casalog.post( msg, 'WARN' ) 1235 print_log() 1236 asaplog.push( msg ) 1237 print_log( 'ERROR' ) 1210 1238 return 1211 1239 else: raise … … 1432 1460 if rcParams['verbose']: 1433 1461 #print msg 1434 casalog.post( msg, 'WARN' ) 1462 print_log() 1463 asaplog.push( msg ) 1464 print_log( 'ERROR' ) 1435 1465 return 1436 1466 else: … … 1510 1540 if rcParams['verbose']: 1511 1541 #print msg 1512 casalog.post( msg, 'WARN' ) 1542 print_log() 1543 asaplog.push( msg ) 1544 print_log( 'ERROR' ) 1513 1545 return 1514 1546 else: … … 1956 1988 if rcParams['verbose']: 1957 1989 #print fit 1958 casalog.post( '%s' %(fit) ) 1990 asaplog.push( '%s' %(fit) ) 1991 print_log() 1959 1992 return 1960 1993 else: … … 2064 2097 asaplog.push(msg) 2065 2098 #print asaplog.pop().strip() 2066 casalog.post( asaplog.pop().strip(), 'WARN' )2099 print_log( 'ERROR' ) 2067 2100 return 2068 2101 raise IOError(msg)
Note: See TracChangeset
for help on using the changeset viewer.