- Timestamp:
- Jan 25, 2020 12:47:07 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIIphsGUI.py ¶
r4264 r4265 4468 4468 'atSeq':atSeq,'Pairs':Pairs,'histogram':['',1.0],'files':files,'metadata':metadata, 4469 4469 'runTimes':runTimes,'ReStart':[False,False],'BVS':BVS,'Oxid':atOxid,'useBVS':False,'Swaps':[], 4470 'AveCN':[],'FxCN':[],'Potentials':{'Angles':[],'Angle search':10.,'Stretch':[],'Stretch search':10., 4470 'AveCN':[],'FxCN':[],'Potentials':{'Angles':[],'Angle search':10.,'Stretch':[], 4471 'Stretch search':10.,'Pot. Temp.':300., 4471 4472 }} 4472 4473 RMCPdict = data['RMC']['RMCProfile'] … … 4492 4493 RMCPdict.update({'AveCN':[],'FxCN':[]}) 4493 4494 if 'Potentials' not in RMCPdict: 4494 RMCPdict.update({'Potentials':{'Angles':[],'Angle search':10.,'Stretch':[],'Stretch search':10.}}) 4495 RMCPdict.update({'Potentials':{'Angles':[],'Angle search':10.,'Stretch':[],'Stretch search':10.,'Pot. Temp.':300.,}}) 4496 if 'Pot. Temp.' not in RMCPdict['Potentials']: 4497 RMCPdict['Potentials']['Pot. Temp.'] = 300. 4495 4498 if 'Swaps' not in RMCPdict: 4496 4499 RMCPdict['Swaps'] = [] … … 4913 4916 4914 4917 G2G.HorizontalLine(mainSizer,G2frame.FRMC) 4918 pottempBox = wx.BoxSizer(wx.HORIZONTAL) 4919 pottempBox.Add(wx.StaticText(G2frame.FRMC,label=' Potential temperature (K): '),0,WACV) 4920 pottempBox.Add(G2G.ValidatedTxtCtrl(G2frame.FRMC,RMCPdict['Potentials'],'Pot. Temp.',min=0.,max=1000.,size=(50,25)),0,WACV) 4921 mainSizer.Add(pottempBox,0,WACV) 4922 bondpotBox = wx.BoxSizer(wx.HORIZONTAL) 4923 bondpotAdd = wx.Button(G2frame.FRMC,label='Add') 4924 bondpotAdd.Bind(wx.EVT_BUTTON,OnAddBondPot) 4925 bondpotBox.Add(bondpotAdd,0,WACV) 4926 bondpotBox.Add(wx.StaticText(G2frame.FRMC,label=' A-B stretch potential restraints, search range (%): '),0,WACV) 4927 bondpotBox.Add(G2G.ValidatedTxtCtrl(G2frame.FRMC,RMCPdict['Potentials'],'Stretch search',min=0.,max=100.,size=(50,25)),0,WACV) 4928 mainSizer.Add(bondpotBox,0,WACV) 4929 if len(RMCPdict['Potentials']['Stretch']): 4930 mainSizer.Add(GetBondSizer(),0,WACV) 4931 4915 4932 angpotBox = wx.BoxSizer(wx.HORIZONTAL) 4916 4933 angpotAdd = wx.Button(G2frame.FRMC,label='Add') … … 4923 4940 mainSizer.Add(GetAngleSizer(),0,WACV) 4924 4941 4925 G2G.HorizontalLine(mainSizer,G2frame.FRMC)4926 bondpotBox = wx.BoxSizer(wx.HORIZONTAL)4927 bondpotAdd = wx.Button(G2frame.FRMC,label='Add')4928 bondpotAdd.Bind(wx.EVT_BUTTON,OnAddBondPot)4929 bondpotBox.Add(bondpotAdd,0,WACV)4930 bondpotBox.Add(wx.StaticText(G2frame.FRMC,label=' A-B stretch potential restraints, search range (%): '),0,WACV)4931 bondpotBox.Add(G2G.ValidatedTxtCtrl(G2frame.FRMC,RMCPdict['Potentials'],'Stretch search',min=0.,max=100.,size=(50,25)),0,WACV)4932 mainSizer.Add(bondpotBox,0,WACV)4933 if len(RMCPdict['Potentials']['Stretch']):4934 mainSizer.Add(GetBondSizer(),0,WACV)4935 4936 4942 G2G.HorizontalLine(mainSizer,G2frame.FRMC) 4937 4943 mainSizer.Add(wx.StaticText(G2frame.FRMC,label=' Select data:'),0,WACV) … … 5171 5177 generalData = data['General'] 5172 5178 RMCPdict = data['RMC']['RMCProfile'] 5179 atSeq = RMCPdict['atSeq'] 5173 5180 pName = generalData['Name'].replace(' ','_') 5174 5181 dlg = wx.FileDialog(G2frame, "Choose any RMCProfile csv results file for "+pName+":", … … 5275 5282 labelY=r'$\mathsf{\chi^2}$',newPlot=True,Title='RMCP Chi^2 for '+pName, 5276 5283 lines=True,names=Names[3:]) 5277 5284 #bond odf plots 5285 nPot = len(RMCPdict['Potentials']['Stretch']) 5286 for iPot in range(nPot): 5287 fname = pName+'.bondodf_%d'%(iPot+1) 5288 bond = RMCPdict['Potentials']['Stretch'][iPot] 5289 if os.path.exists(os.path.join(path,fname)): 5290 OutFile = open(fname,'r') 5291 odfFile = OutFile.readlines() 5292 if len(odfFile) > 1: 5293 OutFile.seek(0) 5294 odfData = np.fromfile(OutFile,sep=' ') 5295 numx,numy = odfData[:2] 5296 G2plt.Plot3dXYZ(G2frame,int(numx),int(numy),odfData[2:],newPlot=False,Title='Bond %s-%s'%(bond[0],bond[1])) 5278 5297 5279 5298 -
TabularUnified trunk/GSASIIplot.py ¶
r4236 r4265 5109 5109 5110 5110 ################################################################################ 5111 ##### Plot3dXYZ 5112 ################################################################################ 5113 5114 def Plot3dXYZ(G2frame,nX,nY,Zdat,labelX='X',labelY='Y',labelZ='Z',newPlot=False,Title=''): 5115 5116 def OnMotion(event): 5117 xpos = event.xdata 5118 if xpos: #avoid out of frame mouse position 5119 ypos = event.ydata 5120 G2frame.G2plotNB.status.SetStatusText('X =%.3f Y =%.4f'%(xpos,ypos),1) 5121 5122 def OnKeyPress(event): 5123 if event.key == 'g': 5124 mpl.rcParams['axes.grid'] = not mpl.rcParams['axes.grid'] 5125 5126 new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab(Title,'3d') 5127 if not new: 5128 if not Page.IsShown(): 5129 Page.Show() 5130 else: 5131 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 5132 Page.Choice = None 5133 G2frame.G2plotNB.status.SetStatusText('',1) 5134 Zmul = Zdat.reshape((nX,-1)).T 5135 PHI = np.linspace(0.,360.,int(nY),True) 5136 PSI = np.linspace(0.,180.,int(nX),True) 5137 X = Zmul*np.outer(npcosd(PHI),npsind(PSI))/2. 5138 Y = Zmul*np.outer(npsind(PHI),npsind(PSI))/2. 5139 Z = Zmul*np.outer(np.ones(np.size(PHI)),npcosd(PSI))/2. 5140 5141 if np.any(X) and np.any(Y) and np.any(Z): 5142 np.seterr(all='ignore') 5143 Plot.plot_surface(X,Y,Z,rstride=1,cstride=1,color='g',linewidth=1) 5144 xyzlim = np.array([Plot.get_xlim3d(),Plot.get_ylim3d(),Plot.get_zlim3d()]).T 5145 XYZlim = [min(xyzlim[0]),max(xyzlim[1])] 5146 Plot.contour(X,Y,Z,10,zdir='x',offset=XYZlim[0]) 5147 Plot.contour(X,Y,Z,10,zdir='y',offset=XYZlim[1]) 5148 Plot.contour(X,Y,Z,10,zdir='z',offset=XYZlim[0]) 5149 Plot.set_xlim3d(XYZlim) 5150 Plot.set_ylim3d(XYZlim) 5151 Plot.set_zlim3d(XYZlim) 5152 try: 5153 Plot.set_aspect('equal') 5154 except: #broken in mpl 3.1.1; worked in mpl 3.0.3 5155 pass 5156 Plot.set_title(Title) 5157 Plot.set_xlabel(labelX) 5158 Plot.set_ylabel(labelY) 5159 Plot.set_zlabel(labelZ) 5160 Page.canvas.draw() 5161 5162 ################################################################################ 5111 5163 ##### PlotHist 5112 5164 ################################################################################ -
TabularUnified trunk/GSASIIpwd.py ¶
r4264 r4265 2358 2358 fl.write('\n') 2359 2359 fl.write('POTENTIALS ::\n') 2360 fl.write(' > TEMPERATURE :: %.1f K\n'%RMCPdict['Potentials']['Pot. Temp.']) 2361 fl.write(' > PLOT :: pixels=400, colour=red, zangle=90, zrotation=45 deg\n') 2360 2362 if len(RMCPdict['Potentials']['Stretch']): 2361 2363 fl.write(' > STRETCH_SEARCH :: %.1f%%\n'%RMCPdict['Potentials']['Stretch search'])
Note: See TracChangeset
for help on using the changeset viewer.