Changeset 2945 for branch/2frame
- Timestamp:
- Jul 27, 2017 3:03:15 PM (8 years ago)
- Location:
- branch/2frame
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branch/2frame/GSASIImath.py ¶
r2943 r2945 3894 3894 def __init__(self): 3895 3895 self.dwell = 20 3896 self.lower = -103897 self.upper = 1 03896 self.lower = 0. 3897 self.upper = 1. 3898 3898 self.Ninit = 50 3899 3899 self.accepted = 0 -
TabularUnified branch/2frame/GSASIIphsGUI.py ¶
r2943 r2945 7786 7786 print ' MC/SA run completed: %d residual: %.3f%% SFcalc time: %.2fs Nsfcalc: %d'%(i,100*Result[2],tsum,nsum) 7787 7787 tsf += tsum 7788 print ' Structure factor time: %.2f'%(tsf)7788 print ' Total SF time: %.2fs'%(tsf) 7789 7789 XY = np.mgrid[0:rcov.shape[0],0:rcov.shape[1]] 7790 G2plt.PlotXYZ(G2frame,XY,rcov,labelX='ref No.',labelY='ref No.',newPlot=False,Title='Reflection covariance matrix') 7790 G2plt.PlotXYZ(G2frame,XY,rcov,labelX='ref No.',labelY='ref No.',newPlot=False, 7791 Title='Reflection covariance matrix',zrange=[-1.,1.],color='RdYlGn') 7791 7792 else: 7792 7793 nprocs = GSASIIpath.GetConfigValue('Multiprocessing_cores') 7793 7794 Results,sftime,numsf = G2mth.MPmcsaSearch(nCyc,data,RBdata,reflType,reflData,covData,nprocs) 7794 7795 MCSAdata['Results'] += Results #+= to any saved ones 7795 print ' Total SF time: %.2f MC/SA run time: %.2fNsfcalc: %d'%(sftime,time.time()-time1,numsf)7796 print ' Total SF time: %.2fs MC/SA run time: %.2fs Nsfcalc: %d'%(sftime,time.time()-time1,numsf) 7796 7797 finally: 7797 7798 if process == 'single': -
TabularUnified branch/2frame/GSASIIplot.py ¶
r2940 r2945 2973 2973 ################################################################################ 2974 2974 2975 def PlotXYZ(G2frame,XY,Z,labelX='X',labelY='Y',newPlot=False,Title='' ):2975 def PlotXYZ(G2frame,XY,Z,labelX='X',labelY='Y',newPlot=False,Title='',zrange=None,color=None): 2976 2976 '''simple contour plot of xyz data 2977 2977 … … 2983 2983 :param bool newPlot: =True if new plot is to be made 2984 2984 :param str Title: title for plot 2985 :param list zrange: [zmin,zmax]; default=None to use limits in Z 2986 :param str color: one of mpl.cm.dated.keys(); default=None to use G2frame.ContourColor 2985 2987 :returns: nothing 2986 2988 … … 3014 3016 G2frame.ContourColor = choice[sel] 3015 3017 else: 3016 G2frame.ContourColor = GSASIIpath.GetConfigValue('Contour_color',' Paired')3018 G2frame.ContourColor = GSASIIpath.GetConfigValue('Contour_color','RdYlGn') 3017 3019 dlg.Destroy() 3018 3020 wx.CallAfter(PlotXYZ,G2frame,XY,Z,labelX,labelY,False,Title) … … 3054 3056 Ymin = np.min(XY.T[0]) 3055 3057 Ymax = np.max(XY.T[0]) 3056 Dx = 0.5*(Xmax-Xmin)/Nxy[0]3057 Dy = 0.5*(Ymax-Ymin)/Nxy[1]3058 # Dx = 0.5*(Xmax-Xmin)/Nxy[0] 3059 # Dy = 0.5*(Ymax-Ymin)/Nxy[1] 3058 3060 Plot.set_title(Title) 3059 3061 if labelX: … … 3065 3067 else: 3066 3068 Plot.set_ylabel(r'Y',fontsize=14) 3067 acolor = mpl.cm.get_cmap(G2frame.ContourColor) 3069 if color is None: 3070 acolor = mpl.cm.get_cmap(G2frame.ContourColor) 3071 else: 3072 acolor = mpl.cm.get_cmap(color) 3073 if zrange is None: 3074 zrange=[0,Zmax*G2frame.Cmax] 3068 3075 Img = Plot.imshow(Z.T,cmap=acolor,interpolation=G2frame.Interpolate,origin='lower', \ 3069 aspect='equal',extent=[Xmin,Xmax,Ymin,Ymax],vmin=0,vmax=Zmax*G2frame.Cmax) 3070 # aspect='equal',extent=[Xmin-Dx,Xmax-Dx,Ymin+Dy,Ymax+Dy],vmin=0,vmax=Zmax*G2frame.Cmax) 3076 aspect='equal',extent=[Xmin,Xmax,Ymin,Ymax],vmin=zrange[0],vmax=zrange[1]) 3071 3077 Page.figure.colorbar(Img) 3072 3078 if not newPlot:
Note: See TracChangeset
for help on using the changeset viewer.