Changeset 9a5097c in sasview for src/sas/sasgui/guiframe/dataFitting.py
- Timestamp:
- Mar 26, 2017 11:33:16 PM (7 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- ed2276f
- Parents:
- 9146ed9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/dataFitting.py
r68adf86 r9a5097c 3 3 """ 4 4 import copy 5 import numpy 5 import numpy as np 6 6 import math 7 7 from sas.sascalc.data_util.uncertainty import Uncertainty … … 81 81 result.dxw = None 82 82 else: 83 result.dxw = n umpy.zeros(len(self.x))83 result.dxw = np.zeros(len(self.x)) 84 84 if self.dxl == None: 85 85 result.dxl = None 86 86 else: 87 result.dxl = n umpy.zeros(len(self.x))87 result.dxl = np.zeros(len(self.x)) 88 88 89 89 for i in range(len(self.x)): … … 128 128 result.dlam = None 129 129 else: 130 result.dlam = n umpy.zeros(tot_length)130 result.dlam = np.zeros(tot_length) 131 131 if self.dy == None or other.dy is None: 132 132 result.dy = None 133 133 else: 134 result.dy = n umpy.zeros(tot_length)134 result.dy = np.zeros(tot_length) 135 135 if self.dx == None or other.dx is None: 136 136 result.dx = None 137 137 else: 138 result.dx = n umpy.zeros(tot_length)138 result.dx = np.zeros(tot_length) 139 139 if self.dxw == None or other.dxw is None: 140 140 result.dxw = None 141 141 else: 142 result.dxw = n umpy.zeros(tot_length)142 result.dxw = np.zeros(tot_length) 143 143 if self.dxl == None or other.dxl is None: 144 144 result.dxl = None 145 145 else: 146 result.dxl = n umpy.zeros(tot_length)147 148 result.x = n umpy.append(self.x, other.x)146 result.dxl = np.zeros(tot_length) 147 148 result.x = np.append(self.x, other.x) 149 149 #argsorting 150 ind = n umpy.argsort(result.x)150 ind = np.argsort(result.x) 151 151 result.x = result.x[ind] 152 result.y = n umpy.append(self.y, other.y)152 result.y = np.append(self.y, other.y) 153 153 result.y = result.y[ind] 154 result.lam = n umpy.append(self.lam, other.lam)154 result.lam = np.append(self.lam, other.lam) 155 155 result.lam = result.lam[ind] 156 156 if result.dlam != None: 157 result.dlam = n umpy.append(self.dlam, other.dlam)157 result.dlam = np.append(self.dlam, other.dlam) 158 158 result.dlam = result.dlam[ind] 159 159 if result.dy != None: 160 result.dy = n umpy.append(self.dy, other.dy)160 result.dy = np.append(self.dy, other.dy) 161 161 result.dy = result.dy[ind] 162 162 if result.dx is not None: 163 result.dx = n umpy.append(self.dx, other.dx)163 result.dx = np.append(self.dx, other.dx) 164 164 result.dx = result.dx[ind] 165 165 if result.dxw is not None: 166 result.dxw = n umpy.append(self.dxw, other.dxw)166 result.dxw = np.append(self.dxw, other.dxw) 167 167 result.dxw = result.dxw[ind] 168 168 if result.dxl is not None: 169 result.dxl = n umpy.append(self.dxl, other.dxl)169 result.dxl = np.append(self.dxl, other.dxl) 170 170 result.dxl = result.dxl[ind] 171 171 return result … … 230 230 result.dxw = None 231 231 else: 232 result.dxw = n umpy.zeros(len(self.x))232 result.dxw = np.zeros(len(self.x)) 233 233 if self.dxl == None: 234 234 result.dxl = None 235 235 else: 236 result.dxl = n umpy.zeros(len(self.x))237 238 for i in range(n umpy.size(self.x)):236 result.dxl = np.zeros(len(self.x)) 237 238 for i in range(np.size(self.x)): 239 239 result.x[i] = self.x[i] 240 240 if self.dx is not None and len(self.x) == len(self.dx): … … 282 282 result.dlam = None 283 283 else: 284 result.dlam = n umpy.zeros(tot_length)284 result.dlam = np.zeros(tot_length) 285 285 if self.dy == None or other.dy is None: 286 286 result.dy = None 287 287 else: 288 result.dy = n umpy.zeros(tot_length)288 result.dy = np.zeros(tot_length) 289 289 if self.dx == None or other.dx is None: 290 290 result.dx = None 291 291 else: 292 result.dx = n umpy.zeros(tot_length)292 result.dx = np.zeros(tot_length) 293 293 if self.dxw == None or other.dxw is None: 294 294 result.dxw = None 295 295 else: 296 result.dxw = n umpy.zeros(tot_length)296 result.dxw = np.zeros(tot_length) 297 297 if self.dxl == None or other.dxl is None: 298 298 result.dxl = None 299 299 else: 300 result.dxl = n umpy.zeros(tot_length)301 result.x = n umpy.append(self.x, other.x)300 result.dxl = np.zeros(tot_length) 301 result.x = np.append(self.x, other.x) 302 302 #argsorting 303 ind = n umpy.argsort(result.x)303 ind = np.argsort(result.x) 304 304 result.x = result.x[ind] 305 result.y = n umpy.append(self.y, other.y)305 result.y = np.append(self.y, other.y) 306 306 result.y = result.y[ind] 307 result.lam = n umpy.append(self.lam, other.lam)307 result.lam = np.append(self.lam, other.lam) 308 308 result.lam = result.lam[ind] 309 309 if result.dy != None: 310 result.dy = n umpy.append(self.dy, other.dy)310 result.dy = np.append(self.dy, other.dy) 311 311 result.dy = result.dy[ind] 312 312 if result.dx is not None: 313 result.dx = n umpy.append(self.dx, other.dx)313 result.dx = np.append(self.dx, other.dx) 314 314 result.dx = result.dx[ind] 315 315 if result.dxw is not None: 316 result.dxw = n umpy.append(self.dxw, other.dxw)316 result.dxw = np.append(self.dxw, other.dxw) 317 317 result.dxw = result.dxw[ind] 318 318 if result.dxl is not None: 319 result.dxl = n umpy.append(self.dxl, other.dxl)319 result.dxl = np.append(self.dxl, other.dxl) 320 320 result.dxl = result.dxl[ind] 321 321 return result … … 409 409 result.dqy_data = None 410 410 else: 411 result.dqx_data = n umpy.zeros(len(self.data))412 result.dqy_data = n umpy.zeros(len(self.data))413 for i in range(n umpy.size(self.data)):411 result.dqx_data = np.zeros(len(self.data)) 412 result.dqy_data = np.zeros(len(self.data)) 413 for i in range(np.size(self.data)): 414 414 result.data[i] = self.data[i] 415 415 if self.err_data is not None and \ 416 numpy.size(self.data) == numpy.size(self.err_data):416 np.size(self.data) == np.size(self.err_data): 417 417 result.err_data[i] = self.err_data[i] 418 418 if self.dqx_data is not None: … … 473 473 result.dqy_data = None 474 474 else: 475 result.dqx_data = n umpy.zeros(len(self.data) + \476 numpy.size(other.data))477 result.dqy_data = n umpy.zeros(len(self.data) + \478 numpy.size(other.data))479 480 result.data = n umpy.append(self.data, other.data)481 result.qx_data = n umpy.append(self.qx_data, other.qx_data)482 result.qy_data = n umpy.append(self.qy_data, other.qy_data)483 result.q_data = n umpy.append(self.q_data, other.q_data)484 result.mask = n umpy.append(self.mask, other.mask)475 result.dqx_data = np.zeros(len(self.data) + \ 476 np.size(other.data)) 477 result.dqy_data = np.zeros(len(self.data) + \ 478 np.size(other.data)) 479 480 result.data = np.append(self.data, other.data) 481 result.qx_data = np.append(self.qx_data, other.qx_data) 482 result.qy_data = np.append(self.qy_data, other.qy_data) 483 result.q_data = np.append(self.q_data, other.q_data) 484 result.mask = np.append(self.mask, other.mask) 485 485 if result.err_data is not None: 486 result.err_data = n umpy.append(self.err_data, other.err_data)486 result.err_data = np.append(self.err_data, other.err_data) 487 487 if self.dqx_data is not None: 488 result.dqx_data = n umpy.append(self.dqx_data, other.dqx_data)488 result.dqx_data = np.append(self.dqx_data, other.dqx_data) 489 489 if self.dqy_data is not None: 490 result.dqy_data = n umpy.append(self.dqy_data, other.dqy_data)490 result.dqy_data = np.append(self.dqy_data, other.dqy_data) 491 491 492 492 return result
Note: See TracChangeset
for help on using the changeset viewer.