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