Changeset e23a20c in sasview
- Timestamp:
- Jan 12, 2009 2:21:12 PM (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:
- 92c2345
- Parents:
- fb198a9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/SectorSlicer.py
r116da060 re23a20c 27 27 self.markers = [] 28 28 self.axes = axes 29 self.qmax = self.base.qmax29 self.qmax = math.sqrt(2)*self.base.qmax 30 30 self.connect = self.base.connect 31 31 … … 37 37 #self.theta3= 2*self.theta2 -self.theta1 38 38 # Inner circle 39 self.main_line = LineInteractor(self, self.base.subplot,color=' blue', zorder=zorder, r=self.qmax,39 self.main_line = LineInteractor(self, self.base.subplot,color='green', zorder=zorder, r=self.qmax, 40 40 theta= self.theta2) 41 self.main_line.qmax = self.base.qmax41 self.main_line.qmax = math.sqrt(2)*self.base.qmax 42 42 #self.left_line = SectionInteractor(self, self.base.subplot, zorder=zorder+1, r=self.qmax, 43 43 # theta1= self.theta1, theta2= self.theta2) … … 47 47 phi= -1*self.phi, 48 48 theta2=self.theta2) 49 self.right_line.qmax = self.base.qmax50 self.left_line= SideInteractor(self, self.base.subplot,color=' green', zorder=zorder,49 self.right_line.qmax = math.sqrt(2)*self.base.qmax 50 self.left_line= SideInteractor(self, self.base.subplot,color='blue', zorder=zorder, 51 51 r=self.qmax, 52 52 phi= self.phi, 53 53 theta2=self.theta2) 54 self.left_line.qmax = self.base.qmax54 self.left_line.qmax = math.sqrt(2)*self.base.qmax 55 55 #self.outer_circle.set_cursor(self.base.qmax/1.8, 0) 56 56 … … 116 116 print "left line has moved --->" 117 117 self.main_line.update() 118 self.left_line.update(phi=None,delta=None, mline=self.main_line,side=True )118 self.left_line.update(phi=None,delta=None, mline=self.main_line,side=True, left=True) 119 119 #self.right_line.update(-1*delta,linem=self.main_line,linel=self.left_line) 120 self.right_line.update(phi=-1*self.left_line.phi,delta=None, mline=self.main_line,side=True )120 self.right_line.update(phi=-1*self.left_line.phi,delta=None, mline=self.main_line,side=True, left=True) 121 121 if self.right_line.has_move: 122 122 print "right line has moved --->" 123 123 124 124 self.main_line.update() 125 self.right_line.update(phi=None,delta=None, mline=self.main_line,side=True )125 self.right_line.update(phi=None,delta=None, mline=self.main_line,side=True, right=True) 126 126 #self.right_line.update(-1*delta,linem=self.main_line,linel=self.left_line) 127 self.left_line.update(phi=-1*self.right_line.phi,delta=None, mline=self.main_line,side=True )127 self.left_line.update(phi=-1*self.right_line.phi,delta=None, mline=self.main_line,side=True, left=True) 128 128 129 129 … … 151 151 phimin = self.right_line.theta+math.pi 152 152 phimax = self.left_line.theta+math.pi 153 #sect = SectorQ(r_min=0.000001, r_max= radius , phi_min=phimin, phi_max=phimax) 154 sect = SectorQ(r_min=-1*radius , r_max= radius , phi_min=phimin, phi_max=phimax) 153 154 sect = SectorQ(r_min=0.000001, r_max= radius , phi_min=phimin, phi_max=phimax) 155 #sect = SectorQ(r_min=-1*radius , r_max= radius , phi_min=phimin, phi_max=phimax) 155 156 if nbins!=None: 156 157 sect.nbins = nbins … … 179 180 new_plot.detector =self.base.data2D.detector 180 181 # If the data file does not tell us what the axes are, just assume... 181 new_plot.xaxis("\\rm{Q}", ' rad')182 new_plot.xaxis("\\rm{Q}", 'A^{-1}') 182 183 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 183 184 new_plot.group_id = "SectorQ"+self.base.data2D.name … … 219 220 if math.fabs(self.left_line.phi) != math.fabs(self.right_line.phi): 220 221 raise ValueError,"Phi left and phi right are different %f, %f"%(self.left_line.phi, self.right_line.phi) 221 params["left_phi"] = self.left_line.phi222 params["left_phi"] = math.fabs(self.left_line.phi) 222 223 params["nbins"] = self.nbins 223 224 return params … … 301 302 return self.theta - self.save_theta 302 303 303 def update(self,phi=None,delta=None, mline=None,side=False ):304 def update(self,phi=None,delta=None, mline=None,side=False, left= False, right=False): 304 305 """ 305 306 Draw the new roughness on the graph. … … 311 312 if delta==None: 312 313 delta = 0 313 if side == True:314 if side: 314 315 self.theta= mline.theta + self.phi 316 317 315 318 if mline!=None: 316 319 self.theta2 = mline.theta 320 #self.phi= math.fabs(self.theta2 - (self.theta+delta)) 317 321 #print "U:for line side theta2, phi, theta",math.degrees(self.theta2),math.degrees(self.phi),math.degrees(self.theta) 318 322 #if self.theta2 >= self.theta and self.theta>=0: … … 355 359 356 360 self.theta= math.atan2(y,x) 357 self.phi= self.theta2 - self.theta 361 362 self.phi= math.fabs(self.theta2 - self.theta) 358 363 359 364 print "move left or right phi ---theta--thetaM", self.phi, self.theta, self.theta2
Note: See TracChangeset
for help on using the changeset viewer.