Changeset 5361
- Timestamp:
- Nov 1, 2022 11:14:03 AM (5 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r5320 r5361 1345 1345 QuatA = AVdeg2Q(tor[0],Cart[seq[0]]-Cart[seq[1]]) 1346 1346 Cart[seq[3]] = prodQVQ(QuatA,(Cart[seq[3]]-Cart[seq[1]]))+Cart[seq[1]] 1347 elif RBType == 'Spin': 1348 Cart = [np.zeros(3),] 1347 1349 # if symmetry axis is defined, place symmetry axis along quaternion 1348 1350 if RBObj.get('symAxis') is None: -
trunk/GSASIIplot.py
r5348 r5361 6469 6469 S = 1.17741*np.sqrt(data[8])/T 6470 6470 G = data[10]/T 6471 W = G2pwd.getFWHM(T,Parms,0)/T 6471 6472 Plot.plot(Q,A,color='r',label='Alpha') 6472 6473 Plot.plot(Q,B,color='g',label='Beta') 6473 6474 Plot.plot(Q,S,color='b',label='Gaussian') 6474 6475 Plot.plot(Q,G,color='m',label='Lorentzian') 6476 Plot.plot(Q,W,color='g',label='FWHM (GL+ab)') 6475 6477 6476 6478 fit = G2mth.setPeakparms(Parms,Parms2,T,Z,useFit=True) … … 6484 6486 Sf = 1.17741*np.sqrt(fit[8])/T 6485 6487 Gf = fit[10]/T 6488 Wf = G2pwd.getFWHM(T,Parms)/T 6486 6489 Plot.plot(Q,Af,color='r',dashes=(5,5),label='Alpha fit') 6487 6490 Plot.plot(Q,Bf,color='g',dashes=(5,5),label='Beta fit') 6488 6491 Plot.plot(Q,Sf,color='b',dashes=(5,5),label='Gaussian fit') 6489 Plot.plot(Q,Gf,color='m',dashes=(5,5),label='Lorentzian fit') 6492 Plot.plot(Q,Gf,color='m',label='Lorentzian fit') 6493 Plot.plot(Q,Wf,color='g',dashes=(5,5),label='FWHM fit (GL+ab)') 6490 6494 6491 6495 Tp = [] … … 9763 9767 GL.glShadeModel(GL.GL_SMOOTH) 9764 9768 9765 def RenderSphere(x,y,z,radius,color ):9769 def RenderSphere(x,y,z,radius,color,fade=False): 9766 9770 GL.glMaterialfv(GL.GL_FRONT_AND_BACK,GL.GL_DIFFUSE,color) 9771 if fade: 9772 Fade = list(color) + [0.5,] 9773 GL.glMaterialfv(GL.GL_FRONT_AND_BACK,GL.GL_AMBIENT_AND_DIFFUSE,Fade) 9774 GL.glShadeModel(GL.GL_FLAT) 9775 GL.glEnable(GL.GL_BLEND) 9776 GL.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE_MINUS_SRC_ALPHA) 9767 9777 GL.glPushMatrix() 9768 9778 GL.glTranslate(x,y,z) … … 9771 9781 GLU.gluSphere(q,radius,20,10) 9772 9782 GL.glPopMatrix() 9783 if fade: 9784 GL.glDisable(GL.GL_BLEND) 9785 GL.glShadeModel(GL.GL_SMOOTH) 9773 9786 9774 9787 def RenderFadeSphere(x,y,z,radius,color): … … 10324 10337 except: 10325 10338 name = ' '+aType+str(ind) 10339 radius = 0.2 10340 Fade = False 10341 if testRBObj['rbType'] == 'Spin': 10342 radius = testRBObj['AtInfo'][aType][0][0] 10343 Fade = True 10326 10344 color = np.array(testRBObj['AtInfo'][aType][1]) 10327 10345 if 'RBhighLight' in testRBObj and testRBObj['RBhighLight'] == ind: # highlighted atom is green 10328 RenderSphere(x,y,z, 0.2,Gr)10346 RenderSphere(x,y,z,radius,Gr,Fade) 10329 10347 else: 10330 RenderSphere(x,y,z, 0.2,color/255.)10348 RenderSphere(x,y,z,radius,color/255.,Fade) 10331 10349 RenderBonds(x,y,z,rbBonds[ind],0.03,Gr) 10332 10350 RenderLabel(x,y,z,name,0.2,wxOrange,matRot) … … 10667 10685 GL.glDisable(GL.GL_COLOR_MATERIAL) 10668 10686 10669 def RenderSphere(x,y,z,radius,color): 10687 def RenderSphere(x,y,z,radius,color,fade=False): 10688 if fade: 10689 Fade = list(color) + [0.5,] 10690 GL.glMaterialfv(GL.GL_FRONT_AND_BACK,GL.GL_AMBIENT_AND_DIFFUSE,Fade) 10670 10691 GL.glMaterialfv(GL.GL_FRONT_AND_BACK,GL.GL_DIFFUSE,color) 10671 10692 GL.glPushMatrix() -
trunk/GSASIIpwd.py
r5320 r5361 845 845 return widths,fmin,fmax 846 846 847 def getFWHM(pos,Inst ):847 def getFWHM(pos,Inst,N=1): 848 848 '''Compute total FWHM from Thompson, Cox & Hastings (1987) , J. Appl. Cryst. 20, 79-83 849 849 via getgamFW(g,s). … … 851 851 :param pos: float peak position in deg 2-theta or tof in musec 852 852 :param Inst: dict instrument parameters 853 :param N: int Inst index (0 for input, 1 for fitted) 853 854 854 855 :returns float: total FWHM of pseudoVoigt in deg or musec … … 867 868 return 3 868 869 elif 'T' in Inst['Type'][0]: 869 dsp = pos/Inst['difC'][ 1]870 alp = alpTOF(dsp,Inst['alpha'][ 1])871 bet = betTOF(dsp,Inst['beta-0'][1],Inst['beta-1'][ 1],Inst['beta-q'][1])872 s = sigTOF(dsp,Inst['sig-0'][ 1],Inst['sig-1'][1],Inst['sig-2'][1],Inst['sig-q'][1])873 g = gamTOF(dsp,Inst['X'][ 1],Inst['Y'][1],Inst['Z'][1])870 dsp = pos/Inst['difC'][N] 871 alp = alpTOF(dsp,Inst['alpha'][N]) 872 bet = betTOF(dsp,Inst['beta-0'][1],Inst['beta-1'][N],Inst['beta-q'][N]) 873 s = sigTOF(dsp,Inst['sig-0'][N],Inst['sig-1'][N],Inst['sig-2'][N],Inst['sig-q'][N]) 874 g = gamTOF(dsp,Inst['X'][N],Inst['Y'][N],Inst['Z'][N]) 874 875 return getgamFW(g,s)+np.log(2.0)*(alp+bet)/(alp*bet) 875 876 elif 'C' in Inst['Type'][0]: 876 s = sig(pos/2.,Inst['U'][ 1],Inst['V'][1],Inst['W'][1])877 g = gam(pos/2.,Inst['X'][ 1],Inst['Y'][1],Inst['Z'][1])877 s = sig(pos/2.,Inst['U'][N],Inst['V'][N],Inst['W'][N]) 878 g = gam(pos/2.,Inst['X'][N],Inst['Y'][N],Inst['Z'][N]) 878 879 return getgamFW(g,s)/100. #returns FWHM in deg 879 880 elif 'E' in Inst['Type'][0]: 880 s = sigED(pos,Inst['A'][ 1],Inst['B'][1],Inst['C'][1])881 s = sigED(pos,Inst['A'][N],Inst['B'][N],Inst['C'][N]) 881 882 return 2.35482*s 882 883 else: #'B' 883 alp = alpPink(pos,Inst['alpha-0'][ 1],Inst['alpha-1'][1])884 bet = betPink(pos,Inst['beta-0'][ 1],Inst['beta-1'][1])885 s = sig(pos/2.,Inst['U'][ 1],Inst['V'][1],Inst['W'][1])886 g = gam(pos/2.,Inst['X'][ 1],Inst['Y'][1],Inst['Z'][1])884 alp = alpPink(pos,Inst['alpha-0'][N],Inst['alpha-1'][N]) 885 bet = betPink(pos,Inst['beta-0'][N],Inst['beta-1'][N]) 886 s = sig(pos/2.,Inst['U'][N],Inst['V'][N],Inst['W'][N]) 887 g = gam(pos/2.,Inst['X'][N],Inst['Y'][N],Inst['Z'][N]) 887 888 return getgamFW(g,s)/100.+np.log(2.0)*(alp+bet)/(alp*bet) #returns FWHM in deg 888 889
Note: See TracChangeset
for help on using the changeset viewer.