Changeset 541 for trunk/python
- Timestamp:
- 03/08/05 15:29:17 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r525 r541 31 31 self._idict,self._pdict, 32 32 self._sdict] 33 self._panels = 's'33 self._panels = rcParams['plotter.panelling'] 34 34 self._stacking = rcParams['plotter.stacking'] 35 35 self._rows = None … … 73 73 self._data = list(args) 74 74 # reset cursor 75 self.set_cursor( )75 self.set_cursor(refresh=False) 76 76 else: 77 77 self._data = list(args) 78 self.set_cursor( )78 self.set_cursor(refresh=False) 79 79 if self._panels == 't': 80 if self._data[0].nrow() > 49: 81 print "Scan to be plotted contains more than 25 rows.\n \ 82 Can't plot that many panels..." 83 return 80 maxrows = 9 81 if self._data[0].nrow() > maxrows: 82 print "Scan to be plotted contains more than %d rows.\n" \ 83 "Selecting first %d rows..." % (maxrows,maxrows) 84 self._cursor["t"] = range(maxrows) 84 85 self._plot_time(self._data[0], self._stacking) 85 86 elif self._panels == 's': … … 155 156 elif polmode == "stokes2": 156 157 y = scan._getstokesspectrum(rowsel,True) 158 elif polmode == "circular": 159 y = scan._stokestopolspectrum(rowsel,False,-1) 157 160 else: 158 161 y = scan._getspectrum(rowsel) … … 170 173 elif polmode == "stokes2": 171 174 llab = scan._getpolarizationlabel(0,1,1) 175 elif polmode == "circular": 176 llab = scan._getpolarizationlabel(0,0,0) 172 177 else: 173 178 llab = scan._getpolarizationlabel(1,0,0) … … 207 212 else: 208 213 self._plotter.set_panels(rows=n,cols=0,nplots=n) 209 self._plotter.palette(1)210 214 for scan in scans: 215 self._plotter.palette(1) 211 216 if n > 1: 212 217 self._plotter.subplot(scans.index(scan)) … … 243 248 elif polmode == "stokes2": 244 249 y = scan._getstokesspectrum(rowsel,True) 250 elif polmode == "circular": 251 y = scan._stokestopolspectrum(rowsel,False,-1) 245 252 else: 246 253 y = scan._getspectrum(rowsel) … … 258 265 elif polmode == "stokes2": 259 266 llab = scan._getpolarizationlabel(0,1,1) 267 elif polmode == "circular": 268 llab = scan._getpolarizationlabel(0,0,0) 260 269 else: 261 270 llab = scan._getpolarizationlabel(1,0,0) … … 296 305 else: 297 306 self._plotter.set_panels(rows=n,cols=0,nplots=n) 298 self._plotter.palette(1)299 307 panels = self._cursor[self._panels] 300 308 for i in panels: 309 self._plotter.palette(1) 301 310 polmode = "raw" 302 311 ii = self._cursor[self._panels].index(i) … … 343 352 elif polmode == "stokes2": 344 353 y = scan._getstokesspectrum(rowsel,True) 354 elif polmode == "circular": 355 y = scan._stokestopolspectrum(rowsel,False,-1) 345 356 else: 346 357 y = scan._getspectrum(rowsel) … … 370 381 elif polmode == "stokes2": 371 382 llab = scan._getpolarizationlabel(0,1,1) 383 elif polmode == "circular": 384 llab = scan._getpolarizationlabel(0,0,0) 372 385 else: 373 386 llab = scan._getpolarizationlabel(1,0,0) … … 379 392 elif polmode == "stokes2": 380 393 tlab = scan._getpolarizationlabel(0,1,1) 394 elif polmode == "circular": 395 tlab = scan._getpolarizationlabel(0,0,0) 381 396 else: 382 397 tlab = scan._getpolarizationlabel(1,0,0) … … 525 540 return 526 541 527 def set_cursor(self, row=None,beam=None,IF=None,pol=None ):542 def set_cursor(self, row=None,beam=None,IF=None,pol=None, refresh=True): 528 543 """ 529 544 Specify a 'cursor' for plotting selected spectra. Time (rows), … … 539 554 ["I", "Q", "U", "V"] or 540 555 ["I", "Plinear", "Pangle", "V"] or 541 ["XX", "YY", "Real(XY)", "Imag(XY)"] 542 Circular polarisation are not handled yet.556 ["XX", "YY", "Real(XY)", "Imag(XY)"] or 557 ["RR", "LL"] 543 558 Example: 544 559 plotter.set_mode('pol','time') … … 589 604 dstokes2 = {"I":0,"Plinear":1,"Pangle":2,"V":3} 590 605 draw = {"XX":0, "YY":1,"Real(XY)":2, "Imag(XY)":3} 591 dcirc = { "RR":0,"LL":1 ,"RL":2,"LR":3}606 dcirc = { "RR":0,"LL":1}#,"Real(RL)":2,"Image(RL)":3} 592 607 593 608 if pol is None: … … 612 627 elif dcirc.has_key(i): 613 628 pols.append(dcirc.get(i)) 614 polmode.append("c ricular")629 polmode.append("circular") 615 630 else: 616 631 "Pol type '%s' not valid" %i … … 624 639 self._cursor["p"] = pols 625 640 self._polmode = polmode 626 if self._data : self.plot()641 if self._data and refresh: self.plot() 627 642 628 643
Note:
See TracChangeset
for help on using the changeset viewer.