Changeset 4337
- Timestamp:
- Mar 3, 2020 7:45:23 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r4334 r4337 4340 4340 # rdlist is only expected to have one element 4341 4341 rd = rdlist[0] 4342 Strict = True 4343 if 'rmc6f' in rd.readfilename: 4344 Strict = False 4345 idx = -1 4342 4346 G2frame.OnFileSave(event) 4343 4347 # rd contains all info for a phase … … 4351 4355 for atom in rd.Phase['Atoms']: 4352 4356 try: 4353 idx = atomNames.index(''.join(atom[:ct+1]).capitalize()) #eliminate spurious differences 4357 if Strict: 4358 idx = atomNames.index(''.join(atom[:ct+1]).capitalize()) #eliminate spurious differences 4359 else: 4360 idx += 1 4354 4361 atId = atomData[idx][cia+8] #save old Id 4355 4362 atomData[idx][:cia+8] = atom[:cia+8]+[atId,] … … 4768 4775 valChoice = atmdata.BVSoxid[RMCPdict['atSeq'][itype]] 4769 4776 valSel = wx.ComboBox(G2frame.FRMC,choices=valChoice,style=wx.CB_DROPDOWN|wx.TE_READONLY) 4770 valSel.SetStringSelection(RMCPdict['Oxid'][itype][0]) 4777 try: 4778 valSel.SetStringSelection(RMCPdict['Oxid'][itype][0]) 4779 except IndexError: 4780 RMCPdict['Oxid'].append([RMCPdict['atSeq'][itype],0.0]) 4771 4781 valSel.Bind(wx.EVT_COMBOBOX,OnValSel) 4772 4782 Indx[valSel.GetId()] = itype … … 5449 5459 if 'Q' in label: 5450 5460 XY = [[X.T,Y.T] for iy,Y in enumerate(Partials) if 'Va' not in Names[iy+1]] 5451 Names = [name for name in Names if 'Va' not in name]5452 5461 else: 5453 XY = [[X.T,(DX*Y.T)] for Y in Partials] 5462 XY = [[X.T,(DX*Y.T)] for iy,Y in enumerate(Partials) if 'Va' not in Names[iy+1]] 5463 Names = [name for name in Names if 'Va' not in name] 5454 5464 if 'G(R)' in Labels[label][1]: 5455 5465 if ifNeut: … … 5474 5484 if '-' in name: 5475 5485 at1,at2 = name.strip().split('-') 5476 bcorr.append(bfac[at1]*bfac[at2]) 5486 if 'Va' in name: 5487 bcorr.append(0.) 5488 else: 5489 bcorr.append(bfac[at1]*bfac[at2]) 5477 5490 if at1 == at2: 5478 5491 bcorr[-1] /= 2. #no double counting -
trunk/GSASIIplot.py
r4334 r4337 24 24 :func:`PlotStructure` Crystal structure plotting with balls, sticks, lines, 25 25 ellipsoids, polyhedra and magnetic moments 26 :func:`PlotBeadModel` Plots representation of protein shape from small angle scattering 26 27 :func:`Plot1DSngl` 1D stick plots of structure factors 27 28 :func:`PlotSngl` Structure factor plotting … … 32 33 :func:`PlotXY` Simple plot of xy data 33 34 :func:`PlotXYZ` Simple contour plot of xyz data 35 :func:`PlotXYZvect` Scatter Plot for 3D cartesian vectors 36 :func:`Plot3Dxyz` Surface Plot for 3D vectors 34 37 :func:`PlotAAProb` Protein "quality" plot 35 38 :func:`PlotStrain` Plot of strain data, used for diagnostic purposes … … 3238 3241 if 'PWDR' in plottype: 3239 3242 Plot.set_yscale("log",nonposy='mask') 3240 Plot.plot(X,Y, colors[0]+pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))3243 Plot.plot(X,Y,marker=pP,color=colors[0],picker=3.,clip_on=Clip_on,label=incCptn('obs')) 3241 3244 if G2frame.SinglePlot or G2frame.plusPlot: 3242 3245 Plot.plot(X,Z,colors[1],picker=False,label=incCptn('calc')) … … 3254 3257 ecolor=colors[0],picker=3.,clip_on=Clip_on,label=incCptn('obs')) 3255 3258 else: 3256 Plot.plot(X,YB, colors[0]+pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))3259 Plot.plot(X,YB,marker=pP,color=colors[0],picker=3.,clip_on=Clip_on,label=incCptn('obs')) 3257 3260 Plot.plot(X,W,colors[1],picker=False,label=incCptn('bkg')) #const. background 3258 3261 Plot.plot(X,ZB,colors[2],picker=False,label=incCptn('calc')) … … 3260 3263 if G2frame.SubBack: 3261 3264 if 'PWDR' in plottype: 3262 ObsLine = Plot.plot(Xum,Y,color s[0]+pP,picker=False,clip_on=Clip_on,label=incCptn('obs-bkg')) #Io-Ib3265 ObsLine = Plot.plot(Xum,Y,color=colors[0],marker=pP,picker=False,clip_on=Clip_on,label=incCptn('obs-bkg')) #Io-Ib 3263 3266 if np.any(Z): #only if there is a calc pattern 3264 3267 CalcLine = Plot.plot(X,Z-W,colors[1],picker=False,label=incCptn('calc-bkg')) #Ic-Ib 3265 3268 else: 3266 Plot.plot(X,YB,color s[0]+pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))3269 Plot.plot(X,YB,color=colors[0],marker=pP,picker=3.,clip_on=Clip_on,label=incCptn('obs')) 3267 3270 Plot.plot(X,ZB,colors[2],picker=False,label=incCptn('calc')) 3268 3271 else: 3269 3272 if 'PWDR' in plottype: 3270 ObsLine = Plot.plot(Xum,Y,color s[0]+pP,picker=3.,clip_on=Clip_on,label=incCptn('obs')) #Io3273 ObsLine = Plot.plot(Xum,Y,color=colors[0],marker=pP,picker=3.,clip_on=Clip_on,label=incCptn('obs')) #Io 3271 3274 CalcLine = Plot.plot(X,Z,colors[1],picker=False,label=incCptn('calc')) #Ic 3272 3275 else: 3273 Plot.plot(X,YB,color s[0]+pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))3276 Plot.plot(X,YB,color=colors[0],marler=pP,picker=3.,clip_on=Clip_on,label=incCptn('obs')) 3274 3277 Plot.plot(X,ZB,colors[2],picker=False,label=incCptn('calc')) 3275 3278 if 'PWDR' in plottype and (G2frame.SinglePlot and G2frame.plusPlot): … … 4973 4976 Plot.set_xlabel(r''+labelX,fontsize=14) 4974 4977 Plot.set_ylabel(r''+labelY,fontsize=14) 4975 colors=['b','r','g','c','m','k'] 4978 colors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black', 4979 'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',] 4980 NC = len(colors) 4976 4981 Page.keyPress = OnKeyPress 4977 4982 Xmax = 0. … … 4985 4990 dY = Page.Offset[1]*(ixy)*Ymax/100. 4986 4991 if len(names): 4987 Plot.plot(X+dX,Y+dY,colors[ixy% 6],picker=False,label=names[ixy])4992 Plot.plot(X+dX,Y+dY,colors[ixy%NC],picker=False,label=names[ixy]) 4988 4993 else: 4989 Plot.plot(X+dX,Y+dY,colors[ixy% 6],picker=False)4994 Plot.plot(X+dX,Y+dY,colors[ixy%NC],picker=False) 4990 4995 else: 4991 Plot.plot(X,Y, colors[ixy%6]+'+',picker=False)4996 Plot.plot(X,Y,marker='+',color=colors[ixy%NC],picker=False) 4992 4997 if len(vertLines): 4993 4998 for ixy,X in enumerate(vertLines): 4994 4999 dX = Page.Offset[0]*(ixy)*Xmax/500. 4995 5000 for x in X: 4996 Plot.axvline(x+dX,color=colors[ixy% 6],dashes=(5,5),picker=False)5001 Plot.axvline(x+dX,color=colors[ixy%NC],dashes=(5,5),picker=False) 4997 5002 if XY2 is not None and len(XY2): 4998 5003 for ixy,xy in enumerate(XY2): … … 5001 5006 dY = Page.Offset[1]*(ixy+1)*Ymax/100. 5002 5007 if len(names2): 5003 Plot.plot(X+dX,Y+dY,colors[ixy% 6],picker=False,label=names2[ixy])5008 Plot.plot(X+dX,Y+dY,colors[ixy%NC],picker=False,label=names2[ixy]) 5004 5009 else: 5005 Plot.plot(X+dX,Y+dY,colors[ixy% 6],picker=False)5010 Plot.plot(X+dX,Y+dY,colors[ixy%NC],picker=False) 5006 5011 if len(names): 5007 5012 Plot.legend(names,loc='best') … … 5240 5245 xyzlim = np.array([Plot.get_xlim3d(),Plot.get_ylim3d(),Plot.get_zlim3d()]).T 5241 5246 XYZlim = [min(xyzlim[0]),max(xyzlim[1])] 5242 # Plot.contour(X,Y,Z,10,zdir='x',offset=XYZlim[0])5243 # Plot.contour(X,Y,Z,10,zdir='y',offset=XYZlim[1])5244 # Plot.contour(X,Y,Z,10,zdir='z',offset=XYZlim[0])5245 5247 Plot.set_xlim3d(XYZlim) 5246 5248 Plot.set_ylim3d(XYZlim) 5247 5249 Plot.set_zlim3d(XYZlim) 5250 Plot.set_title(Title) 5251 Plot.set_xlabel(labelX) 5252 Plot.set_ylabel(labelY) 5253 Plot.set_zlabel(labelZ) 5254 Plot.set_aspect('equal') 5248 5255 except: 5256 print('Plot3dXYZ failure') 5249 5257 pass 5250 try:5251 Plot.set_aspect('equal')5252 except: #broken in mpl 3.1.1; worked in mpl 3.0.35253 pass5254 Plot.set_title(Title)5255 Plot.set_xlabel(labelX)5256 Plot.set_ylabel(labelY)5257 Plot.set_zlabel(labelZ)5258 5258 Page.canvas.draw() 5259 5259 … … 5348 5348 Plot.set_ylabel(r'd-spacing',fontsize=14) 5349 5349 Plot.set_xlabel(r'Azimuth',fontsize=14) 5350 colors=['b','g','r','c','m','k'] 5350 # colors=['b','g','r','c','m','k'] 5351 colors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black', 5352 'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',] 5353 NC = len(colors) 5351 5354 for N,item in enumerate(data['d-zero']): 5352 5355 Y,X = np.array(item['ImtaObs']) #plot azimuth as X & d-spacing as Y 5353 Plot.plot(X,Y, colors[N%6]+'+',picker=False)5356 Plot.plot(X,Y,marker='+',color=colors[N%NC],picker=False) 5354 5357 Y,X = np.array(item['ImtaCalc']) 5355 Plot.plot(X,Y,colors[N% 6],picker=False)5358 Plot.plot(X,Y,colors[N%NC],picker=False) 5356 5359 Plot.plot([0.,360.],[item['Dcalc'],item['Dcalc']],colors[5],dashes=(5,5)) 5357 5360 if not newPlot: … … 5444 5447 Plot.set_xlim([np.min(2.*Bins)/2.,np.max(2.*Bins)*2.]) 5445 5448 Plot.bar(2.*Bins-Dbins,BinMag,2.*Dbins,facecolor='white',edgecolor='green') #plot diameters 5446 colors=['b','r','c','m','k'] 5449 # colors=['b','r','c','m','k'] 5450 colors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black', 5451 'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',] 5452 NC = len(colors) 5447 5453 if 'Size Calc' in data: 5448 5454 Rbins,Dist = data['Size Calc'] 5449 5455 for i in range(len(Rbins)): 5450 5456 if len(Rbins[i]): 5451 Plot.plot(2.*Rbins[i],Dist[i],color=colors[i% 5]) #plot diameters5457 Plot.plot(2.*Rbins[i],Dist[i],color=colors[i%NC]) #plot diameters 5452 5458 Page.canvas.draw() 5453 5459 … … 6651 6657 'press L to toggle lines, S to select X axis, T to change titles (reselect column to show?)',1) 6652 6658 Plot.clear() 6653 colors=['b','g','r','c','m','k'] 6659 # colors=['b','g','r','c','m','k'] 6660 colors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black', 6661 'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',] 6662 NC = len(colors) 6654 6663 uselist = G2frame.SeqTable.GetColValues(1) 6655 6664 X = np.arange(0,G2frame.SeqTable.GetNumberRows(),1) … … 6664 6673 G2frame.seqXaxis = None 6665 6674 for ic,col in enumerate(Page.seqYaxisList): 6666 Ncol = colors[ic% 6]6675 Ncol = colors[ic%NC] 6667 6676 name,Y,sig = Page.seqTableGet(col) 6668 6677 if G2frame.seqReverse and not G2frame.seqXaxis: … … 6693 6702 else: 6694 6703 Plot.plot(Xnew,Ynew,color=Ncol) 6695 Plot.plot(Xnew,Ynew, 'o',color=Ncol,label=name)6704 Plot.plot(Xnew,Ynew,marker='o',color=Ncol,label=name) 6696 6705 if Page.fitvals: # TODO: deal with fitting of None values 6697 6706 if G2frame.seqReverse and not G2frame.seqXaxis: 6698 6707 Page.fitvals = Page.fitvals[::-1] 6699 Plot.plot(X,Page.fitvals,label='Fit',color=colors[(ic+2)% 6])6708 Plot.plot(X,Page.fitvals,label='Fit',color=colors[(ic+2)%NC]) 6700 6709 6701 6710 Plot.legend(loc='best') … … 6886 6895 #Dsp = lambda tth,wave: wave/(2.*npsind(tth/2.)) 6887 6896 global Data,Masks,StrSta,Plot1,Page # RVD: these are needed for multiple image controls/masks 6888 colors=['b','g','r','c','m','k'] 6897 # colors=['b','g','r','c','m','k'] 6898 colors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black', 6899 'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',] 6900 NC = len(colors) 6889 6901 Data = G2frame.GPXtree.GetItemPyData( 6890 6902 G2gd.GetGPXtreeItemId(G2frame,G2frame.Image, 'Image Controls')) … … 7760 7772 for ring in Data['rings']: 7761 7773 xring,yring = np.array(ring).T[:2] 7762 Plot.plot(xring,yring,'.',color=colors[N% 6])7774 Plot.plot(xring,yring,'.',color=colors[N%NC]) 7763 7775 N += 1 7764 7776 for ellipse in Data['ellipses']: #what about hyperbola? … … 7771 7783 if 'ImxyCalc' in ring: 7772 7784 xringc,yringc = ring['ImxyCalc'] 7773 Plot.plot(xringc,yringc,colors[N% 6])7785 Plot.plot(xringc,yringc,colors[N%NC]) 7774 7786 xring,yring = ring['ImxyObs'] 7775 Plot.plot(xring,yring, colors[N%6]+'.')7787 Plot.plot(xring,yring,'.',colors[N%NC]) 7776 7788 # display the Masks 7777 7789 if 'Frames' not in Masks: Masks['Frames'] = [] # patch … … 10352 10364 Plot.set_xlabel(r'$\Delta 2\theta, deg$',fontsize=14) 10353 10365 Plot.set_ylabel(r'Intensity (arbitrary)',fontsize=14) 10354 refColors=['b','r','c','g','m','k'] 10366 # refColors=['b','r','c','g','m','k'] 10367 refColors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black', 10368 'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',] 10355 10369 ttmin = ttmax = 0 10356 10370 #GSASIIpath.IPyBreak() -
trunk/GSASIIpwd.py
r4334 r4337 2119 2119 if useSamBrd[0]: 2120 2120 if 'ellipsoidal' not in Size[0]: #take the isotropic term only 2121 Xsb = 1.e-4*difC/ Size[1][0]/2.2121 Xsb = 1.e-4*difC/(2.*Size[1][0]) 2122 2122 if useSamBrd[1]: 2123 2123 if 'generalized' not in Mustrain[0]: #take the isotropic term only … … 2394 2394 fl.write(' > RIJ :: %s\n'%' '.join(['%6.3f'%RMCPdict['BVS'][bvs][0] for bvs in RMCPdict['BVS']])) 2395 2395 fl.write(' > BVAL :: %s\n'%' '.join(['%6.3f'%RMCPdict['BVS'][bvs][1] for bvs in RMCPdict['BVS']])) 2396 fl.write(' > CUTOFF :: %s\n'%' '.join(['%6.3f'%RMCPdict['BVS'][bvs][ 3] for bvs in RMCPdict['BVS']]))2396 fl.write(' > CUTOFF :: %s\n'%' '.join(['%6.3f'%RMCPdict['BVS'][bvs][2] for bvs in RMCPdict['BVS']])) 2397 2397 fl.write(' > SAVE :: 100000\n') 2398 2398 fl.write(' > UPDATE :: 100000\n') -
trunk/atmdata.py
r4267 r4337 439 439 'U' :['U+4','U+6',], 440 440 'V': ['V+5','V+4','V+3',], 441 'Va':['Va',], #vacancy 441 442 'W' :['W+6',], 442 443 'Y' :['Y+3',], … … 549 550 'V+3':[ 1.743, 1.702, 2.19], 550 551 'V+4':[ 1.784, 1.7, 2.16], 551 'V+5':[ 1.803, 1.71, 2.16], 552 'V+5':[ 1.803, 1.71, 2.16], 552 553 'W+6':[ 1.921, 1.83, 2.27], 553 554 'Y+3':[ 2.014, 1.904, 2.4],
Note: See TracChangeset
for help on using the changeset viewer.