Changeset 3393 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
May 18, 2018 12:41:23 PM (5 years ago)
Author:
vondreele
Message:

implement GUI to change BNS lattice centering for magnetic space groups in G2phaseGUI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r3356 r3393  
    18491849                wx.CallAfter(UpdateGeneral)
    18501850               
     1851            def OnBNSlatt(event):
     1852                Obj = event.GetEventObject()
     1853                BNSlatt = Obj.GetValue()
     1854                SGData = generalData['SGData']
     1855                SpcGrp = SGData['SpGrp']
     1856                SGErr,SGData = G2spc.SpcGroup(SpcGrp)
     1857                if '_' in BNSlatt:
     1858                    SGData['BNSlattsym'] = [BNSlatt,BNSsym[BNSlatt]]
     1859                else:
     1860                    SGData['BNSlattsym'] = [SGData['SGLatt'],[0.,0.,0.]]
     1861                SGData['SGSpin'] = [1,]*len(SGData['SGSpin'])
     1862                GenSym,GenFlg = G2spc.GetGenSym(SGData)[:2]
     1863                SGData['GenSym'] = GenSym
     1864                SGData['GenFlg'] = GenFlg
     1865                SGData['MagSpGrp'] = G2spc.MagSGSym(SGData)
     1866                G2spc.ApplyBNSlatt(SGData,SGData['BNSlattsym'])
     1867                generalData['SGData'] = SGData
     1868                wx.CallAfter(UpdateGeneral)
     1869           
    18511870            def OnShowSpins(event):
    18521871                msg = 'Magnetic space group information'
     
    18611880                               
    18621881            SGData = generalData['SGData']           
     1882            GenSym,GenFlg,BNSsym = G2spc.GetGenSym(SGData)
     1883            if 'BNSlattsym' not in SGData:
     1884                SGData['BNSlattsym'] = [SGData['SGLatt'],[0,0,0]]
    18631885            Indx = {}
    18641886            MagSym = SGData['MagSpGrp']
     
    18701892            if SGData['SGFixed']:
    18711893                SpnFlp = SGData['SpnFlp']
     1894                spinSizer.Add(wx.StaticText(General,label=' Magnetic phase from mcif file; no change in spin inversion allowed'),0,WACV)
    18721895                OprNames = G2spc.GenMagOps(SGData)[0]
    18731896            else:
    18741897                if not len(GenSym) or SGData['SGGray']:
    1875                     magSizer.Add(wx.StaticText(General,label=' No spin inversion allowed'),0,WACV)
     1898                    spinSizer.Add(wx.StaticText(General,label=' No spin inversion allowed'),0,WACV)
    18761899                    OprNames,SpnFlp = G2spc.GenMagOps(SGData)                   
    18771900                else:
     1901                    spinSizer.Add(wx.StaticText(General,label=' BNS lattice: '),0,WACV)
     1902                    BNS = wx.ComboBox(General,value=SGData['BNSlattsym'][0],
     1903                        choices=[SGData['SGLatt'],]+list(BNSsym.keys()),style=wx.CB_READONLY|wx.CB_DROPDOWN)
     1904                    BNS.Bind(wx.EVT_COMBOBOX,OnBNSlatt)
     1905                    spinSizer.Add(BNS,0,WACV)
    18781906                    spinColor = ['black','red']
    18791907                    spCode = {-1:'red',1:'black'}
     
    18881916                    SGData['SpnFlp'] = SpnFlp
    18891917            SGData['OprNames'] = OprNames
    1890             spinSizer.Add(wx.StaticText(General,label=' Magnetic space group: %s  '%(MagSym)),0,WACV)
     1918            magSizer.Add(spinSizer)
     1919            msgSizer = wx.BoxSizer(wx.HORIZONTAL)
     1920            msgSizer.Add(wx.StaticText(General,label=' Magnetic space group: %s  '%(MagSym)),0,WACV)
    18911921            showSpins = wx.Button(General,label=' Show spins?')
    18921922            showSpins.Bind(wx.EVT_BUTTON,OnShowSpins)
    1893             spinSizer.Add(showSpins,0,WACV)
    1894             magSizer.Add(spinSizer)
     1923            msgSizer.Add(showSpins,0,WACV)
     1924            magSizer.Add(msgSizer)
    18951925            dminSizer = wx.BoxSizer(wx.HORIZONTAL)
    18961926            dminSizer.Add(wx.StaticText(General,label=' Magnetic reflection d-min: '),0,WACV)
Note: See TracChangeset for help on using the changeset viewer.