- Timestamp:
- 03/10/05 15:44:29 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r541 r554 31 31 self._idict,self._pdict, 32 32 self._sdict] 33 self._panels = rcParams['plotter.panelling'] 34 self._stacking = rcParams['plotter.stacking'] 33 self._panelling = None 34 self._stacking = None 35 self.set_panelling() 36 self.set_stacking() 37 print rcParams 38 print self._panelling, self._stacking 35 39 self._rows = None 36 40 self._cols = None … … 77 81 self._data = list(args) 78 82 self.set_cursor(refresh=False) 79 if self._panel s== 't':83 if self._panelling == 't': 80 84 maxrows = 9 81 85 if self._data[0].nrow() > maxrows: … … 84 88 self._cursor["t"] = range(maxrows) 85 89 self._plot_time(self._data[0], self._stacking) 86 elif self._panel s== 's':90 elif self._panelling == 's': 87 91 self._plot_scans(self._data, self._stacking) 88 92 else: … … 208 212 if self._rows and self._cols: 209 213 n = min(n,self._rows*self._cols) 210 self._plotter.set_panel s(rows=self._rows,cols=self._cols,214 self._plotter.set_panel(rows=self._rows,cols=self._cols, 211 215 nplots=n) 212 216 else: 213 self._plotter.set_panel s(rows=n,cols=0,nplots=n)217 self._plotter.set_panel(rows=n,cols=0,nplots=n) 214 218 for scan in scans: 215 219 self._plotter.palette(1) … … 282 286 283 287 def _plot_other(self,scans,colmode): 284 if colmode == self._panel s:288 if colmode == self._panelling: 285 289 return 286 290 cdict = {'b':'scan.setbeam(i)', … … 293 297 't': 'self._cursor["t"]'} 294 298 scan = scans[0] 295 n = eval(self._cdict.get(self._panel s))299 n = eval(self._cdict.get(self._panelling)) 296 300 ncol=1 297 301 if self._stacking is not None: … … 305 309 else: 306 310 self._plotter.set_panels(rows=n,cols=0,nplots=n) 307 panels = self._cursor[self._panel s]311 panels = self._cursor[self._panelling] 308 312 for i in panels: 309 313 self._plotter.palette(1) 310 314 polmode = "raw" 311 ii = self._cursor[self._panel s].index(i)315 ii = self._cursor[self._panelling].index(i) 312 316 if n>1: 313 317 self._plotter.subplot(ii) 314 if self._panel s== "p":318 if self._panelling == "p": 315 319 polmode = self._polmode[ii] 316 eval(cdict.get(self._panel s))320 eval(cdict.get(self._panelling)) 317 321 else: 318 eval(cdict.get(self._panel s))322 eval(cdict.get(self._panelling)) 319 323 colvals = eval(cdict2.get(colmode)) 320 324 for j in colvals: … … 323 327 savei = i 324 328 for k in cdict.keys(): 325 if k != self._panel s:329 if k != self._panelling: 326 330 sel = eval(cdict2.get(k)) 327 331 i = sel[0] … … 366 370 tlab = self._title[ii] 367 371 else: 368 tlab = self._ldict.get(self._panel s)+' '+str(i)372 tlab = self._ldict.get(self._panelling)+' '+str(i) 369 373 llab = scan._getsourcename(rowsel) 370 374 else: … … 372 376 tlab = self._title[ii] 373 377 else: 374 tlab = self._ldict.get(self._panel s)+' '+str(i)378 tlab = self._ldict.get(self._panelling)+' '+str(i) 375 379 if self._lmap and len(self._lmap) > 0: 376 380 llab = self._lmap[jj] … … 387 391 else: 388 392 llab = self._ldict.get(colmode)+' '+str(j) 389 if self._panel s== 'p':393 if self._panelling == 'p': 390 394 if polmode == "stokes": 391 395 tlab = scan._getpolarizationlabel(0,1,0) … … 424 428 'time' 'Time' 't': Times 425 429 """ 426 if not self.set_panel s(panelling):430 if not self.set_panelling(panelling): 427 431 print "Invalid mode" 428 432 return … … 433 437 return 434 438 435 def set_panels(self, what=None): 436 if not what: 437 what = rcParams['plotter.panelling'] 438 md = self._translate(what) 439 def set_panelling(self, what=None): 440 mode = what 441 if mode is None: 442 mode = rcParams['plotter.panelling'] 443 md = self._translate(mode) 439 444 if md: 440 self._panel s= md445 self._panelling = md 441 446 self._title = None 442 447 return True … … 460 465 461 466 def set_stacking(self, what=None): 462 if not what: 463 what = rcParams['plotter.stacking'] 464 md = self._translate(what) 467 mode = what 468 if mode is None: 469 mode = rcParams['plotter.stacking'] 470 md = self._translate(mode) 465 471 if md: 466 472 self._stacking = md … … 575 581 else: 576 582 for i in row: 577 if 0 >i >= n:583 if i < 0 or i >= n: 578 584 print "Row index '%d' out of range" % i 579 585 return … … 585 591 else: 586 592 for i in beam: 587 if 0 >i >= n:593 if i < 0 or i >= n: 588 594 print "Beam index '%d' out of range" % i 589 595 return … … 595 601 else: 596 602 for i in IF: 597 if 0 >i >= n:603 if i < 0 or i >= n: 598 604 print "IF index '%d' out of range" %i 599 605 return
Note:
See TracChangeset
for help on using the changeset viewer.