Changeset 2add354 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingLogic.py
- Timestamp:
- May 9, 2017 3:38:40 AM (7 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingLogic.py
r180bd54 r2add354 1 import numpy 1 import numpy as np 2 2 3 3 from sas.sasgui.guiframe.dataFitting import Data1D … … 72 72 ymin = -qmax 73 73 74 x = n umpy.linspace(start=xmin, stop=xmax, num=qstep, endpoint=True)75 y = n umpy.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) 76 76 # Use data info instead 77 new_x = n umpy.tile(x, (len(y), 1))78 new_y = n umpy.tile(y, (len(x), 1))77 new_x = np.tile(x, (len(y), 1)) 78 new_y = np.tile(y, (len(x), 1)) 79 79 new_y = new_y.swapaxes(0, 1) 80 80 … … 82 82 qx_data = new_x.flatten() 83 83 qy_data = new_y.flatten() 84 q_data = n umpy.sqrt(qx_data * qx_data + qy_data * qy_data)84 q_data = np.sqrt(qx_data * qx_data + qy_data * qy_data) 85 85 86 86 # set all True (standing for unmasked) as default 87 mask = n umpy.ones(len(qx_data), dtype=bool)87 mask = np.ones(len(qx_data), dtype=bool) 88 88 # calculate the range of qx and qy: this way, 89 89 # it is a little more independent … … 93 93 94 94 self._data.source = Source() 95 self._data.data = n umpy.ones(len(mask))96 self._data.err_data = n umpy.ones(len(mask))95 self._data.data = np.ones(len(mask)) 96 self._data.err_data = np.ones(len(mask)) 97 97 self._data.qx_data = qx_data 98 98 self._data.qy_data = qy_data … … 120 120 new_plot = Data1D(x=x, y=y) 121 121 new_plot.is_data = False 122 new_plot.dy = n umpy.zeros(len(y))122 new_plot.dy = np.zeros(len(y)) 123 123 _yaxis, _yunit = data.get_yaxis() 124 124 _xaxis, _xunit = data.get_xaxis() … … 141 141 update_chisqr, source = return_data 142 142 143 n umpy.nan_to_num(image)143 np.nan_to_num(image) 144 144 new_plot = Data2D(image=image, err_image=data.err_data) 145 145 new_plot.name = model.name + '2d' … … 194 194 qmin = 0 195 195 try: 196 x = max(n umpy.fabs(self.data.xmin), numpy.fabs(self.data.xmax))197 y = max(n umpy.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)) 198 198 except (ValueError, TypeError): 199 199 msg = "Unable to find min/max of \n data named %s" % \ 200 200 self.data.filename 201 201 raise ValueError, msg 202 qmax = n umpy.sqrt(x * x + y * y)202 qmax = np.sqrt(x * x + y * y) 203 203 npts = len(self.data.data) 204 204 return qmin, qmax, npts
Note: See TracChangeset
for help on using the changeset viewer.