Changes in src/sas/sasgui/plottools/plottables.py [9a5097c:463e7ffc] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/plottools/plottables.py
r9a5097c r463e7ffc 43 43 # Support for ancient python versions 44 44 import copy 45 import numpy as np45 import numpy 46 46 import sys 47 47 import logging 48 49 logger = logging.getLogger(__name__) 48 50 49 51 if 'any' not in dir(__builtins__): … … 706 708 self.dy = None 707 709 if not has_err_x: 708 dx = n p.zeros(len(x))710 dx = numpy.zeros(len(x)) 709 711 if not has_err_y: 710 dy = n p.zeros(len(y))712 dy = numpy.zeros(len(y)) 711 713 for i in range(len(x)): 712 714 try: … … 796 798 tempdy = [] 797 799 if self.dx == None: 798 self.dx = n p.zeros(len(self.x))800 self.dx = numpy.zeros(len(self.x)) 799 801 if self.dy == None: 800 self.dy = n p.zeros(len(self.y))802 self.dy = numpy.zeros(len(self.y)) 801 803 if self.xLabel == "log10(x)": 802 804 for i in range(len(self.x)): … … 808 810 tempdy.append(self.dy[i]) 809 811 except: 810 logg ing.error("check_data_logX: skipping point x %g", self.x[i])811 logg ing.error(sys.exc_value)812 logger.error("check_data_logX: skipping point x %g", self.x[i]) 813 logger.error(sys.exc_value) 812 814 self.x = tempx 813 815 self.y = tempy … … 826 828 tempdy = [] 827 829 if self.dx == None: 828 self.dx = n p.zeros(len(self.x))830 self.dx = numpy.zeros(len(self.x)) 829 831 if self.dy == None: 830 self.dy = n p.zeros(len(self.y))832 self.dy = numpy.zeros(len(self.y)) 831 833 if self.yLabel == "log10(y)": 832 834 for i in range(len(self.x)): … … 838 840 tempdy.append(self.dy[i]) 839 841 except: 840 logg ing.error("check_data_logY: skipping point %g", self.y[i])841 logg ing.error(sys.exc_value)842 logger.error("check_data_logY: skipping point %g", self.y[i]) 843 logger.error(sys.exc_value) 842 844 843 845 self.x = tempx … … 859 861 tempdy = [] 860 862 if self.dx == None: 861 self.dx = n p.zeros(len(self.x))863 self.dx = numpy.zeros(len(self.x)) 862 864 if self.dy == None: 863 self.dy = n p.zeros(len(self.y))865 self.dy = numpy.zeros(len(self.y)) 864 866 if xmin != None and xmax != None: 865 867 for i in range(len(self.x)): … … 1228 1230 1229 1231 def sample_graph(): 1230 import numpy as n p1232 import numpy as nx 1231 1233 1232 1234 # Construct a simple graph 1233 1235 if False: 1234 x = n p.array([1, 2, 3, 4, 5, 6], 'd')1235 y = n p.array([4, 5, 6, 5, 4, 5], 'd')1236 dy = n p.array([0.2, 0.3, 0.1, 0.2, 0.9, 0.3])1236 x = nx.array([1, 2, 3, 4, 5, 6], 'd') 1237 y = nx.array([4, 5, 6, 5, 4, 5], 'd') 1238 dy = nx.array([0.2, 0.3, 0.1, 0.2, 0.9, 0.3]) 1237 1239 else: 1238 x = n p.linspace(0, 1., 10000)1239 y = n p.sin(2 * np.pi * x * 2.8)1240 dy = n p.sqrt(100 * np.abs(y)) / 1001240 x = nx.linspace(0, 1., 10000) 1241 y = nx.sin(2 * nx.pi * x * 2.8) 1242 dy = nx.sqrt(100 * nx.abs(y)) / 100 1241 1243 data = Data1D(x, y, dy=dy) 1242 1244 data.xaxis('distance', 'm')
Note: See TracChangeset
for help on using the changeset viewer.