Changeset 654
 Timestamp:
 Jun 23, 2012 7:16:24 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIImath.py
r652 r654 619 619 if SGData['SpGrp'] == 'P 1': 620 620 return [0,0,0] 621 # will need to consider 'SGPolax': one of '','x','y','x y','z','x z','y z','xyz','111' ?621 # will need to consider 'SGPolax': one of '','x','y','x y','z','x z','y z','xyz','111' 622 622 mapShape = rho.shape 623 623 steps = np.array(mapShape) … … 639 639 DH = [] 640 640 Dphi = [] 641 while i < 20: #use 20 strongest F's641 while i < 20: 642 642 F = Flist[i] 643 643 hkl = np.unravel_index(Fdict[F],hklShape) … … 656 656 continue 657 657 DH.append(dH) 658 Dphi.append((dang+ .5) % 1.0)658 Dphi.append((dang+0.5) % 1.0) 659 659 i += 1 660 660 DH = np.array(DH) … … 663 663 # print item[0],'%.4f'%(item[1]) 664 664 DX = np.zeros(3) 665 X,Y,Z = np.mgrid[0:1 2,0:12,0:12]665 X,Y,Z = np.mgrid[0:1:10j,0:1:10j,0:1:10j] 666 666 XYZ = np.array(zip(X.flatten(),Y.flatten(),Z.flatten())) 667 667 Mmin = 1.e10 668 Ms = []669 668 670 669 for xyz in XYZ: #do a global search for best roll 671 M = np.sum(calcPhase(xyz/12.,DH,Dphi)**2) 672 Ms.append(M) 670 M = np.sum(calcPhase(xyz,DH,Dphi)**2) 673 671 if M < Mmin: 674 672 DX = xyz 675 673 Mmin = M 676 # Ms = np.array(Ms) 677 # Ms = np.reshape(Ms,newshape=(12,12,12)) 678 # printRho(SGData['SGLaue'],Ms,np.max(Ms)) 679 print ' Search result:',Mmin,DX 674 680 675 result = so.leastsq(calcPhase,DX,full_output=True,args=(DH,Dphi)) 681 676 # for item in zip(DH,Dphi,result[2]['fvec']):
Note: See TracChangeset
for help on using the changeset viewer.