Changeset 1897 for trunk/python
- Timestamp:
- 08/25/10 11:05:30 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r1862 r1897 51 51 self._fp = FontProperties() 52 52 self._panellayout = self.set_panellayout(refresh=False) 53 self._offset = None 53 54 54 55 def _translate(self, instr): … … 103 104 msg = "Input is not a scantable" 104 105 raise TypeError(msg) 105 if scan: self.set_data(scan,refresh=False) 106 if scan: 107 self.set_data(scan, refresh=False) 106 108 self._plot(self._data) 107 109 if self._minmaxy is not None: … … 293 295 # reset 294 296 self._reset() 295 msg = "A new scantable is set to the plotter. The masks and data selections are reset." 297 msg = "A new scantable is set to the plotter. "\ 298 "The masks and data selections are reset." 296 299 asaplog.push( msg ) 297 300 else: … … 385 388 return False 386 389 387 def set_range(self,xstart=None,xend=None,ystart=None,yend=None,refresh=True ):390 def set_range(self,xstart=None,xend=None,ystart=None,yend=None,refresh=True, offset=None): 388 391 """ 389 392 Set the range of interest on the abcissa of the plot … … 393 396 replotted based on the new parameter setting(s). 394 397 Otherwise,the parameter(s) are set without replotting. 398 offset: shift the abcissa by the given amount. The abcissa label will 399 have '(relative)' appended to it. 395 400 Note: 396 401 These become non-sensical when the unit changes. … … 398 403 399 404 """ 405 self._offset = offset 400 406 if xstart is None and xend is None: 401 407 self._minmaxx = None … … 804 810 self._usermask = [] 805 811 self._usermaskspectra = None 812 self._offset = None 806 813 self.set_selection(None, False) 807 814 … … 869 876 xlab = self._abcissa and self._abcissa[panelcount] \ 870 877 or scan._getabcissalabel() 878 if self._offset and not self._abcissa: 879 xlab += " (relative)" 871 880 ylab = self._ordinate and self._ordinate[panelcount] \ 872 881 or scan._get_ordinate_label() … … 895 904 if d[self._stacking](r) in self._maskselection[self._stacking]: 896 905 m = logical_and(m, self._usermask) 897 x = scan._getabcissa(r)898 906 from numpy import ma, array 907 x = array(scan._getabcissa(r)) 908 if self._offset: 909 x += self._offset 899 910 y = ma.masked_array(y,mask=logical_not(array(m,copy=False))) 900 911 if self._minmaxx is not None:
Note:
See TracChangeset
for help on using the changeset viewer.