Changeset 1786
- Timestamp:
- Apr 10, 2015 1:14:03 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r1780 r1786 1775 1775 hkl = np.asarray(hkl,dtype='i') 1776 1776 dp = 360.*Phi[i] #and phi 1777 a = cosd(ph +dp)1778 b = sind(ph +dp)1779 phasep = complex(a,b) 1780 phasem = complex(a,-b) 1777 a = cosd(ph) 1778 b = sind(ph) 1779 phasep = complex(a,b)+dp 1780 phasem = complex(a,-b)-dp 1781 1781 if 'Fobs' in mapData['MapType']: 1782 1782 F = np.where(Fosq>0.,np.sqrt(Fosq),0.) -
trunk/GSASIIplot.py
r1780 r1786 647 647 if 'HKLF' in Name: 648 648 Fosq,sig,Fcsq = refl[5+Super:8+Super] 649 if refl[3+Super] < 0: 650 Fosq,sig,Fcsq = [0,1,0] 649 651 else: 650 652 Fosq,sig,Fcsq = refl[8+Super],1.0,refl[9+Super] … … 696 698 return HKL,zip(list(R),C) 697 699 700 def GetTruePosition(xy): 701 View = glGetIntegerv(GL_VIEWPORT) 702 Proj = glGetDoublev(GL_PROJECTION_MATRIX) 703 Model = glGetDoublev(GL_MODELVIEW_MATRIX) 704 Zmax = 1. 705 for i,ref in enumerate(hklRef): 706 h,k,l = ref[1:4] 707 X,Y,Z = gluProject(h,k,l,Model,Proj,View) 708 XY = [int(X),int(Y)] 709 print xy,XY 710 if np.allclose(xy,XY,atol=10): 711 Zmax = Z 712 return [h,k,l] 713 698 714 def SetTranslation(newxy): 699 715 #first get translation vector in screen coords. … … 779 795 Q = drawingData['Quaternion'] 780 796 Draw('move') 797 # else: 798 # hkl = GetTruePosition(newxy) 781 799 782 800 def OnMouseWheel(event): -
trunk/GSASIIstrMath.py
r1785 r1786 865 865 Tcorr = Tiso*Tuij*Mdata*Fdata/len(SGMT) 866 866 fa = np.array([((FF+FP).T-Bab).T*cosp*Tcorr,-FPP*sinp*Tcorr]) 867 fa = np.reshape(fa,(2,len(refl),len(SGT),len(Mdata))) 868 fas = np.sum(np.sum(fa,axis=2),axis=2) #real 869 fbs = np.zeros_like(fas) 870 if not SGData['SGInv']: 871 fb = np.array([((FF+FP).T-Bab).T*sinp*Tcorr,FPP*cosp*Tcorr]) 872 fb = np.reshape(fb,(2,len(refl),len(SGT),len(Mdata))) 873 fbs = np.sum(np.sum(fb,axis=2),axis=2) 874 fasq = fas**2 875 fbsq = fbs**2 #imaginary 876 refl.T[9] = np.sum(fasq,axis=0)+np.sum(fbsq,axis=0) 877 refl.T[10] = atan2d(fbs[0],fas[0]) 867 fa = np.reshape(fa,(2,len(refl),len(SGT),len(Mdata))) #real A,-b 868 fas = np.sum(np.sum(fa,axis=2),axis=2) #real sum over atoms & unique hkl 869 fb = np.array([((FF+FP).T-Bab).T*sinp*Tcorr,FPP*cosp*Tcorr]) 870 fb = np.reshape(fb,(2,len(refl),len(SGT),len(Mdata))) #imag -B,+a 871 fbs = np.sum(np.sum(fb,axis=2),axis=2) #imag sum over atoms & uniq hkl 872 if SGData['SGInv']: #centrosymmetric; B=0 873 fbs[0] *= 0. 874 if 'P' in calcControls[hfx+'histType']: 875 refl.T[9] = np.sum(fas**2,axis=0)+np.sum(fbs**2,axis=0) 876 else: 877 refl.T[9] = np.sum(fas,axis=0)**2+np.sum(fbs,axis=0)**2 878 refl.T[10] = atan2d(fbs[0],fas[0]) #ignore f' & f"? 879 # refl.T[10] = atan2d(np.sum(fbs,axis=0),np.sum(fas,axis=0)) #include f' & f" 878 880 iBeg += blkSize 879 881 … … 2453 2455 Fc = np.sqrt(ref[7+im]) 2454 2456 w = 1.0/ref[6+im] 2455 if 2.0*Fo*w*Fo>= calcControls['minF/sig'] and ref[3+im] > 0:2457 if ref[5+im]/ref[6+im] >= calcControls['minF/sig'] and ref[3+im] > 0: 2456 2458 wdf[iref] = 2.0*Fo*w*(Fo-Fc) 2457 2459 for j,var in enumerate(varylist): … … 2726 2728 Fc = np.sqrt(ref[7+im]) 2727 2729 w = 2.0*(Fo/ref[6+im])**2 # 1/sig(F)? 2728 if w*Fo>= calcControls['minF/sig'] and ref[3+im] > 0: #min cutoff & user rejection2730 if ref[5+im]/ref[6+im] >= calcControls['minF/sig'] and ref[3+im] > 0: #min cutoff & user rejection 2729 2731 sumFo += Fo 2730 2732 sumFo2 += ref[5+im]
Note: See TracChangeset
for help on using the changeset viewer.