Changeset 9c0f3c17 in sasview for src/sas/sasgui/perspectives/pr/pr.py
- Timestamp:
- Apr 4, 2017 12:50:04 PM (8 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:
- f2940c4
- Parents:
- 463e7ffc (diff), 1779e72 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/pr/pr.py
r463e7ffc r9c0f3c17 21 21 import time 22 22 import math 23 import numpy 23 import numpy as np 24 24 import pylab 25 25 from sas.sasgui.guiframe.gui_manager import MDIFrame … … 209 209 r = pylab.arange(0.01, d_max, d_max / 51.0) 210 210 M = len(r) 211 y = n umpy.zeros(M)212 pr_err = n umpy.zeros(M)211 y = np.zeros(M) 212 pr_err = np.zeros(M) 213 213 214 214 total = 0.0 … … 255 255 """ 256 256 # Show P(r) 257 y_true = n umpy.zeros(len(x))257 y_true = np.zeros(len(x)) 258 258 259 259 sum_true = 0.0 … … 309 309 310 310 x = pylab.arange(minq, maxq, maxq / 301.0) 311 y = n umpy.zeros(len(x))312 err = n umpy.zeros(len(x))311 y = np.zeros(len(x)) 312 err = np.zeros(len(x)) 313 313 for i in range(len(x)): 314 314 value = pr.iq(out, x[i]) … … 339 339 if pr.slit_width > 0 or pr.slit_height > 0: 340 340 x = pylab.arange(minq, maxq, maxq / 301.0) 341 y = n umpy.zeros(len(x))342 err = n umpy.zeros(len(x))341 y = np.zeros(len(x)) 342 err = np.zeros(len(x)) 343 343 for i in range(len(x)): 344 344 value = pr.iq_smeared(out, x[i]) … … 384 384 x = pylab.arange(0.0, pr.d_max, pr.d_max / self._pr_npts) 385 385 386 y = n umpy.zeros(len(x))387 dy = n umpy.zeros(len(x))388 y_true = n umpy.zeros(len(x))386 y = np.zeros(len(x)) 387 dy = np.zeros(len(x)) 388 y_true = np.zeros(len(x)) 389 389 390 390 total = 0.0 391 391 pmax = 0.0 392 cov2 = n umpy.ascontiguousarray(cov)392 cov2 = np.ascontiguousarray(cov) 393 393 394 394 for i in range(len(x)): … … 482 482 """ 483 483 # Read the data from the data file 484 data_x = n umpy.zeros(0)485 data_y = n umpy.zeros(0)486 data_err = n umpy.zeros(0)484 data_x = np.zeros(0) 485 data_y = np.zeros(0) 486 data_err = np.zeros(0) 487 487 scale = None 488 488 min_err = 0.0 … … 506 506 #err = 0 507 507 508 data_x = n umpy.append(data_x, x)509 data_y = n umpy.append(data_y, y)510 data_err = n umpy.append(data_err, err)508 data_x = np.append(data_x, x) 509 data_y = np.append(data_y, y) 510 data_err = np.append(data_err, err) 511 511 except: 512 512 logger.error(sys.exc_value) … … 530 530 """ 531 531 # Read the data from the data file 532 data_x = n umpy.zeros(0)533 data_y = n umpy.zeros(0)534 data_err = n umpy.zeros(0)532 data_x = np.zeros(0) 533 data_y = np.zeros(0) 534 data_err = np.zeros(0) 535 535 scale = None 536 536 min_err = 0.0 … … 557 557 #err = 0 558 558 559 data_x = n umpy.append(data_x, x)560 data_y = n umpy.append(data_y, y)561 data_err = n umpy.append(data_err, err)559 data_x = np.append(data_x, x) 560 data_y = np.append(data_y, y) 561 data_err = np.append(data_err, err) 562 562 except: 563 563 logger.error(sys.exc_value) … … 642 642 # Now replot the original added data 643 643 for plot in self._added_plots: 644 self._added_plots[plot].y = n umpy.copy(self._default_Iq[plot])644 self._added_plots[plot].y = np.copy(self._default_Iq[plot]) 645 645 wx.PostEvent(self.parent, 646 646 NewPlotEvent(plot=self._added_plots[plot], … … 666 666 # Now scale the added plots too 667 667 for plot in self._added_plots: 668 total = n umpy.sum(self._added_plots[plot].y)668 total = np.sum(self._added_plots[plot].y) 669 669 npts = len(self._added_plots[plot].x) 670 670 total *= self._added_plots[plot].x[npts - 1] / npts … … 816 816 # Save Pr invertor 817 817 self.pr = pr 818 cov = n umpy.ascontiguousarray(cov)818 cov = np.ascontiguousarray(cov) 819 819 820 820 # Show result on control panel … … 984 984 all_zeros = True 985 985 if err == None: 986 err = n umpy.zeros(len(pr.y))986 err = np.zeros(len(pr.y)) 987 987 else: 988 988 for i in range(len(err)): … … 1090 1090 # If we have not errors, add statistical errors 1091 1091 if y is not None: 1092 if err == None or n umpy.all(err) == 0:1093 err = n umpy.zeros(len(y))1092 if err == None or np.all(err) == 0: 1093 err = np.zeros(len(y)) 1094 1094 scale = None 1095 1095 min_err = 0.0
Note: See TracChangeset
for help on using the changeset viewer.