Changeset 0c218d9 in sasview
- Timestamp:
- Feb 6, 2009 6:39:19 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:
- ae2d445
- Parents:
- 0b92f4f4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/SectorSlicer.py
r7a28ba7 r0c218d9 29 29 self.markers = [] 30 30 self.axes = axes 31 self.qmax = math.sqrt(math.pow(max(self.base.data2D.xmax, abs(self.base.data2D.xmin)),2)+math.pow(max(self.base.data2D.xmax,abs(self.base.data2D.xmin)),2))31 self.qmax = math.sqrt(math.pow(max(self.base.data2D.xmax,math.fabs(self.base.data2D.xmin)),2)+math.pow(max(self.base.data2D.xmax,math.fabs(self.base.data2D.xmin)),2)) 32 32 #print "sector qmax", self.qmax 33 33 self.connect = self.base.connect … … 157 157 #phimin = min(self.right_line.theta+math.pi,self.left_line.theta+math.pi) 158 158 #phimax = max(self.right_line.theta+math.pi,self.left_line.theta+math.pi) 159 print "sector Q",phimin,phimax159 #print "sector Q",phimin,phimax 160 160 sect = SectorQ(r_min=0.0, r_max= radius , phi_min=phimin, phi_max=phimax) 161 161 #sect = SectorQ(r_min=-1*radius , r_max= radius , phi_min=phimin, phi_max=phimax) … … 280 280 try: 281 281 # Inner circle marker 282 self.inner_marker = self.axes.plot([x1/2 ],[y1/2], linestyle='',282 self.inner_marker = self.axes.plot([x1/2.5],[y1/2.5], linestyle='', 283 283 marker='s', markersize=10, 284 284 color=self.color, alpha=0.6, … … 287 287 visible=True)[0] 288 288 except: 289 self.inner_marker = self.axes.plot([x1/2 ],[y1/2], linestyle='',289 self.inner_marker = self.axes.plot([x1/2.5],[y1/2.5], linestyle='', 290 290 marker='s', markersize=10, 291 291 color=self.color, alpha=0.6, … … 360 360 y2= -1*self.radius*math.sin(self.theta + delta) 361 361 362 self.inner_marker.set(xdata=[x1/2 ],ydata=[y1/2])362 self.inner_marker.set(xdata=[x1/2.5],ydata=[y1/2.5]) 363 363 self.line.set(xdata=[x1,x2], ydata=[y1,y2]) 364 364 … … 392 392 self.theta= math.atan2(y,x) 393 393 self.has_move=True 394 395 #ToDo: Simplify below 394 396 if not self.left_moving: 395 if self.theta >= self.theta2: 396 print "my theta", self.theta 397 self.restore() 398 return 399 elif self.theta <= self.theta2 -math.pi/2: 400 print "self theta encore" 397 if self.theta2-self.theta <= 0 and self.theta2>0:#>= self.theta2: 398 #print "my theta", self.theta 399 self.restore() 400 return 401 elif self.theta2 < 0 and self.theta < 0 and self.theta-self.theta2 >= 0: 402 self.restore() 403 return 404 elif self.theta2 < 0 and self.theta > 0 and self.theta2+2*math.pi-self.theta >=math.pi/2: 405 #print "my theta", self.theta 406 self.restore() 407 return 408 elif self.theta2 < 0 and self.theta < 0 and self.theta2-self.theta >=math.pi/2: 409 #print "my theta", self.theta 410 self.restore() 411 return 412 elif self.theta2>0 and (self.theta2-self.theta >= math.pi/2 or (self.theta2-self.theta >= math.pi/2)):#<= self.theta2 -math.pi/2: 413 #print "self theta encore" 401 414 self.restore() 402 415 return 403 416 else: 404 print "left move" 405 if self.theta <= self.theta2: 406 print "my theta", self.theta 407 self.restore() 408 return 409 elif self.theta >= self.theta2 +math.pi/2: 410 print "self theta encore" 411 self.restore() 412 return 417 #print "left move" 418 if self.theta < 0 and self.theta+math.pi*2-self.theta2 <= 0: 419 self.restore() 420 return 421 elif self.theta2 < 0 and self.theta-self.theta2 <= 0: 422 self.restore() 423 return 424 elif self.theta > 0 and self.theta-self.theta2 <=0: 425 #print "my theta", self.theta 426 self.restore() 427 return 428 elif self.theta-self.theta2 >= math.pi/2 or (self.theta+math.pi*2-self.theta2 >= math.pi/2 and self.theta<0 and self.theta2>0): 429 #print "self theta encore" 430 self.restore() 431 return 432 413 433 self.phi= math.fabs(self.theta2 - self.theta) 414 415 print "move , self.phi, self.theta,", self.theta,self.theta2 -math.pi/2 434 if self.phi>math.pi: 435 self.phi= 2*math.pi-math.fabs(self.theta2 - self.theta) 436 437 #print "move , self.phi, self.theta,", self.theta*180/math.pi,self.theta2*180/math.pi,self.phi*180/math.pi 416 438 417 439 … … 463 485 try: 464 486 # Inner circle marker 465 self.inner_marker = self.axes.plot([x1/2 ],[y1/2], linestyle='',487 self.inner_marker = self.axes.plot([x1/2.5],[y1/2.5], linestyle='', 466 488 marker='s', markersize=10, 467 489 color=self.color, alpha=0.6, … … 470 492 visible=True)[0] 471 493 except: 472 self.inner_marker = self.axes.plot([x1/2 ],[y1/2], linestyle='',494 self.inner_marker = self.axes.plot([x1/2.5],[y1/2.5], linestyle='', 473 495 marker='s', markersize=10, 474 496 color=self.color, alpha=0.6, … … 513 535 Draw the new roughness on the graph. 514 536 """ 515 print "update main line", self.theta537 #print "update main line", self.theta 516 538 if theta !=None: 517 539 self.theta= theta … … 521 543 y2= -1*self.radius*math.sin(self.theta) 522 544 523 self.inner_marker.set(xdata=[x1/2 ],ydata=[y1/2])545 self.inner_marker.set(xdata=[x1/2.5],ydata=[y1/2.5]) 524 546 self.line.set(xdata=[x1,x2], ydata=[y1,y2]) 525 547 … … 551 573 552 574 self.theta= math.atan2(y,x) 553 print "main_line previous theta --- next theta ",math.degrees(self.save_theta),math.degrees(self.theta)575 #print "main_line previous theta --- next theta ",math.degrees(self.save_theta),math.degrees(self.theta) 554 576 555 577 self.has_move=True 578 556 579 self.base.base.update() 557 580
Note: See TracChangeset
for help on using the changeset viewer.