Changeset 3583


Ignore:
Timestamp:
Sep 3, 2018 11:38:48 AM (3 years ago)
Author:
vondreele
Message:

fixes so orthorhombic mag space groups from Bilbao conserve axes - nonstd space groups produced

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIlattice.py

    r3579 r3583  
    353353    return newPhase,atCodes
    354354   
     355def FindNonstandard(Phase):
     356    abc = np.eye(3)
     357    cba = np.rot90(np.eye(3))
     358    cba[0,2] *= -1      #makes -cba
     359    Mats = {'abc':abc,'cab':np.roll(abc,2,1),'bca':np.roll(abc,1,1),
     360            'acb':np.roll(cba,1,1),'bac':np.roll(cba,2,1),'cba':cba}
     361    BNS = {'A':{'abc':'A','cab':'C','bca':'B','acb':'B','bac':'C','cba':'A'},
     362           'B':{'abc':'B','cab':'A','bca':'C','acb':'C','bac':'A','cba':'B'},
     363           'C':{'abc':'C','cab':'B','bca':'A','acb':'A','bac':'B','cba':'C'},
     364           'a':{'abc':'a','cab':'c','bca':'b','acb':'b','bac':'c','cba':'a'},
     365           'b':{'abc':'b','cab':'a','bca':'c','acb':'c','bac':'a','cba':'b'},
     366           'c':{'abc':'c','cab':'b','bca':'a','acb':'a','bac':'b','cba':'c'},
     367           'S':{'abc':'S','cab':'S','bca':'S','acb':'S','bac':'S','cba':'S'},
     368           }
     369    Fives = {'ababc':'abc','bcbca':'cba'}
     370    Trans = Phase['Trans']
     371    Uvec = Phase['Uvec']
     372    SGData = Phase['SGData']
     373    MSG = SGData['MagSpGrp'].split(' ',1)
     374    bns = ''
     375    if '_' in MSG[0]:
     376        bns = MSG[0][2]
     377    spn = SGData['SGSpin']
     378       
     379   
     380    if 'ortho' in SGData['SGSys']:
     381        transText = G2spc.Trans2Text(nl.inv(Trans))
     382        lattSym = ''
     383        for fld in transText.split(','):
     384            if 'a' in fld: lattSym += 'a'
     385            if 'b' in fld: lattSym += 'b'
     386            if 'c' in fld: lattSym += 'c'
     387        if len(lattSym) == 5:
     388            print(transText,lattSym)
     389            lattSym = Fives[lattSym]
     390#            return None
     391        SpGrp = SGData['SpGrp']
     392        NUvec = np.inner(np.abs(Mats[lattSym]),Uvec)
     393        NTrans = np.inner(Mats[lattSym],Trans.T)
     394        spn[1:4] = np.inner(Mats[lattSym],spn[1:4])
     395        if SpGrp in G2spc.altSettingOrtho:
     396            NSG = G2spc.altSettingOrtho[SpGrp].get(lattSym,SpGrp).replace("'",'').split(' ')
     397            Bns = ''
     398            if bns:
     399                Bns = BNS[bns][lattSym]
     400                NSG[0] += '_'+Bns+' '
     401            else:
     402                for ifld in [1,2,3]:
     403                    if spn[ifld] < 0:
     404                        NSG[ifld] += "'"
     405            Nresult = [''.join(NSG)+'  ',Bns]
     406            return Nresult,NUvec,NTrans
     407        else:
     408            Nresult = [SpGrp,'']
     409            return None
     410    return None
     411       
     412def makeBilbaoPhase(result,uvec,trans):
     413    phase = {}
     414    phase['Name'] = result[0].strip()
     415    phase['Uvec'] = uvec
     416    phase['Trans'] = trans
     417    phase['Keep'] = False
     418    phase['Use'] = False
     419    SpGp = result[0].replace("'",'')
     420    SpGrp = G2spc.StandardizeSpcName(SpGp)
     421    phase['SGData'] = G2spc.SpcGroup(SpGrp)[1]
     422    phase['SGData']['GenSym'],phase['SGData']['GenFlg'],BNSsym = G2spc.GetGenSym(phase['SGData'])
     423    phase['SGData']['MagSpGrp'] = G2spc.MagSGSym(phase['SGData'])
     424    phase['SGData']['SGSpin'] = G2spc.GetSGSpin(phase['SGData'],result[0])
     425    BNSlatt = phase['SGData']['SGLatt']
     426    if result[1]:
     427        BNSlatt += '_'+result[1]
     428        BNSsym = G2spc.GetGenSym(phase['SGData'])[2]
     429        phase['SGData']['BNSlattsym'] = [BNSlatt,BNSsym[BNSlatt]]
     430        G2spc.ApplyBNSlatt(phase['SGData'],phase['SGData']['BNSlattsym']) 
     431    phase['SGData']['GenSym'],phase['SGData']['GenFlg'],BNSsym = G2spc.GetGenSym(phase['SGData'])
     432    phase['SGData']['MagSpGrp'] = G2spc.MagSGSym(phase['SGData'])
     433    phase['SGData']['SpnFlp'] = G2spc.GenMagOps(phase['SGData'])[1]
     434    return phase
     435
    355436def FillUnitCell(Phase):
    356437    Atoms = copy.deepcopy(Phase['Atoms'])
  • trunk/GSASIIpwdGUI.py

    r3579 r3583  
    34423442                if result[0].strip().endswith("1'"):    #skip gray groups
    34433443                    continue
    3444                 phase = {}
    34453444                numbs = [eval(item+'.') for item in result[2].split()]
    3446                 phase['Name'] = result[0].strip()
    3447                 phase['Uvec'] = np.array(numbs[3::4])
    3448                 phase['Trans'] = np.array([numbs[:3],numbs[4:7],numbs[8:11]]).T         #Bilbao gives transpose
    3449                 phase['Cell'] = G2lat.TransformCell(controls[6:12],phase['Trans'])   
    3450                 phase['Keep'] = False
    3451                 phase['Use'] = False
    3452                 SpGp = result[0].replace("'",'')
    3453                 SpGrp = G2spc.StandardizeSpcName(SpGp)
    3454                 phase['SGData'] = G2spc.SpcGroup(SpGrp)[1]
    3455                 phase['SGData']['GenSym'],phase['SGData']['GenFlg'],BNSsym = G2spc.GetGenSym(phase['SGData'])
    3456                 phase['SGData']['MagSpGrp'] = G2spc.MagSGSym(phase['SGData'])
    3457                 phase['BNSlatt'] = phase['SGData']['SGLatt']
    3458                 if result[1]:
    3459                     phase['BNSlatt'] += '_'+result[1]
    3460                     BNSsym = G2spc.GetGenSym(phase['SGData'])[2]
    3461                     phase['SGData']['BNSlattsym'] = [phase['BNSlatt'],BNSsym[phase['BNSlatt']]]
    3462                     G2spc.ApplyBNSlatt(phase['SGData'],phase['SGData']['BNSlattsym']) 
    3463                 phase['SGData']['GenSym'],phase['SGData']['GenFlg'],BNSsym = G2spc.GetGenSym(phase['SGData'])
    3464                 phase['SGData']['MagSpGrp'] = G2spc.MagSGSym(phase['SGData'])
    3465                 phase['SGData']['SpnFlp'] = G2spc.GenMagOps(phase['SGData'])[1]
    3466                 magcells.append(phase)
     3445                Uvec = np.array(numbs[3::4])
     3446                Trans = np.array([numbs[:3],numbs[4:7],numbs[8:11]]).T         #Bilbao gives transpose
     3447                phase = G2lat.makeBilbaoPhase(result[:2],Uvec,Trans)
     3448                phase['Cell'] = G2lat.TransformCell(controls[6:12],Trans)   
     3449                RVT = G2lat.FindNonstandard(phase)
     3450                if RVT is None:
     3451                    magcells.append(phase)
     3452                else:
     3453#                    magcells.append(phase)          #temporary??
     3454                    Nresult,NUvec,NTrans = RVT
     3455                    newphase = G2lat.makeBilbaoPhase(Nresult,NUvec,NTrans)
     3456                    newphase['Cell'] = G2lat.TransformCell(controls[6:12],NTrans)   
     3457                    magcells.append(newphase)
    34673458            magcells[0]['Use'] = True
    34683459            SGData = magcells[0]['SGData']
  • trunk/GSASIIspc.py

    r3577 r3583  
    12341234                Spn.append(1)
    12351235                iB = jF+1
    1236     SGData['SGSpin'] = Spn
     1236    return Spn
    12371237           
    12381238def GenMagOps(SGData):
     
    36203620''' A dictionary of alternate settings for orthorhombic unit cells
    36213621'''
    3622 altSettingsOrtho = {
     3622altSettingOrtho = {
    36233623        'P 2 2 21' :{'abc':'P 2 2 21','cab':'P 21 2 2','bca':'P 2 21 2','acb':'P 2 21 2','bac':'P 2 2 21','cba':'P 21 2 2'},
    36243624        'P 21 21 2':{'abc':'P 2121 2','cab':'P 2 21 21','bca':'P 21 2 21','acb':'P 21 2 21','bac':'P 21 21 2','cba':'P 2 21 21'},
Note: See TracChangeset for help on using the changeset viewer.