Changeset 3435 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
Jun 14, 2018 3:31:10 PM (4 years ago)
Author:
vondreele
Message:

make new routine GetSpGrpfromUser? & use it inGeneral & Transform fo space group input
modify getHKLpeak to check for magnetic space group extinctions - passes hkl that is allowed by either.
modify G2pwdGUI to retain SGData in Unit Cell data (in ssopts dict)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r3420 r3435  
    28802880    def OnSpcSel(event):
    28812881        controls[13] = spcSel.GetString(spcSel.GetSelection())
     2882        ssopt['SGData'] = G2spc.SpcGroup(controls[13])[1]
    28822883        G2frame.dataWindow.RefineCell.Enable(True)
    28832884        OnHklShow(event)
     
    29652966        A = G2lat.cell2A(cell)
    29662967        spc = controls[13]
    2967         SGData = G2spc.SpcGroup(spc)[1]
     2968        SGData = ssopt.get('SGData',G2spc.SpcGroup(spc)[1])
    29682969        Symb = SGData['SpGrp']
    29692970        if ssopt.get('Use',False):
     
    32653266            dlg.Destroy()
    32663267           
     3268    def OnMagSel(event):
     3269        Obj = event.GetEventObject()
     3270        if Obj.GetValue():
     3271            SGData['SGSpin'] = [1,]*len(SGData['SGSpin'])
     3272            GenSym,GenFlg,BNSsym = G2spc.GetGenSym(SGData)
     3273            SGData['GenSym'] = GenSym
     3274            SGData['GenFlg'] = GenFlg
     3275            OprNames,SpnFlp = G2spc.GenMagOps(SGData)
     3276            SGData['SpnFlp'] = SpnFlp
     3277            SGData['MagSpGrp'] = G2spc.MagSGSym(SGData)
     3278        else:
     3279            del SGData['MagSpGrp']
     3280        OnHklShow(None)
     3281        ssopt['SGData'] = SGData
     3282        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
     3283           
    32673284    def OnSpinOp(event):
    32683285        Obj = event.GetEventObject()
     
    33203337    if len(controls) < 14:              #add space group used in indexing
    33213338        controls.append(spaceGroups[bravaisSymb.index(controls[5])])
    3322     SGData = G2spc.SpcGroup(controls[13])[1]
     3339    SGData = ssopt.get('SGData',G2spc.SpcGroup(controls[13])[1])
    33233340    G2frame.GPXtree.SetItemPyData(UnitCellsId,data)            #update with volume
    33243341    bravaisNames = ['Cubic-F','Cubic-I','Cubic-P','Trigonal-R','Trigonal/Hexagonal-P',
     
    34153432        hklShow.Bind(wx.EVT_BUTTON,OnHklShow)
    34163433        littleSizer.Add(hklShow,0,WACV)
     3434    elif 'N' in Inst['Type'][0]:
     3435        MagSel = wx.CheckBox(G2frame.dataWindow,label="Magnetic?")
     3436        MagSel.SetValue('MagSpGrp' in SGData)
     3437        MagSel.Bind(wx.EVT_CHECKBOX,OnMagSel)
     3438        littleSizer.Add(MagSel,0,WACV)
    34173439    mainSizer.Add(littleSizer,0)
    34183440    mainSizer.Add((5,5),0)
    34193441    if 'N' in Inst['Type'][0]:
    3420         Indx = {}
    3421         GenSym,GenFlg,BNSsym = G2spc.GetGenSym(SGData)
    3422         SGData['GenSym'] = GenSym
    3423         SGData['SGGray'] = False
    34243442        neutSizer = wx.BoxSizer(wx.HORIZONTAL)
    3425         neutSizer.Add(wx.StaticText(G2frame.dataWindow,label=' BNS lattice: '),0,WACV)
    3426         BNS = wx.ComboBox(G2frame.dataWindow,value=SGData['BNSlattsym'][0],
    3427             choices=[SGData['SGLatt'],]+list(BNSsym.keys()),style=wx.CB_READONLY|wx.CB_DROPDOWN)
    3428         BNS.Bind(wx.EVT_COMBOBOX,OnBNSlatt)
    3429         neutSizer.Add(BNS,0,WACV)
    3430         spinColor = ['black','red']
    3431         spCode = {-1:'red',1:'black'}
    3432         for isym,sym in enumerate(GenSym[1:]):
    3433             neutSizer.Add(wx.StaticText(G2frame.dataWindow,label=' %s: '%(sym.strip())),0,WACV)               
    3434             spinOp = wx.ComboBox(G2frame.dataWindow,value=spCode[SGData['SGSpin'][isym+1]],choices=spinColor,
    3435                 style=wx.CB_READONLY|wx.CB_DROPDOWN)               
    3436             Indx[spinOp.GetId()] = isym
    3437             spinOp.Bind(wx.EVT_COMBOBOX,OnSpinOp)
    3438             neutSizer.Add(spinOp,0,WACV)
    3439         OprNames,SpnFlp = G2spc.GenMagOps(SGData)
    3440         SGData['SpnFlp'] = SpnFlp
    3441         showSpins = wx.Button(G2frame.dataWindow,label=' Show spins?')
    3442         showSpins.Bind(wx.EVT_BUTTON,OnShowSpins)
    3443         neutSizer.Add(showSpins,0,WACV)
     3443        if 'MagSpGrp' in SGData:
     3444            Indx = {}
     3445            GenSym,GenFlg,BNSsym = G2spc.GetGenSym(SGData)
     3446            SGData['GenSym'] = GenSym
     3447            SGData['SGGray'] = False
     3448            neutSizer.Add(wx.StaticText(G2frame.dataWindow,label=' BNS lattice: '),0,WACV)
     3449            BNS = wx.ComboBox(G2frame.dataWindow,value=SGData['BNSlattsym'][0],
     3450                choices=[SGData['SGLatt'],]+list(BNSsym.keys()),style=wx.CB_READONLY|wx.CB_DROPDOWN)
     3451            BNS.Bind(wx.EVT_COMBOBOX,OnBNSlatt)
     3452            neutSizer.Add(BNS,0,WACV)
     3453            spinColor = ['black','red']
     3454            spCode = {-1:'red',1:'black'}
     3455            for isym,sym in enumerate(GenSym[1:]):
     3456                neutSizer.Add(wx.StaticText(G2frame.dataWindow,label=' %s: '%(sym.strip())),0,WACV)               
     3457                spinOp = wx.ComboBox(G2frame.dataWindow,value=spCode[SGData['SGSpin'][isym+1]],choices=spinColor,
     3458                    style=wx.CB_READONLY|wx.CB_DROPDOWN)               
     3459                Indx[spinOp.GetId()] = isym
     3460                spinOp.Bind(wx.EVT_COMBOBOX,OnSpinOp)
     3461                neutSizer.Add(spinOp,0,WACV)
     3462            OprNames,SpnFlp = G2spc.GenMagOps(SGData)
     3463            SGData['SpnFlp'] = SpnFlp
     3464            showSpins = wx.Button(G2frame.dataWindow,label=' Show spins?')
     3465            showSpins.Bind(wx.EVT_BUTTON,OnShowSpins)
     3466            neutSizer.Add(showSpins,0,WACV)
    34443467        hklShow = wx.Button(G2frame.dataWindow,label="Show hkl positions")
    34453468        hklShow.Bind(wx.EVT_BUTTON,OnHklShow)
Note: See TracChangeset for help on using the changeset viewer.