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