Changeset 9c0f3c17 in sasview for src/sas/sasgui/perspectives/pr
- 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. - Location:
- src/sas/sasgui/perspectives/pr
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/pr/explore_dialog.py
r463e7ffc r9c0f3c17 19 19 20 20 import wx 21 import numpy 21 import numpy as np 22 22 import logging 23 23 import sys … … 67 67 68 68 step = (self.max - self.min) / (self.npts - 1) 69 self.x = n umpy.arange(self.min, self.max + step * 0.01, step)70 dx = n umpy.zeros(len(self.x))71 y = n umpy.ones(len(self.x))72 dy = n umpy.zeros(len(self.x))69 self.x = np.arange(self.min, self.max + step * 0.01, step) 70 dx = np.zeros(len(self.x)) 71 y = np.ones(len(self.x)) 72 dy = np.zeros(len(self.x)) 73 73 74 74 # Plot area -
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 -
src/sas/sasgui/perspectives/pr/inversion_panel.py
r18b7ecb9 r463e7ffc 17 17 from pr_widgets import OutputTextCtrl 18 18 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 19 20 logger = logging.getLogger(__name__) 19 21 20 22 if sys.platform.count("win32") > 0: … … 710 712 self.alpha_ctl.SetValue(alpha) 711 713 except ValueError: 712 logg ing.error("InversionControl._on_accept_alpha got a value that was not a number: %s" % alpha )714 logger.error("InversionControl._on_accept_alpha got a value that was not a number: %s" % alpha ) 713 715 except: 714 716 # No estimate or bad estimate, either do nothing 715 logg ing.error("InversionControl._on_accept_alpha: %s" % sys.exc_value)717 logger.error("InversionControl._on_accept_alpha: %s" % sys.exc_value) 716 718 717 719 def _on_accept_nterms(self, evt): … … 726 728 self.nfunc_ctl.SetValue(nterms) 727 729 except ValueError: 728 logg ing.error("InversionControl._on_accept_nterms got a value that was not a number: %s" % nterms )730 logger.error("InversionControl._on_accept_nterms got a value that was not a number: %s" % nterms ) 729 731 except: 730 732 # No estimate or bad estimate, either do nothing 731 logg ing.error("InversionControl._on_accept_nterms: %s" % sys.exc_value)733 logger.error("InversionControl._on_accept_nterms: %s" % sys.exc_value) 732 734 733 735 def clear_panel(self): … … 947 949 except: 948 950 msg = "InversionControl._change_file: %s" % sys.exc_value 949 logg ing.error(msg)951 logger.error(msg) 950 952 951 953 def on_help(self, event): -
src/sas/sasgui/perspectives/pr/inversion_state.py
rd85c194 r463e7ffc 22 22 from sas.sascalc.dataloader.readers.cansas_reader import get_content 23 23 24 logger = logging.getLogger(__name__) 25 24 26 PRNODE_NAME = 'pr_inversion' 25 27 CANSAS_NS = "cansas1d/1.0" … … 250 252 msg = "InversionState.fromXML: Could not read " 251 253 msg += "timestamp\n %s" % sys.exc_value 252 logg ing.error(msg)254 logger.error(msg) 253 255 254 256 # Parse inversion inputs … … 306 308 err_msg += "%d %d" % (len(self.coefficients), 307 309 self.nfunc) 308 logg ing.error(err_msg)310 logger.error(err_msg) 309 311 self.coefficients = None 310 312 … … 343 345 err_msg += " covariance matrix: " 344 346 err_msg += "%d %d" % (len(self.covariance), self.nfunc) 345 logg ing.error(err_msg)347 logger.error(err_msg) 346 348 self.covariance = None 347 349 … … 430 432 msg = "XML document does not contain P(r) " 431 433 msg += "information.\n %s" % sys.exc_value 432 logg ing.info(msg)434 logger.info(msg) 433 435 434 436 return state
Note: See TracChangeset
for help on using the changeset viewer.