Changes in src/sas/sasgui/perspectives/pr/pr.py [463e7ffc:9a5097c] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/pr/pr.py
r463e7ffc 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 … … 34 34 from pr_widgets import load_error 35 35 from sas.sasgui.guiframe.plugin_base import PluginBase 36 37 logger = logging.getLogger(__name__)38 36 39 37 … … 115 113 116 114 # Log startup 117 logg er.info("Pr(r) plug-in started")115 logging.info("Pr(r) plug-in started") 118 116 119 117 def delete_data(self, data_id): … … 183 181 self.control_panel.set_state(state) 184 182 except: 185 logg er.error("prview.set_state: %s" % sys.exc_value)183 logging.error("prview.set_state: %s" % sys.exc_value) 186 184 187 185 … … 209 207 r = pylab.arange(0.01, d_max, d_max / 51.0) 210 208 M = len(r) 211 y = n umpy.zeros(M)212 pr_err = n umpy.zeros(M)209 y = np.zeros(M) 210 pr_err = np.zeros(M) 213 211 214 212 total = 0.0 … … 255 253 """ 256 254 # Show P(r) 257 y_true = n umpy.zeros(len(x))255 y_true = np.zeros(len(x)) 258 256 259 257 sum_true = 0.0 … … 309 307 310 308 x = pylab.arange(minq, maxq, maxq / 301.0) 311 y = n umpy.zeros(len(x))312 err = n umpy.zeros(len(x))309 y = np.zeros(len(x)) 310 err = np.zeros(len(x)) 313 311 for i in range(len(x)): 314 312 value = pr.iq(out, x[i]) … … 339 337 if pr.slit_width > 0 or pr.slit_height > 0: 340 338 x = pylab.arange(minq, maxq, maxq / 301.0) 341 y = n umpy.zeros(len(x))342 err = n umpy.zeros(len(x))339 y = np.zeros(len(x)) 340 err = np.zeros(len(x)) 343 341 for i in range(len(x)): 344 342 value = pr.iq_smeared(out, x[i]) … … 384 382 x = pylab.arange(0.0, pr.d_max, pr.d_max / self._pr_npts) 385 383 386 y = n umpy.zeros(len(x))387 dy = n umpy.zeros(len(x))388 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)) 389 387 390 388 total = 0.0 391 389 pmax = 0.0 392 cov2 = n umpy.ascontiguousarray(cov)390 cov2 = np.ascontiguousarray(cov) 393 391 394 392 for i in range(len(x)): … … 482 480 """ 483 481 # 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)482 data_x = np.zeros(0) 483 data_y = np.zeros(0) 484 data_err = np.zeros(0) 487 485 scale = None 488 486 min_err = 0.0 … … 506 504 #err = 0 507 505 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)506 data_x = np.append(data_x, x) 507 data_y = np.append(data_y, y) 508 data_err = np.append(data_err, err) 511 509 except: 512 logg er.error(sys.exc_value)510 logging.error(sys.exc_value) 513 511 514 512 if not scale == None: … … 530 528 """ 531 529 # 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)530 data_x = np.zeros(0) 531 data_y = np.zeros(0) 532 data_err = np.zeros(0) 535 533 scale = None 536 534 min_err = 0.0 … … 557 555 #err = 0 558 556 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)557 data_x = np.append(data_x, x) 558 data_y = np.append(data_y, y) 559 data_err = np.append(data_err, err) 562 560 except: 563 logg er.error(sys.exc_value)561 logging.error(sys.exc_value) 564 562 elif line.find("The 6 columns") >= 0: 565 563 data_started = True … … 642 640 # Now replot the original added data 643 641 for plot in self._added_plots: 644 self._added_plots[plot].y = n umpy.copy(self._default_Iq[plot])642 self._added_plots[plot].y = np.copy(self._default_Iq[plot]) 645 643 wx.PostEvent(self.parent, 646 644 NewPlotEvent(plot=self._added_plots[plot], … … 666 664 # Now scale the added plots too 667 665 for plot in self._added_plots: 668 total = n umpy.sum(self._added_plots[plot].y)666 total = np.sum(self._added_plots[plot].y) 669 667 npts = len(self._added_plots[plot].x) 670 668 total *= self._added_plots[plot].x[npts - 1] / npts … … 816 814 # Save Pr invertor 817 815 self.pr = pr 818 cov = n umpy.ascontiguousarray(cov)816 cov = np.ascontiguousarray(cov) 819 817 820 818 # Show result on control panel … … 984 982 all_zeros = True 985 983 if err == None: 986 err = n umpy.zeros(len(pr.y))984 err = np.zeros(len(pr.y)) 987 985 else: 988 986 for i in range(len(err)): … … 1090 1088 # If we have not errors, add statistical errors 1091 1089 if y is not None: 1092 if err == None or n umpy.all(err) == 0:1093 err = n umpy.zeros(len(y))1090 if err == None or np.all(err) == 0: 1091 err = np.zeros(len(y)) 1094 1092 scale = None 1095 1093 min_err = 0.0 … … 1203 1201 dataset = panel.plots[panel.graph.selected_plottable].name 1204 1202 else: 1205 logg er.info("Prview Error: No data is available")1203 logging.info("Prview Error: No data is available") 1206 1204 return 1207 1205 … … 1213 1211 except: 1214 1212 self.control_panel.alpha = self.alpha 1215 logg er.info("Prview :Alpha Not estimate yet")1213 logging.info("Prview :Alpha Not estimate yet") 1216 1214 try: 1217 1215 estimate = int(self.control_panel.nterms_estimate) … … 1219 1217 except: 1220 1218 self.control_panel.nfunc = self.nfunc 1221 logg er.info("Prview : ntemrs Not estimate yet")1219 logging.info("Prview : ntemrs Not estimate yet") 1222 1220 1223 1221 self.current_plottable = panel.plots[panel.graph.selected_plottable]
Note: See TracChangeset
for help on using the changeset viewer.