Changes in src/sas/sasgui/perspectives/pr/pr.py [c1d5aea:463e7ffc] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/pr/pr.py
rc1d5aea r463e7ffc 21 21 import time 22 22 import math 23 import numpy as np23 import numpy 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 p.zeros(M)212 pr_err = n p.zeros(M)211 y = numpy.zeros(M) 212 pr_err = numpy.zeros(M) 213 213 214 214 total = 0.0 … … 255 255 """ 256 256 # Show P(r) 257 y_true = n p.zeros(len(x))257 y_true = numpy.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 p.zeros(len(x))312 err = n p.zeros(len(x))311 y = numpy.zeros(len(x)) 312 err = numpy.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 p.zeros(len(x))342 err = n p.zeros(len(x))341 y = numpy.zeros(len(x)) 342 err = numpy.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 p.zeros(len(x))387 dy = n p.zeros(len(x))388 y_true = n p.zeros(len(x))386 y = numpy.zeros(len(x)) 387 dy = numpy.zeros(len(x)) 388 y_true = numpy.zeros(len(x)) 389 389 390 390 total = 0.0 391 391 pmax = 0.0 392 cov2 = n p.ascontiguousarray(cov)392 cov2 = numpy.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 p.zeros(0)485 data_y = n p.zeros(0)486 data_err = n p.zeros(0)484 data_x = numpy.zeros(0) 485 data_y = numpy.zeros(0) 486 data_err = numpy.zeros(0) 487 487 scale = None 488 488 min_err = 0.0 … … 506 506 #err = 0 507 507 508 data_x = n p.append(data_x, x)509 data_y = n p.append(data_y, y)510 data_err = n p.append(data_err, err)508 data_x = numpy.append(data_x, x) 509 data_y = numpy.append(data_y, y) 510 data_err = numpy.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 p.zeros(0)533 data_y = n p.zeros(0)534 data_err = n p.zeros(0)532 data_x = numpy.zeros(0) 533 data_y = numpy.zeros(0) 534 data_err = numpy.zeros(0) 535 535 scale = None 536 536 min_err = 0.0 … … 557 557 #err = 0 558 558 559 data_x = n p.append(data_x, x)560 data_y = n p.append(data_y, y)561 data_err = n p.append(data_err, err)559 data_x = numpy.append(data_x, x) 560 data_y = numpy.append(data_y, y) 561 data_err = numpy.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 p.copy(self._default_Iq[plot])644 self._added_plots[plot].y = numpy.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 p.sum(self._added_plots[plot].y)668 total = numpy.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 p.ascontiguousarray(cov)818 cov = numpy.ascontiguousarray(cov) 819 819 820 820 # Show result on control panel … … 984 984 all_zeros = True 985 985 if err == None: 986 err = n p.zeros(len(pr.y))986 err = numpy.zeros(len(pr.y)) 987 987 else: 988 988 for i in range(len(err)): … … 1047 1047 try: 1048 1048 pr = self._create_file_pr(data) 1049 if pr is notNone:1049 if not pr is None: 1050 1050 self.pr = pr 1051 1051 self.perform_estimate() … … 1090 1090 # If we have not errors, add statistical errors 1091 1091 if y is not None: 1092 if err == None or n p.all(err) == 0:1093 err = n p.zeros(len(y))1092 if err == None or numpy.all(err) == 0: 1093 err = numpy.zeros(len(y)) 1094 1094 scale = None 1095 1095 min_err = 0.0
Note: See TracChangeset
for help on using the changeset viewer.