Changeset e20870bc in sasview for src/sas/qtgui/Plotting/Slicers/Arc.py
- Timestamp:
- Jun 27, 2018 3:33:52 AM (6 years ago)
- Branches:
- ESS_GUI, 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
- Children:
- b1a7a81
- Parents:
- c5e0d84
- git-author:
- Piotr Rozyczko <rozyczko@…> (05/31/18 05:15:47)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (06/27/18 03:33:52)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/Slicers/Arc.py
- Property mode changed from 100755 to 100644
rd744767 re20870bc 2 2 Arc slicer for 2D data 3 3 """ 4 import math4 import numpy as np 5 5 6 from .BaseInteractor import BaseInteractor6 from sas.qtgui.Plotting.Slicers.BaseInteractor import BaseInteractor 7 7 8 8 class ArcInteractor(BaseInteractor): … … 11 11 """ 12 12 def __init__(self, base, axes, color='black', zorder=5, r=1.0, 13 theta1= math.pi / 8, theta2=math.pi / 4):13 theta1=np.pi / 8, theta2=np.pi / 4): 14 14 BaseInteractor.__init__(self, base, axes, color=color) 15 15 self.markers = [] … … 55 55 Return arc radius 56 56 """ 57 radius = math.sqrt(math.pow(self._mouse_x, 2) + \58 math.pow(self._mouse_y, 2))57 radius = np.sqrt(np.power(self._mouse_x, 2) + \ 58 np.power(self._mouse_y, 2)) 59 59 return radius 60 60 … … 75 75 self.theta2 = theta2 76 76 while self.theta2 < self.theta1: 77 self.theta2 += (2 * math.pi)78 while self.theta2 >= (self.theta1 + 2 * math.pi):79 self.theta2 -= (2 * math.pi)80 npts = int((self.theta2 - self.theta1) / ( math.pi / 120))77 self.theta2 += (2 * np.pi) 78 while self.theta2 >= (self.theta1 + 2 * np.pi): 79 self.theta2 -= (2 * np.pi) 80 npts = int((self.theta2 - self.theta1) / (np.pi / 120)) 81 81 82 82 if r is None: 83 self.radius = math.sqrt(math.pow(self._mouse_x, 2) + \84 math.pow(self._mouse_y, 2))83 self.radius = np.sqrt(np.power(self._mouse_x, 2) + \ 84 np.power(self._mouse_y, 2)) 85 85 else: 86 86 self.radius = r 87 87 for i in range(self.npts): 88 88 phi = (self.theta2 - self.theta1) / (self.npts - 1) * i + self.theta1 89 xval = 1.0 * self.radius * math.cos(phi)90 yval = 1.0 * self.radius * math.sin(phi)89 xval = 1.0 * self.radius * np.cos(phi) 90 yval = 1.0 * self.radius * np.sin(phi) 91 91 92 92 x.append(xval)
Note: See TracChangeset
for help on using the changeset viewer.