Changeset 3654


Ignore:
Timestamp:
Oct 6, 2018 2:19:37 PM (5 years ago)
Author:
vondreele
Message:

fix to bug if no atom types selected for mag atom check
add code to transform monoclinics to nicer unit cells - currently disabled

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIlattice.py

    r3646 r3654  
    312312    :param ifMag: bool True if convert to magnetic phase;
    313313        if True all nonmagnetic atoms will be removed
     314       
     315    :return: newPhase dict modified G2 phase info
     316    :return: atCodes list atom transformation codes
    314317       
    315318    '''
     
    360363    return newPhase,atCodes
    361364   
    362 def FindNonstandard(Phase):
    363     'This makes occasional mistakes!'
     365def FindNonstandard(controls,Phase):
     366    '''
     367    Find nonstandard setting of magnetic cell that aligns with parent nuclear cell
     368   
     369    :param controls: list unit cell indexing controls
     370    :param Phase: dict new magnetic phase data (NB:not G2 phase construction); modified here
     371    :return: None
     372       
     373    '''
    364374    abc = np.eye(3)
    365375    cba = np.rot90(np.eye(3))
     
    410420            return Nresult,Uvec,NTrans
    411421        else:
    412             Nresult = [SpGrp,'']
    413422            return None
     423    elif 'mono' in SGData['SGSys']:
     424        return None         #temp. disable
     425        newcell = TransformCell(controls[6:12],Trans)
     426        MatsA = np.array([[1.,0.,0.],[0.,1.,0.],[1.,0,1.]])
     427        MatsB = np.array([[1.,0.,0.],[0.,1.,0.],[-1.,0,1.]])
     428        if not 70. < newcell[4] < 110.:
     429            MSG[1] = MSG[1].replace('c','n')
     430            MSG[0] = MSG[0].replace('C_c','C_B').replace('P_A','P_I')
     431            if '_' in MSG[0]:
     432                bns = MSG[0][2]
     433            Nresult = [' '.join(MSG)+'  ',bns]
     434            if newcell[4] > 110.:
     435                if newcell[2] > newcell[0]:
     436                    Mats = MatsA
     437                else:
     438                    Mats = MatsA.T
     439            elif newcell[4] < 70.:
     440                if newcell[2] > newcell[0]:
     441                    Mats = MatsB
     442                else:
     443                    Mats = MatsB.T
     444            NTrans = np.inner(Mats,Trans.T)
     445            return Nresult,Uvec,NTrans
    414446    return None
    415447       
  • trunk/GSASIIpwdGUI.py

    r3652 r3654  
    36013601        if not magAtms:
    36023602            phase['Keep'] = True
    3603             return
     3603            return []
    36043604        invTrans = nl.inv(Trans)
    36053605        atCodes = []
     
    36853685                RVT = None
    36863686                if keepaxes:
    3687                     RVT = G2lat.FindNonstandard(phase)
     3687                    RVT = G2lat.FindNonstandard(controls,phase)
    36883688                if RVT is not None:
    36893689                    result,Uvec,Trans = RVT
  • trunk/GSASIIspc.py

    r3625 r3654  
    776776                BNSsym.update({'P_B':[.5,0,.5],'P_C':[.5,.5,0]})
    777777            elif SGData['SGUniq'] == 'b':
    778                 BNSsym.update({'P_A':[.5,.5,0],'P_C':[0,.5,.5]})
     778                BNSsym.update({'P_A':[.5,.5,0],'P_C':[0,.5,.5],'P_I':[.5,.5,.5]})
    779779            elif SGData['SGUniq'] == 'c':
    780780                BNSsym.update({'P_A':[0,.5,.5],'P_B':[.5,0,.5]})
     
    821821                BNSsym.update({'C_b':[0,.5,.0],'C_c':[0,0,.5]})
    822822            elif SGData['SGUniq'] == 'b':
    823                 BNSsym.update({'C_a':[.5,0,0],'C_c':[0,0,.5]})
     823                BNSsym.update({'C_a':[.5,0,0],'C_c':[0,0,.5],'C_B':[.5,0.,.5]})
    824824        elif SGData['SGSys'] == 'orthorhombic':
    825825            BNSsym = {'C_a':[.5,0,0],'C_b':[0,.5,0],'C_c':[0,0,.5],
Note: See TracChangeset for help on using the changeset viewer.