Ignore:
Timestamp:
May 9, 2017 3:38:40 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
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
Children:
f7f5796
Parents:
31e4bb8
Message:

Code review fixes for SASVIEW-273

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingLogic.py

    r180bd54 r2add354  
    1 import numpy 
     1import numpy as np 
    22 
    33from sas.sasgui.guiframe.dataFitting import Data1D 
     
    7272        ymin = -qmax 
    7373 
    74         x = numpy.linspace(start=xmin, stop=xmax, num=qstep, endpoint=True) 
    75         y = numpy.linspace(start=ymin, stop=ymax, num=qstep, endpoint=True) 
     74        x = np.linspace(start=xmin, stop=xmax, num=qstep, endpoint=True) 
     75        y = np.linspace(start=ymin, stop=ymax, num=qstep, endpoint=True) 
    7676        # Use data info instead 
    77         new_x = numpy.tile(x, (len(y), 1)) 
    78         new_y = numpy.tile(y, (len(x), 1)) 
     77        new_x = np.tile(x, (len(y), 1)) 
     78        new_y = np.tile(y, (len(x), 1)) 
    7979        new_y = new_y.swapaxes(0, 1) 
    8080 
     
    8282        qx_data = new_x.flatten() 
    8383        qy_data = new_y.flatten() 
    84         q_data = numpy.sqrt(qx_data * qx_data + qy_data * qy_data) 
     84        q_data = np.sqrt(qx_data * qx_data + qy_data * qy_data) 
    8585 
    8686        # set all True (standing for unmasked) as default 
    87         mask = numpy.ones(len(qx_data), dtype=bool) 
     87        mask = np.ones(len(qx_data), dtype=bool) 
    8888        # calculate the range of qx and qy: this way, 
    8989        # it is a little more independent 
     
    9393 
    9494        self._data.source = Source() 
    95         self._data.data = numpy.ones(len(mask)) 
    96         self._data.err_data = numpy.ones(len(mask)) 
     95        self._data.data = np.ones(len(mask)) 
     96        self._data.err_data = np.ones(len(mask)) 
    9797        self._data.qx_data = qx_data 
    9898        self._data.qy_data = qy_data 
     
    120120        new_plot = Data1D(x=x, y=y) 
    121121        new_plot.is_data = False 
    122         new_plot.dy = numpy.zeros(len(y)) 
     122        new_plot.dy = np.zeros(len(y)) 
    123123        _yaxis, _yunit = data.get_yaxis() 
    124124        _xaxis, _xunit = data.get_xaxis() 
     
    141141        update_chisqr, source = return_data 
    142142 
    143         numpy.nan_to_num(image) 
     143        np.nan_to_num(image) 
    144144        new_plot = Data2D(image=image, err_image=data.err_data) 
    145145        new_plot.name = model.name + '2d' 
     
    194194            qmin = 0 
    195195            try: 
    196                 x = max(numpy.fabs(self.data.xmin), numpy.fabs(self.data.xmax)) 
    197                 y = max(numpy.fabs(self.data.ymin), numpy.fabs(self.data.ymax)) 
     196                x = max(np.fabs(self.data.xmin), np.fabs(self.data.xmax)) 
     197                y = max(np.fabs(self.data.ymin), np.fabs(self.data.ymax)) 
    198198            except (ValueError, TypeError): 
    199199                msg = "Unable to find min/max of \n data named %s" % \ 
    200200                            self.data.filename 
    201201                raise ValueError, msg 
    202             qmax = numpy.sqrt(x * x + y * y) 
     202            qmax = np.sqrt(x * x + y * y) 
    203203            npts = len(self.data.data) 
    204204        return qmin, qmax, npts 
Note: See TracChangeset for help on using the changeset viewer.