Changeset 3257


Ignore:
Timestamp:
Feb 3, 2018 2:49:45 PM (4 years ago)
Author:
vondreele
Message:

fixes to incommensurate space group symbol handling

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r3254 r3257  
    16481648            uwave = np.zeros(6)
    16491649            mom = np.zeros(3)
    1650             #how do I handle Sfrac? - fade the atoms?
    16511650            if len(Sfrac):
    16521651                scof = []
     
    16831682                    ccof.append(spos[0][3:])
    16841683                if len(scof):
    1685                     mom += np.sum(posFourier(tauT,np.array(scof),np.array(ccof)),axis=1)              
     1684                    mom += np.sum(posFourier(tauT,np.array(scof),np.array(ccof)),axis=1)
    16861685            if len(Sadp):
    16871686                scof = []
  • trunk/GSASIIphsGUI.py

    r3254 r3257  
    14141414                dlg = G2G.SingleStringDialog(General,'Get Space Group',
    14151415                    '  Input the space group with spaces between axial fields  \n  (e.g. p 21/c, P 63/m m c, P 4/m m m) or enter a space\n  group number between 1 and 230.',
    1416                     value=generalData['SGData']['SpGrp'],help=helptext)
     1416                    value=SpGrp,help=helptext)
    14171417                if not dlg.Show():
    14181418                    dlg.Destroy()
     
    15471547            nameSizer.Add(TypeTxt,0,WACV)
    15481548            nameSizer.Add(wx.StaticText(General,-1,'  Space group: '),0,WACV)
    1549             SGTxt = wx.Button(General,wx.ID_ANY,generalData['SGData']['SpGrp'],size=(100,-1))
     1549            SpGrp = generalData['SGData']['SpGrp']
     1550            if generalData['SGData']['SGGray']: SpGrp += " 1'"
     1551            SGTxt = wx.Button(General,wx.ID_ANY,SpGrp,size=(100,-1))
    15501552            SGTxt.Bind(wx.EVT_BUTTON,OnSpaceGroup)
    15511553            nameSizer.Add(SGTxt,0,WACV)
     
    18911893            Choice = []
    18921894            if not SGData['SGFixed']:
    1893                 SSChoice = G2spc.SSChoice(SGData)
    1894                 for item in SSChoice:
    1895                     E,SSG = G2spc.SSpcGroup(SGData,item)
    1896                     if SSG: Choice.append(item)
     1895                Choice = G2spc.SSChoice(SGData)
    18971896                if SGData['SGGray']:
    18981897                    Choice = [G2spc.fixGray(SGData,item) for item in Choice]
  • trunk/GSASIIspc.py

    r3254 r3257  
    383383    SGText = []
    384384    SGText.append(' Space Group: '+SGData['SpGrp'])
     385    if SGData['SGGray']: SGText[-1] += " 1'"
    385386    CentStr = 'centrosymmetric'
    386387    if not SGData['SGInv']:
     
    988989def MagSSText2MTS(mcifOpr):
    989990    "From magnetic super space group cif text returns matrix/translation + spin flip"
    990     XYZ = {'x1':[1,0,0,0],'-x1':[-1,0,0,0],'x2':[0,1,0,0],'-x2':[0,-1,0,0],'x3':[0,0,1,0],'-x3':[0,0,-1,0],
    991            'x1-x2':[1,-1,0,0],'-x1+x2':[-1,1,0,0],'x4':[0,0,0,1],'-x4':[0,0,0,-1],
    992            '-x1+x4':[-1,0,0,1],'-x2+x4':[0,-1,0,1]}
     991    XYZ = {'x1':[1,0,0,0],'-x1':[-1,0,0,0],
     992           'x2':[0,1,0,0],'-x2':[0,-1,0,0],
     993           'x3':[0,0,1,0],'-x3':[0,0,-1,0],
     994           'x4':[0,0,0,1],'-x4':[0,0,0,-1],
     995           'x1-x2':[1,-1,0,0],'-x1+x2':[-1,1,0,0],
     996           'x1-x4':[1,0,0,-1],'-x1+x4':[-1,0,0,1],
     997           'x2-x4':[0,1,0,-1],'-x2+x4':[0,-1,0,1],
     998           '-x1-x2+x4':[-1,-1,0,1],'x1+x2-x4':[1,1,0,-1]}
    993999    ops = mcifOpr.split(",")
    9941000    M = []
     
    10751081       * SSGData - is a dict (see :ref:`Superspace Group object<SSGData_table>`) with entries:
    10761082       
    1077              * 'SSpGrp': superspace group symbol extension to space group symbol, accidental spaces removed
     1083             * 'SSpGrp': full superspace group symbol, accidental spaces removed; for display only
    10781084             * 'SSGCen': 4D cell centering vectors [0,0,0,0] at least
    10791085             * 'SSGOps': 4D symmetry operations as [M,T] so that M*x+T = x'
     
    13791385        SSGKl = fixMonoOrtho()
    13801386    Ngen = len(gensym)
    1381     if SGData.get('SGGray',False):
    1382         Ngen -= 1
    13831387    if len(gensym) and Ngen != len(SSGKl):
    13841388        return 'Wrong number of items in generator symbol '+''.join(gensym),None
     
    13871391    if not genQ:
    13881392        genQ = [0,0,0,0]
    1389     SSGData = {'SSpGrp':SGData['SpGrp']+SSymbol,'modQ':modQ,'modSymb':modsym,'SSGKl':SSGKl}
     1393    SSgSpc = SGData['SpGrp']+SSymbol
     1394    if SGData['SGGray']:
     1395        SSgSpc = SSgSpc.replace('('," 1'(")
     1396        SSgSpc += 's'
     1397    SSGData = {'SSpGrp':SSgSpc,'modQ':modQ,'modSymb':modsym,'SSGKl':SSGKl}
    13901398    SSCen = np.zeros((len(SGData['SGCen']),4))
    13911399    for icen,cen in enumerate(SGData['SGCen']):
     
    14331441           
    14341442    laueTS = {'-1':['',],
    1435             '2/m':['','s','s0','0s','ss'],
    1436             'mmm':['000','s00','0s0','00s','ss0','s0s','0ss','q00','0q0','00q','0qq','q0q','qq0'],
     1443            '2/m':['','s','0s','ss','s0'],
     1444            'mmm':['','s00','0s0','00s','ss0','s0s','0ss','q00','0q0','00q','0qq','q0q','qq0'],
    14371445            '4/m':['','q','s','s0',],
    14381446            '4/mmm':['','q00','s00','ss0','0ss','s0s','qq0','qqs','0q0','s0s0','00ss','s00s'],
     
    14611469    modsym,gensym = SSymbol.replace(' ','').split(')')
    14621470    modsym += ')'
     1471    sgPtGp = SGData['SGPtGrp']
    14631472    if gensym:
    1464         gensym += 's'
     1473        if sgPtGp in ['1','2','m','3','4','6'] and len(gensym) == 1:
     1474            gensym += 's'
     1475        elif sgPtGp in ['2/m','4/m','6/m'] and len(gensym) == 2:
     1476            gensym += 's'
     1477        elif sgPtGp in ['4/mmm','6/mmm'] and len(gensym) == 4:
     1478            gensym += 's'
     1479        elif len(gensym) == 3:
     1480            gensym += 's'
    14651481    else:
    1466         if SGData['SGPtGrp'] in ['1','2','m','3','4','6']:
     1482        if sgPtGp in ['1','2','m','3','4','6']:
    14671483            gensym += '0s'
    1468         elif SGData['SGPtGrp'] in ['2/m','4/m','6/m']:
     1484        elif sgPtGp in ['2/m','4/m','6/m']:
    14691485            gensym += '00s'
    1470         elif SGData['SGPtGrp'] in ['4/mmm','6/mmm']:
     1486        elif sgPtGp in ['4/mmm','6/mmm']:
    14711487            gensym += '0000s'
    14721488        else:
     
    15211537    Mult = len(SSGData['SSGCen'])*len(SSGData['SSGOps'])*(int(SGData['SGInv'])+1)
    15221538    SSGText = []
    1523     SSgSpc = SSGData['SSpGrp']
    1524     if SGData.get('SGGray',False):
    1525         SSgSpc = SSgSpc.replace('('," 1'(")
    1526     SSGText.append(' Superspace Group: '+SSgSpc)
     1539    SSGText.append(' Superspace Group: '+SSGData['SSpGrp'])
    15271540    CentStr = 'centrosymmetric'
    15281541    if not SGData['SGInv']:
     
    15341547    SSGText.append(' The Laue symmetry is '+SGData['SGLaue'])
    15351548    SGptGp = SGData['SGPtGrp']
    1536     if SGData.get('SGGray',False):
     1549    if SGData['SGGray']:
    15371550        SGptGp += "1'"
    15381551    SSGText.append(' The superlattice point group is '+SGptGp+', '+''.join([str(i) for i in SSGData['SSGKl']]))
     
    15541567    for i,Opr in enumerate(SSGData['SSGOps']):
    15551568        SSGTable.append('(%2d) %s'%(i+1,SSMT2text(Opr)))
    1556     if SGData.get('SGGray',False):
     1569    if SGData['SGGray']:
    15571570        SSGTable.append("     for 1'")
    15581571        for i,Opr in enumerate(SSGData['SSGOps']):
  • trunk/imports/G2phase_CIF.py

    r3220 r3257  
    179179                    sspgrp[1] = "("+sspgrp[1]
    180180                    SpGrp = G2spc.StandardizeSpcName(sspgrp[0])
     181                    if "1'" in SpGrp: sspgrp[1] = sspgrp[1][:-1]  #take off extra 's'; gets put back later
    181182                    MSpGrp = sspgrp[0]
    182183                    self.MPhase['General']['Type'] = 'magnetic'
     
    553554                self.MPhase['General']['Super'] = Super
    554555                if Super:
     556                    if self.MPhase['General']['SGData']['SGGray']:
     557                        SuperSg += 's'
    555558                    self.MPhase['General']['Modulated'] = True
    556559                    self.MPhase['General']['SuperVec'] = SuperVec
  • trunk/testSSymbols.py

    r3234 r3257  
    8686        def OnSuperGp(event):
    8787            SSymbol = superGp.GetValue()
     88            SpGrp = Data['SGData']['SpGrp']
     89            if Data['SGData']['SGGray']: SpGrp += " 1'"
    8890            print('Try: %s%s'%(Data['SGData']['SpGrp'],SSymbol))
     91            if Data['SGData']['SGGray']: SSymbol = SSymbol[:-1]
    8992            E,SSGData = G2spc.SSpcGroup(Data['SGData'],SSymbol)
    9093            if SSGData:
     
    115118        mainSizer = wx.FlexGridSizer(0,2,5,5)
    116119        mainSizer.Add(wx.StaticText(self.testSSPanel,-1,'  Space group: '),0,WACV)
    117         SGTxt = wx.TextCtrl(self.testSSPanel,-1,value=Data['SGData']['SpGrp'],style=wx.TE_PROCESS_ENTER)
     120        SpGrp = Data['SGData']['SpGrp']
     121        if Data['SGData']['SGGray']: SpGrp += " 1'"
     122        SGTxt = wx.TextCtrl(self.testSSPanel,-1,value=SpGrp,style=wx.TE_PROCESS_ENTER)
    118123        SGTxt.Bind(wx.EVT_TEXT_ENTER,OnSpaceGroup)
    119124        mainSizer.Add(SGTxt,0,WACV)
    120         mainSizer.Add(wx.StaticText(self.testSSPanel,label=' Superspace group: '+Data['SGData']['SpGrp']),0,WACV)
     125        mainSizer.Add(wx.StaticText(self.testSSPanel,label=' Superspace group: '+SpGrp),0,WACV)
    121126        ssChoice = G2spc.SSChoice(Data['SGData'])
     127        if Data['SGData']['SGGray']: ssChoice = [G2spc.fixGray(Data['SGData'],item) for item in ssChoice]
     128        ssSym = Data['SuperSg']
     129        if Data['SGData']['SGGray']: ssSym = G2spc.fixGray(SGData,ssSym)
    122130        if ssChoice:
    123             superGp = wx.ComboBox(self.testSSPanel,value=Data['SuperSg'],choices=ssChoice,style=wx.CB_DROPDOWN)   #wx.CB_READONLY|
     131            superGp = wx.ComboBox(self.testSSPanel,value=ssSym,choices=ssChoice,style=wx.CB_DROPDOWN)   #wx.CB_READONLY|
    124132            superGp.Bind(wx.EVT_COMBOBOX,OnSuperGp)
    125133            superGp.Bind(wx.EVT_TEXT_ENTER,OnSuperGp)
    126134        else:   #nonstandard space group symbol not in my dictionary
    127             superGp = wx.TextCtrl(self.testSSPanel,value=Data['SuperSg'],style=wx.TE_PROCESS_ENTER)
     135            superGp = wx.TextCtrl(self.testSSPanel,value=ssSym,style=wx.TE_PROCESS_ENTER)
    128136            superGp.Bind(wx.EVT_TEXT_ENTER,OnSuperGp)                       
    129137        mainSizer.Add(superGp,0,WACV)
Note: See TracChangeset for help on using the changeset viewer.