Changeset 1989 for trunk/python
- Timestamp:
- 02/14/11 17:21:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r1984 r1989 83 83 from asap.casatoolbar import CustomToolbarTkAgg 84 84 return CustomToolbarTkAgg(self) 85 #from asap.casatoolbar import CustomFlagToolbarTkAgg 86 #return CustomFlagToolbarTkAgg(self) 85 87 else: return None 86 88 … … 340 342 'scan' 'Scan' 's': Scans 341 343 'time' 'Time' 't': Times 344 'row' 'Row' 'r': Rows 345 When either 'stacking' or 'panelling' is set to 'row', 346 the other parameter setting is ignored. 342 347 """ 343 348 msg = "Invalid mode" … … 345 350 not self.set_stacking(stacking): 346 351 raise TypeError(msg) 347 if self._panelling == 'r':348 self._stacking = '_r'349 elif self._stacking == 'r':350 self._panelling = '_r'352 #if self._panelling == 'r': 353 # self._stacking = '_r' 354 #if self._stacking == 'r': 355 # self._panelling = '_r' 351 356 if refresh and self._data: self.plot(self._data) 352 357 return … … 364 369 self._panelling = md 365 370 self._title = None 366 if md == 'r':367 self._stacking = '_r'371 #if md == 'r': 372 # self._stacking = '_r' 368 373 # you need to reset counters for multi page plotting 369 374 self._reset_counters() … … 401 406 self._stacking = md 402 407 self._lmap = None 403 if md == 'r':404 self._panelling = '_r'408 #if md == 'r': 409 # self._panelling = '_r' 405 410 # you need to reset counters for multi page plotting 406 411 self._reset_counters() … … 846 851 scan.set_selection(sel) 847 852 d = {'b': scan.getbeam, 's': scan.getscan, 848 #'i': scan.getif, 'p': scan.getpol, 't': scan._gettime,849 853 'i': scan.getif, 'p': scan.getpol, 't': scan.get_time, 850 'r': int , '_r': int}854 'r': int}#, '_r': int} 851 855 852 856 polmodes = dict(zip(self._selection.get_pols(), … … 859 863 if isinstance(nstack0, int): nstack = nstack0 860 864 else: nstack = len(nstack0) 865 # In case of row stacking 866 rowstack = False 867 titlemode = self._panelling 868 if self._stacking == "r" and self._panelling != "r": 869 rowstack = True 870 titlemode = '_r' 861 871 nptot = n 862 872 maxpanel, maxstack = 16,16 … … 867 877 asaplog.post('WARN') 868 878 nstack = min(nstack,maxstack) 869 #n = min(n,maxpanel)870 879 n = min(n-self._ipanel-1,maxpanel) 871 880 872 881 if n > 1: 873 882 ganged = rcParams['plotter.ganged'] … … 877 886 n = min(n,self._rows*self._cols) 878 887 self._plotter.set_panels(rows=self._rows,cols=self._cols, 879 # nplots=n,ganged=ganged)880 888 nplots=n,layout=self._panellayout,ganged=ganged) 881 889 else: 882 # self._plotter.set_panels(rows=n,cols=0,nplots=n,ganged=ganged)883 890 self._plotter.set_panels(rows=n,cols=0,nplots=n,layout=self._panellayout,ganged=ganged) 884 891 else: 885 # self._plotter.set_panels()886 892 self._plotter.set_panels(layout=self._panellayout) 887 893 #r = 0 … … 918 924 self._plotter.set_axes('xlabel', xlab) 919 925 self._plotter.set_axes('ylabel', ylab) 920 lbl = self._get_label(scan, r, self._panelling, self._title)921 #if self._panelling == 'r': lbl = ''926 #lbl = self._get_label(scan, r, self._panelling, self._title) 927 lbl = self._get_label(scan, r, titlemode, self._title) 922 928 if isinstance(lbl, list) or isinstance(lbl, tuple): 923 929 if 0 <= panelcount < len(lbl): … … 925 931 else: 926 932 # get default label 927 lbl = self._get_label(scan, r, self._panelling, None) 933 #lbl = self._get_label(scan, r, self._panelling, None) 934 lbl = self._get_label(scan, r, titlemode, None) 928 935 self._plotter.set_axes('title',lbl) 929 936 newpanel = True … … 936 943 937 944 #if (b > b0 or newpanel) and stackcount < nstack: 938 if stackcount < nstack and (newpanel or (a == a0 and b > b0)):945 if stackcount < nstack and (newpanel or rowstack or (a == a0 and b > b0)): 939 946 y = [] 940 947 if len(polmodes): … … 989 996 allxlim.sort() 990 997 self._plotter.subplots[panelcount-1]['axes'].set_xlim([allxlim[0],allxlim[-1]]) 991 # clear 992 allxlim =[] 998 if ganged: 999 allxlim = [allxlim[0],allxlim[-1]] 1000 else: 1001 # clear 1002 allxlim =[] 993 1003 994 1004 newpanel = False … … 998 1008 if (panelcount == n and stackcount == nstack) or (r == nr-1): 999 1009 # last panel -> autoscale y if ganged 1000 if rcParams['plotter.ganged'] and len(allylim) > 0: 1010 #if rcParams['plotter.ganged'] and len(allylim) > 0: 1011 if ganged and len(allylim) > 0: 1001 1012 allylim.sort() 1002 1013 self._plotter.set_limits(ylim=[allylim[0],allylim[-1]]) … … 1034 1045 lsorts = [] 1035 1046 for order in lorders: 1047 if order == "r": 1048 # don't sort if row panelling/stacking 1049 return None 1036 1050 ssort = d0[order] 1037 1051 if ssort: … … 1071 1085 d1 = {'b': scan.getbeamnos, 's': scan.getscannos, 1072 1086 'i': scan.getifnos, 'p': scan.getpolnos, 't': scan.ncycle, 1073 'r': scan.nrow , '_r': False}1087 'r': scan.nrow}#, '_r': False} 1074 1088 d2 = { 'b': self._selection.get_beams(), 1075 1089 's': self._selection.get_scans(), … … 1077 1091 'p': self._selection.get_pols(), 1078 1092 't': self._selection.get_cycles(), 1079 'r': False , '_r': 1}1093 'r': False}#, '_r': 1} 1080 1094 n = d2[self._panelling] or d1[self._panelling]() 1081 1095 nstack = d2[self._stacking] or d1[self._stacking]() 1096 # handle row panelling/stacking 1097 if self._panelling == 'r': 1098 nstack = 1 1099 elif self._stacking == 'r': 1100 n = 1 1082 1101 return n,nstack 1083 1102
Note:
See TracChangeset
for help on using the changeset viewer.