Changeset a2c38de in sasview
- Timestamp:
- Jan 19, 2009 10:20:14 AM (16 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- ffd23b5
- Parents:
- 3dc83be
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/AnnulusSlicer.py
rbd1d9d9 ra2c38de 6 6 # 7 7 8 8 9 9 # Debug printout 10 10 from sans.guicomm.events import StatusEvent … … 26 26 self.markers = [] 27 27 self.axes = axes 28 self.qmax = self.base.data2D.xmax 28 self.base= base 29 self.qmax = min(math.fabs(self.base.data2D.xmax),math.fabs(self.base.data2D.xmin)) #must be positive 29 30 self.connect = self.base.connect 30 31 32 31 33 ## Number of points on the plot 32 34 self.nbins = 20 33 35 36 #Cursor position of Rings (Left(-1) or Right(1)) 37 self.xmaxd=self.base.data2D.xmax 38 self.xmind=self.base.data2D.xmin 39 40 #self.sign=1 41 42 if (self.xmaxd+self.xmind)>0: 43 self.sign=1 44 else: 45 self.sign=-1 46 34 47 # Inner circle 35 self.inner_circle = RingInteractor(self, self.base.subplot, zorder=zorder, r=self.qmax/2.0 )48 self.inner_circle = RingInteractor(self, self.base.subplot, zorder=zorder, r=self.qmax/2.0,sign=self.sign) 36 49 self.inner_circle.qmax = self.qmax 37 self.outer_circle = RingInteractor(self, self.base.subplot, zorder=zorder+1, r=self.qmax/1.8 )50 self.outer_circle = RingInteractor(self, self.base.subplot, zorder=zorder+1, r=self.qmax/1.8,sign=self.sign) 38 51 self.outer_circle.qmax = self.qmax*1.2 39 52 #self.outer_circle.set_cursor(self.base.qmax/1.8, 0) … … 45 58 # Bind to slice parameter events 46 59 self.base.parent.Bind(SlicerParameters.EVT_SLICER_PARS, self._onEVT_SLICER_PARS) 47 60 48 61 49 62 def _onEVT_SLICER_PARS(self, event): … … 107 120 108 121 from DataLoader.manipulations import SectorPhi 109 radius = math.sqrt(math.pow(self.qmax,2)+math.pow(self.qmax,2))110 rmin= self.inner_circle.get_radius()111 rmax = self.outer_circle.get_radius()122 radius = self.qmax#math.sqrt(math.pow(self.qmax,2)+math.pow(self.qmax,2)) 123 rmin= math.fabs(self.inner_circle.get_radius()) 124 rmax = math.fabs(self.outer_circle.get_radius()) 112 125 phi_min=-math.pi 113 126 phi_max=math.pi … … 208 221 Select an annulus through a 2D plot 209 222 """ 210 def __init__(self,base,axes,color='black', zorder=5, r=1.0 ):223 def __init__(self,base,axes,color='black', zorder=5, r=1.0,sign=1): 211 224 212 225 _BaseInteractor.__init__(self, base, axes, color=color) … … 218 231 self._inner_save_y = 0 219 232 self.scale = 10.0 220 233 self.base= base 234 self.sign=sign 235 236 237 print "sign",self.sign,self.sign*math.fabs(self._inner_mouse_x) 238 221 239 try: 222 240 # Inner circle marker 223 self.inner_marker = self.axes.plot([self. _inner_mouse_x],[0], linestyle='',241 self.inner_marker = self.axes.plot([self.sign*math.fabs(self._inner_mouse_x)],[0], linestyle='', 224 242 marker='s', markersize=10, 225 243 color=self.color, alpha=0.6, … … 228 246 visible=True)[0] 229 247 except: 230 self.inner_marker = self.axes.plot([self. _inner_mouse_x],[0], linestyle='',248 self.inner_marker = self.axes.plot([self.sign*math.fabs(self._inner_mouse_x)],[0], linestyle='', 231 249 marker='s', markersize=10, 232 250 color=self.color, alpha=0.6, … … 283 301 x.append(xval) 284 302 y.append(yval) 285 286 self.inner_marker.set(xdata=[self. _inner_mouse_x],ydata=[0])303 304 self.inner_marker.set(xdata=[self.sign*math.fabs(self._inner_mouse_x)],ydata=[0]) 287 305 self.inner_circle.set_data(x, y) 288 306 … … 321 339 def get_params(self): 322 340 params = {} 323 params["radius"] = self._inner_mouse_x341 params["radius"] = math.fabs(self._inner_mouse_x) 324 342 return params 325 343
Note: See TracChangeset
for help on using the changeset viewer.