Changeset 654


Ignore:
Timestamp:
Jun 23, 2012 7:16:24 PM (9 years ago)
Author:
vondreele
Message:

revert findOffset back to version 648

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r652 r654  
    619619    if SGData['SpGrp'] == 'P 1':
    620620        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'
    622622    mapShape = rho.shape
    623623    steps = np.array(mapShape)
     
    639639    DH = []
    640640    Dphi = []
    641     while i < 20:       #use 20 strongest F's
     641    while i < 20:
    642642        F = Flist[i]
    643643        hkl = np.unravel_index(Fdict[F],hklShape)
     
    656656                continue
    657657            DH.append(dH)
    658             Dphi.append((dang+.5) % 1.0)
     658            Dphi.append((dang+0.5) % 1.0)
    659659        i += 1
    660660    DH = np.array(DH)
     
    663663#        print item[0],'%.4f'%(item[1])
    664664    DX = np.zeros(3)
    665     X,Y,Z = np.mgrid[0:12,0:12,0:12]
     665    X,Y,Z = np.mgrid[0:1:10j,0:1:10j,0:1:10j]
    666666    XYZ = np.array(zip(X.flatten(),Y.flatten(),Z.flatten()))
    667667    Mmin = 1.e10
    668     Ms = []
    669668   
    670669    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)
    673671        if M < Mmin:
    674672            DX = xyz
    675673            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   
    680675    result = so.leastsq(calcPhase,DX,full_output=True,args=(DH,Dphi))
    681676#    for item in zip(DH,Dphi,result[2]['fvec']):
Note: See TracChangeset for help on using the changeset viewer.