Ignore:
Timestamp:
Jun 27, 2018 3:33:52 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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)
Message:

Masking dialog for fitting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/Slicers/Arc.py

    • Property mode changed from 100755 to 100644
    rd744767 re20870bc  
    22    Arc slicer for 2D data 
    33""" 
    4 import math 
     4import numpy as np 
    55 
    6 from .BaseInteractor import BaseInteractor 
     6from sas.qtgui.Plotting.Slicers.BaseInteractor import BaseInteractor 
    77 
    88class ArcInteractor(BaseInteractor): 
     
    1111    """ 
    1212    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): 
    1414        BaseInteractor.__init__(self, base, axes, color=color) 
    1515        self.markers = [] 
     
    5555            Return arc radius 
    5656        """ 
    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)) 
    5959        return radius 
    6060 
     
    7575            self.theta2 = theta2 
    7676        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)) 
    8181 
    8282        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)) 
    8585        else: 
    8686            self.radius = r 
    8787        for i in range(self.npts): 
    8888            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) 
    9191 
    9292            x.append(xval) 
Note: See TracChangeset for help on using the changeset viewer.