Changeset 2476 for trunk/GSASIIlattice.py
 Timestamp:
 Sep 22, 2016 11:42:28 AM (5 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIlattice.py
r2473 r2476 657 657 rdsq = calc_rDsq(H[:3]+(H[3][:,np.newaxis]*vec).T,A)+Z/difC 658 658 return rdsq 659 660 def PlaneIntercepts(Amat,Bmat,H,phase,stack): 661 ''' find unit cell intercepts for a stack of hkl planes 662 ''' 663 Steps = range(1,2,2) 664 if stack: 665 Steps = range(10,10,1) 666 Stack = [] 667 Ux = np.array([[0,0],[1,0],[1,1],[0,1]]) 668 for step in Steps: 669 HX = [] 670 for i in [0,1,2]: 671 if H[i]: 672 h,k,l = [(i+1)%3,(i+2)%3,(i+3)%3] 673 for j in [0,1,2,3]: 674 hx = [0,0,0] 675 intcpt = (phase/360.+stepH[h]*Ux[j,0]H[k]*Ux[j,1])/H[l] 676 if 0. <= intcpt <= 1.: 677 hx[h] = Ux[j,0] 678 hx[k] = Ux[j,1] 679 hx[l] = intcpt 680 HX.append(hx) 681 if len(HX)> 2: 682 HX = np.array(HX) 683 DX = np.inner(HXHX[0],Amat) 684 D = np.sqrt(np.sum(DX**2,axis=1)) 685 Dsort = np.argsort(D) 686 HX = HX[Dsort] 687 DX = DX[Dsort] 688 D = D[Dsort] 689 DX[1:,:] = DX[1:,:]/D[1:,nxs] 690 A = 2.*np.ones(HX.shape[0]) 691 A[1:] = [np.dot(DX[1],dx) for dx in DX[1:]] 692 HX = HX[np.argsort(A)] 693 # GSASIIpath.IPyBreak() 694 Stack.append(HX) 695 return Stack 659 696 660 697 def MaxIndex(dmin,A):
Note: See TracChangeset
for help on using the changeset viewer.