Changeset 4865 for trunk/GSASIIindex.py


Ignore:
Timestamp:
Mar 24, 2021 1:06:49 PM (7 months ago)
Author:
vondreele
Message:

fixes to monoclinic A,C,I centered cell indexing (still need to do P)
fix bug in bond restraints & add enhancement to atom requests for bonds, angles & planes.
Remove 'U' from open in G2phase.py - deprecated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIindex.py

    r4862 r4865  
    873873            Lhkl,M20,X20,Aref = refinePeaks(peaks,ibrav,Abeg,ifX20)
    874874            Asave.append([calc_M20(peaks,HKL,ifX20),Aref[:]])
    875             if ibrav in [9,10,11]:                          #C-centered orthorhombic
     875            if ibrav in [9,10,11]:                          #A,B,or C-centered orthorhombic
    876876                for i in range(2):
    877877                    Abeg = rotOrthoA(Abeg[:])
     
    900900    'needs a doc string'
    901901    a,b,c,alp,bet,gam = G2lat.A2cell(A)
     902    print(a,b,c,alp,bet,gam)
     903    if bet < 90.:
     904        bet = 180.-bet     #always want obtuse beta
     905        A = G2lat.cell2A([a,b,c,90.,bet,90.])
    902906    G,g = G2lat.A2Gmat(A)
    903     if ibrav in [13,]:    #I-monoclinic
    904         pass
    905         # u = [-1,0,0]
    906         # v = [1,0,1]
    907         # cnew = math.sqrt(np.dot(np.dot(v,g),v))
    908         # if cnew < c:
    909         #     cang = np.dot(np.dot(u,g),v)/(a*cnew)
    910         #     beta = acosd(-abs(cang))
    911         #     if beta < 90.: beta = 180.-beta
    912         #     A = G2lat.cell2A([a,b,cnew,90,beta,90])
     907    if ibrav in [13,]:    #I-monoclinic - checked OK
     908        u = [-1,0,0]
     909        v = [2,0,1]
     910        cnew = math.sqrt(np.dot(np.dot(v,g),v))
     911        if cnew < c:
     912            cang = np.dot(np.dot(u,g),v)/(a*cnew)
     913            beta = acosd(-abs(cang))
     914            if beta < 90.: beta = 180.-beta     #always want obtuse beta
     915            A = G2lat.cell2A([a,b,cnew,90,beta,90])
    913916    elif ibrav in [14,]:      #A-monoclinic - OK?
    914917        u = [0,0,-1]
     
    918921            cang = np.dot(np.dot(u,g),v)/(anew*c)
    919922            beta = acosd(-abs(cang))
    920             if beta < 90.: beta = 180.-beta
     923            if beta < 90.: beta = 180.-beta     #always want obtuse beta
    921924            A = G2lat.cell2A([anew,b,c,90,beta,90])
    922925    elif ibrav in [15,]:    #C-monoclinic - OK?
     
    927930            cang = np.dot(np.dot(u,g),v)/(a*cnew)
    928931            beta = acosd(-abs(cang))
    929             if beta < 90.: beta = 180.-beta
     932            if beta < 90.: beta = 180.-beta     #always want obtuse beta
    930933            A = G2lat.cell2A([a,b,cnew,90,beta,90])
    931934    return A
Note: See TracChangeset for help on using the changeset viewer.