Changeset 947 for trunk/python
- Timestamp:
- 03/30/06 15:40:17 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r935 r947 1 from asap import rcParams, print_log 1 from asap import rcParams, print_log, selector 2 2 from numarray import logical_and 3 3 … … 36 36 self._usermask = [] 37 37 self._maskselection = None 38 from asap._asap import selector39 38 self._selection = selector() 40 39 … … 324 323 self._usermask = [] 325 324 self._maskselection = None 326 from asap._asap import selector327 325 if isinstance(selection, selector): 328 self._maskselection = {'b': selection. _getbeams(),329 's': selection. _getscans(),330 'i': selection. _getifs(),331 'p': selection. _getpols(),326 self._maskselection = {'b': selection.get_beams(), 327 's': selection.get_scans(), 328 'i': selection.get_ifs(), 329 'p': selection.get_pols(), 332 330 't': [] } 333 331 else: … … 363 361 364 362 def _plot(self, scan): 365 savesel = scan._getselection() 366 scan._setselection(self._selection) 363 savesel = scan.get_selection() 364 sel = savesel + self._selection 365 d0 = {'s': 'SCANNO', 'b': 'BEAMNO', 'i':'IFNO', 366 'p': 'POLNO', 'c': 'CYCLENO', 't' : 'TIME' } 367 order = [d0[self._panelling],d0[self._stacking]] 368 sel.set_order(order) 369 scan.set_selection(sel) 367 370 d = {'b': scan.getbeam, 's': scan.getscan, 368 371 'i': scan.getif, 'p': scan.getpol, 't': scan._gettime } 369 372 370 polmodes = dict(zip(self._selection. _getpols(),self._selection._getpoltypes()))373 polmodes = dict(zip(self._selection.get_pols(),self._selection.get_poltypes())) 371 374 n,nstack = self._get_selected_n(scan) 372 375 maxpanel, maxstack = 9,4 … … 474 477 pass#break 475 478 r+=1 # next row 476 477 scan. _setselection(savesel)479 #reset the selector to the scantable's original 480 scan.set_selection(savesel) 478 481 479 482 def set_selection(self, selection=None, refresh=True): 480 from asap._asap import selector 481 self._selection = selection or selector() 483 self._selection = isinstance(selection,selector) and selection or selector() 482 484 d0 = {'s': 'SCANNO', 'b': 'BEAMNO', 'i':'IFNO', 483 485 'p': 'POLNO', 'c': 'CYCLENO', 't' : 'TIME' } 484 486 order = [d0[self._panelling],d0[self._stacking]] 485 self._selection. _setorder(order)487 self._selection.set_order(order) 486 488 if self._data and refresh: self.plot(self._data) 487 489 … … 489 491 d1 = {'b': scan.nbeam, 's': scan.nscan, 490 492 'i': scan.nif, 'p': scan.npol, 't': scan.ncycle } 491 d2 = { 'b': len(self._selection. _getbeams()),492 's': len(self._selection. _getscans()),493 'i': len(self._selection. _getifs()),494 'p': len(self._selection. _getpols()),495 't': len(self._selection. _getcycles()) }493 d2 = { 'b': len(self._selection.get_beams()), 494 's': len(self._selection.get_scans()), 495 'i': len(self._selection.get_ifs()), 496 'p': len(self._selection.get_pols()), 497 't': len(self._selection.get_cycles()) } 496 498 n = d2[self._panelling] or d1[self._panelling]() 497 499 nstack = d2[self._stacking] or d1[self._stacking]() … … 499 501 500 502 def _get_label(self, scan, row, mode, userlabel=None): 501 pms = dict(zip(self._selection. _getpols(),self._selection._getpoltypes()))503 pms = dict(zip(self._selection.get_pols(),self._selection.get_poltypes())) 502 504 if len(pms): 503 505 poleval = scan._getpollabel(scan.getpol(row),pms[scan.getpol(row)])
Note:
See TracChangeset
for help on using the changeset viewer.