Changeset 1612 for branches/alma/python/scantable.py
- Timestamp:
- 08/05/09 17:48:43 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/python/scantable.py
r1603 r1612 6 6 from asap import linecatalog 7 7 from asap import _n_bools, mask_not, mask_and, mask_or 8 from taskinit import * 8 9 9 10 class scantable(Scantable): … … 55 56 if rcParams['verbose']: 56 57 asaplog.push(s) 57 print asaplog.pop().strip() 58 #print asaplog.pop().strip() 59 print_log() 58 60 return 59 61 raise IOError(s) … … 72 74 "asap table." % (filename) 73 75 if rcParams['verbose']: 74 print msg 76 #print msg 77 casalog.post( msg, 'WARN' ) 75 78 return 76 79 else: … … 120 123 msg = "File %s exists." % name 121 124 if rcParams['verbose']: 122 print msg 125 #print msg 126 casalog.post( msg, 'WARN' ) 123 127 return 124 128 else: … … 159 163 if not _is_valid(scanid): 160 164 if rcParams['verbose']: 161 print "Please specify a scanno to drop from the scantable" 165 #print "Please specify a scanno to drop from the scantable" 166 casalog.post( "Please specify a scanno to drop from the scantable", 'WARN' ) 162 167 return 163 168 else: … … 171 176 except ValueError: 172 177 if rcParams['verbose']: 173 print "Couldn't find any match." 178 #print "Couldn't find any match." 179 casalog.post( "Couldn't find any match.", 'WARN' ) 174 180 return 175 181 else: raise … … 184 190 except RuntimeError: 185 191 if rcParams['verbose']: 186 print "Couldn't find any match." 192 #print "Couldn't find any match." 193 casalog.post( "Couldn't find any match.", 'WARN' ) 187 194 else: 188 195 raise … … 209 216 if scanid is None: 210 217 if rcParams['verbose']: 211 print "Please specify a scan no or name to " \ 212 "retrieve from the scantable" 218 #print "Please specify a scan no or name to " \ 219 # "retrieve from the scantable" 220 casalog.post( "Please specify a scan no or name to retrieve from the scantable", 'WARN' ) 213 221 return 214 222 else: … … 239 247 msg = "Illegal scanid type, use 'int' or 'list' if ints." 240 248 if rcParams['verbose']: 241 print msg 249 #print msg 250 casalog.post( msg, 'WARN' ) 242 251 else: 243 252 raise TypeError(msg) 244 253 except RuntimeError: 245 if rcParams['verbose']: print "Couldn't find any match." 254 if rcParams['verbose']: 255 #print "Couldn't find any match." 256 casalog.post( "Couldn't find any match.", 'WARN' ) 246 257 else: raise 247 258 … … 272 283 msg = "Illegal file name '%s'." % (filename) 273 284 if rcParams['verbose']: 274 print msg 285 #print msg 286 casalog.post( msg, 'WARN' ) 275 287 else: 276 288 raise IOError(msg) … … 430 442 431 443 if rcParams['verbose']: 432 print "--------------------------------------------------" 433 print " ", stat, statunit 434 print "--------------------------------------------------" 435 print out 444 tmpfile='/tmp/tmp_casapy_asap_scantable_stats' 445 f=open(tmpfile,'w') 446 print >> f, "--------------------------------------------------" 447 print >> f, " ", stat, statunit 448 print >> f, "--------------------------------------------------" 449 print >> f, out 450 f.close() 451 f=open(tmpfile,'r') 452 x=f.readlines() 453 f.close() 454 for xx in x: 455 casalog.post( xx ) 436 456 #else: 437 457 #retval = { 'axesnames': ['scanno', 'beamno', 'ifno', 'polno', 'cycleno'], … … 513 533 out += "--------------------------------------------------\n" 514 534 if rcParams['verbose']: 515 print "--------------------------------------------------" 516 print " %s" % (label) 517 print "--------------------------------------------------" 518 print out 535 #print "--------------------------------------------------" 536 #print " %s" % (label) 537 #print "--------------------------------------------------" 538 #print out 539 casalog.post( "--------------------------------------------------" ) 540 casalog.post( " %s" % (label) ) 541 casalog.post( "--------------------------------------------------" ) 542 casalog.post( out ) 519 543 # disabled because the vector seems more useful 520 544 #retval = {'axesnames': axesnames, 'axes': axes, 'data': outvec} … … 703 727 msg = "Please specify a valid freq type. Valid types are:\n", valid 704 728 if rcParams['verbose']: 705 print msg 729 #print msg 730 casalog.post( msg, 'WARN' ) 706 731 else: 707 732 raise TypeError(msg) … … 722 747 except RuntimeError, msg: 723 748 if rcParams['verbose']: 724 print msg 749 #print msg 750 casalog.post( msg, 'WARN' ) 725 751 else: 726 752 raise … … 768 794 except RuntimeError, msg: 769 795 if rcParams['verbose']: 770 print msg 796 #print msg 797 casalog.post( msg, 'WARN' ) 771 798 return 772 799 else: raise … … 799 826 except RuntimeError, msg: 800 827 if rcParams['verbose']: 801 print msg 828 #print msg 829 casalog.post( msg, 'WARN' ) 802 830 return 803 831 else: raise … … 1118 1146 msg = "Illegal file name '%s'." % (filename) 1119 1147 if rcParams['verbose']: 1120 print msg 1148 #print msg 1149 casalog.post( msg, 'WARN' ) 1121 1150 else: 1122 1151 raise IOError(msg) … … 1176 1205 except RuntimeError, msg: 1177 1206 if rcParams['verbose']: 1178 print msg 1207 #print msg 1208 casalog.post( msg, 'WARN' ) 1179 1209 return 1180 1210 else: raise … … 1400 1430 except RuntimeError, msg: 1401 1431 if rcParams['verbose']: 1402 print msg 1432 #print msg 1433 casalog.post( msg, 'WARN' ) 1403 1434 return 1404 1435 else: … … 1477 1508 msg = "The fit failed, possibly because it didn't converge." 1478 1509 if rcParams['verbose']: 1479 print msg 1510 #print msg 1511 casalog.post( msg, 'WARN' ) 1480 1512 return 1481 1513 else: … … 1922 1954 fit = asapfit(self._getfit(row)) 1923 1955 if rcParams['verbose']: 1924 print fit 1956 #print fit 1957 casalog.post( '%s' %(fit) ) 1925 1958 return 1926 1959 else: … … 2029 2062 if rcParams['verbose']: 2030 2063 asaplog.push(msg) 2031 print asaplog.pop().strip() 2064 #print asaplog.pop().strip() 2065 casalog.post( asaplog.pop().strip(), 'WARN' ) 2032 2066 return 2033 2067 raise IOError(msg)
Note: See TracChangeset
for help on using the changeset viewer.