Changeset 9a5097c in sasview for src/sas/sasgui/perspectives/pr/pr.py
- Timestamp:
- Mar 26, 2017 11:33:16 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:
- ed2276f
- Parents:
- 9146ed9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/pr/pr.py
ra69a967 r9a5097c 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 … … 207 207 r = pylab.arange(0.01, d_max, d_max / 51.0) 208 208 M = len(r) 209 y = n umpy.zeros(M)210 pr_err = n umpy.zeros(M)209 y = np.zeros(M) 210 pr_err = np.zeros(M) 211 211 212 212 total = 0.0 … … 253 253 """ 254 254 # Show P(r) 255 y_true = n umpy.zeros(len(x))255 y_true = np.zeros(len(x)) 256 256 257 257 sum_true = 0.0 … … 307 307 308 308 x = pylab.arange(minq, maxq, maxq / 301.0) 309 y = n umpy.zeros(len(x))310 err = n umpy.zeros(len(x))309 y = np.zeros(len(x)) 310 err = np.zeros(len(x)) 311 311 for i in range(len(x)): 312 312 value = pr.iq(out, x[i]) … … 337 337 if pr.slit_width > 0 or pr.slit_height > 0: 338 338 x = pylab.arange(minq, maxq, maxq / 301.0) 339 y = n umpy.zeros(len(x))340 err = n umpy.zeros(len(x))339 y = np.zeros(len(x)) 340 err = np.zeros(len(x)) 341 341 for i in range(len(x)): 342 342 value = pr.iq_smeared(out, x[i]) … … 382 382 x = pylab.arange(0.0, pr.d_max, pr.d_max / self._pr_npts) 383 383 384 y = n umpy.zeros(len(x))385 dy = n umpy.zeros(len(x))386 y_true = n umpy.zeros(len(x))384 y = np.zeros(len(x)) 385 dy = np.zeros(len(x)) 386 y_true = np.zeros(len(x)) 387 387 388 388 total = 0.0 389 389 pmax = 0.0 390 cov2 = n umpy.ascontiguousarray(cov)390 cov2 = np.ascontiguousarray(cov) 391 391 392 392 for i in range(len(x)): … … 480 480 """ 481 481 # Read the data from the data file 482 data_x = n umpy.zeros(0)483 data_y = n umpy.zeros(0)484 data_err = n umpy.zeros(0)482 data_x = np.zeros(0) 483 data_y = np.zeros(0) 484 data_err = np.zeros(0) 485 485 scale = None 486 486 min_err = 0.0 … … 504 504 #err = 0 505 505 506 data_x = n umpy.append(data_x, x)507 data_y = n umpy.append(data_y, y)508 data_err = n umpy.append(data_err, err)506 data_x = np.append(data_x, x) 507 data_y = np.append(data_y, y) 508 data_err = np.append(data_err, err) 509 509 except: 510 510 logging.error(sys.exc_value) … … 528 528 """ 529 529 # Read the data from the data file 530 data_x = n umpy.zeros(0)531 data_y = n umpy.zeros(0)532 data_err = n umpy.zeros(0)530 data_x = np.zeros(0) 531 data_y = np.zeros(0) 532 data_err = np.zeros(0) 533 533 scale = None 534 534 min_err = 0.0 … … 555 555 #err = 0 556 556 557 data_x = n umpy.append(data_x, x)558 data_y = n umpy.append(data_y, y)559 data_err = n umpy.append(data_err, err)557 data_x = np.append(data_x, x) 558 data_y = np.append(data_y, y) 559 data_err = np.append(data_err, err) 560 560 except: 561 561 logging.error(sys.exc_value) … … 640 640 # Now replot the original added data 641 641 for plot in self._added_plots: 642 self._added_plots[plot].y = n umpy.copy(self._default_Iq[plot])642 self._added_plots[plot].y = np.copy(self._default_Iq[plot]) 643 643 wx.PostEvent(self.parent, 644 644 NewPlotEvent(plot=self._added_plots[plot], … … 664 664 # Now scale the added plots too 665 665 for plot in self._added_plots: 666 total = n umpy.sum(self._added_plots[plot].y)666 total = np.sum(self._added_plots[plot].y) 667 667 npts = len(self._added_plots[plot].x) 668 668 total *= self._added_plots[plot].x[npts - 1] / npts … … 814 814 # Save Pr invertor 815 815 self.pr = pr 816 cov = n umpy.ascontiguousarray(cov)816 cov = np.ascontiguousarray(cov) 817 817 818 818 # Show result on control panel … … 982 982 all_zeros = True 983 983 if err == None: 984 err = n umpy.zeros(len(pr.y))984 err = np.zeros(len(pr.y)) 985 985 else: 986 986 for i in range(len(err)): … … 1088 1088 # If we have not errors, add statistical errors 1089 1089 if y is not None: 1090 if err == None or n umpy.all(err) == 0:1091 err = n umpy.zeros(len(y))1090 if err == None or np.all(err) == 0: 1091 err = np.zeros(len(y)) 1092 1092 scale = None 1093 1093 min_err = 0.0
Note: See TracChangeset
for help on using the changeset viewer.