Changeset 753
- Timestamp:
- 11/29/05 12:06:57 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r734 r753 1 from asap import rcParams 1 from asap import rcParams, print_log 2 2 from numarray import logical_and 3 3 … … 109 109 (isinstance(self._cursor["t"],list) and \ 110 110 len(self._cursor["t"]) > maxrows ): 111 print "Scan to be plotted contains more than %d rows.\n" \ 111 from asap import asaplog 112 msg ="Scan to be plotted contains more than %d rows.\n" \ 112 113 "Selecting first %d rows..." % (maxrows,maxrows) 114 asaplog.push(msg) 113 115 self._cursor["t"] = range(maxrows) 114 116 self._plot_time(self._data[0], self._stacking) … … 120 122 self._plotter.set_limits(ylim=self._minmaxy) 121 123 self._plotter.release() 124 print_log() 122 125 return 123 126 … … 231 234 232 235 def _plot_scans(self, scans, colmode): 233 print "Plotting mode is scans across panels. Can only plot one row per scan." 236 from asap import asaplog 237 msg = "Plotting mode is scans across panels. Can only plot one row per scan." 238 asaplog.push(msg) 234 239 if colmode == 's': 235 240 return … … 330 335 self._plotter.set_axes('ylabel',ylab) 331 336 self._plotter.set_axes('title',tlab) 337 print_log() 332 338 return 333 339 … … 367 373 if self._panelling == "p": 368 374 polmode = self._polmode[ii] 369 eval(cdict.get(self._panelling)) 370 e lse:371 eval(cdict.get(self._panelling)) 375 376 eval(cdict.get(self._panelling)) 377 372 378 colvals = eval(cdict2.get(colmode)) 373 379 for j in colvals: … … 393 399 if colmode == 'p': 394 400 polmode = self._polmode[self._cursor["p"].index(j)] 401 395 402 i = j 396 403 eval(cdict.get(colmode)) 397 404 i = savei 405 if self._panelling == "p": 406 eval(cdict.get(self._panelling)) 398 407 x = None 399 408 y = None … … 485 494 'time' 'Time' 't': Times 486 495 """ 487 if not self.set_panelling(panelling): 488 print "Invalid mode" 489 return 490 if not self.set_stacking(stacking): 491 print "Invalid mode" 492 return 496 msg = "Invalid mode" 497 if not self.set_panelling(panelling) or \ 498 not self.set_stacking(stacking): 499 if rcParams['verbose']: 500 print msg 501 return 502 else: 503 raise TypeError(msg) 493 504 if self._data: self.plot() 494 505 return … … 694 705 """ 695 706 if not self._data: 696 print "Can only set cursor after a first call to plot()" 697 return 707 msg = "Can only set cursor after a first call to plot()" 708 if rcParams['verbose']: 709 print msg 710 return 711 else: 712 raise RuntimeError(msg) 698 713 699 714 n = self._data[0].nrow() … … 703 718 for i in row: 704 719 if i < 0 or i >= n: 705 print "Row index '%d' out of range" % i 706 return 720 msg = "Row index '%d' out of range" % i 721 if rcParams['verbose']: 722 print msg 723 return 724 else: 725 raise IndexError(msg) 707 726 self._cursor["t"] = row 708 727 … … 713 732 for i in beam: 714 733 if i < 0 or i >= n: 715 print "Beam index '%d' out of range" % i 716 return 734 msg = "Beam index '%d' out of range" % i 735 if rcParams['verbose']: 736 print msg 737 return 738 else: 739 raise IndexError(msg) 740 717 741 self._cursor["b"] = beam 718 742 … … 723 747 for i in IF: 724 748 if i < 0 or i >= n: 725 print "IF index '%d' out of range" %i 726 return 749 msg = "IF index '%d' out of range" %i 750 if rcParams['verbose']: 751 print msg 752 return 753 else: 754 raise IndexError(msg) 727 755 self._cursor["i"] = IF 728 756 … … 756 784 polmode.append("circular") 757 785 else: 758 print "Pol type '%s' not valid" %i 759 return 786 msg = "Pol type '%s' not valid" %i 787 if rcParams['verbose']: 788 print msg 789 return 790 else: 791 raise TypeError(msg) 760 792 elif 0 > i >= n: 761 793 print "Pol index '%d' out of range" %i 762 return 794 if rcParams['verbose']: 795 print msg 796 return 797 else: 798 raise IndexError(msg) 763 799 else: 764 800 pols.append(i) … … 779 815 """ 780 816 if not self._data: 781 print "Can only set cursor after a first call to plot()" 782 return 817 msg = "Can only set cursor after a first call to plot()" 818 if rcParams['verbose']: 819 print msg 820 return 821 else: 822 raise RuntimeError(msg) 783 823 if isinstance(mask, array): 784 824 self._usermask = mask
Note:
See TracChangeset
for help on using the changeset viewer.