Changeset 3227 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
Jan 16, 2018 4:37:58 PM (5 years ago)
Author:
vondreele
Message:

incommensurate ndexing changes & fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r3226 r3227  
    27772777        OnHklShow(event)
    27782778       
    2779     def OnFindMV(event):
     2779    def OnFindOneMV(event):
    27802780        Peaks = np.copy(peaks[0])
    2781         print (' Trying: '+controls[13]+ssopt['ssSymb']+ 'maxH: 1')
     2781        print (' Trying: ',controls[13],ssopt['ssSymb'], ' maxH: 1')
    27822782        dlg = wx.ProgressDialog('Elapsed time','Modulation vector search',
    27832783            style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE)
     
    27902790            dlg.Destroy()
    27912791        OnHklShow(event)
     2792        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
     2793       
     2794    def OnFindMV(event):
     2795        best = 1.
     2796        bestSS = ''
     2797        for ssSym in ssChoice:
     2798            ssopt['ssSymb'] = ssSym           
     2799            Peaks = np.copy(peaks[0])
     2800            ssopt['ModVec'] = G2spc.SSGModCheck(ssopt['ModVec'],G2spc.splitSSsym(ssSym)[0],True)[0]
     2801            print (' Trying: '+controls[13]+ssSym+ ' maxH: 1')
     2802            ssopt['ModVec'],result = G2indx.findMV(Peaks,controls,ssopt,Inst,dlg=None)
     2803            OnHklShow(event)
     2804            if result[1] < best:
     2805                bestSS = ssSym
     2806                best = result[1]
     2807        ssopt['ssSymb'] = bestSS
     2808        ssopt['ModVec'],result = G2indx.findMV(Peaks,controls,ssopt,Inst,dlg=None)
     2809        if len(result[0]) == 2:
     2810            G2plt.PlotXYZ(G2frame,result[2],1./result[3],labelX='a',labelY='g',
     2811                newPlot=True,Title='Modulation vector search')
     2812       
    27922813        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
    27932814       
     
    32923313    mainSizer.Add(littleSizer,0)
    32933314    if ssopt.get('Use',False):        #super lattice display
     3315        laueSS = {'2/m':['(a0g)','(a1/2g)','(0b0)','(1/2b0)','(0b1/2)','(1/2b1/2)'],
     3316                'mmm':['(a00)','(a1/20)','(a01/2)','(a1/21/2)','(a10)','(a01)',
     3317                       '(0b0)','(1/2b0)','(0b1/2)','(1/2b1/2)','(1b0)','(0b1)',
     3318                       '(00g)','(1/20g)','(01/2g)','(1/21/2g)','(10g)','(01g)']}
     3319               
     3320        laueTS = {'2/m':['','s','s0','0s','ss'],
     3321                  'mmm':['000','s00','0s0','00s','ss0','s0s','0ss','q00','0q0','00q','0qq','q0q','qq0'],
     3322                  }
    32943323        indChoice = ['1','2','3','4',]
    32953324        SpSg = controls[13]
    32963325        SGData = G2spc.SpcGroup(SpSg)[1]
    3297         SSGptgp = SGData['SGLatt']+SGData['SGPtGrp']
    3298         SSChoice = G2spc.ptssdict.get(SSGptgp,[])
     3326        laue = SGData['SGLaue']
     3327        if laue in ['2/m','mmm']:
     3328            SSChoice = []
     3329            for ax in laueSS[laue]:
     3330                for sx in laueTS[laue]:
     3331                    SSChoice.append(ax+sx)               
     3332        else:
     3333            latt = SGData['SGLatt']+SGData['SGPtGrp']
     3334            SSChoice = G2spc.ptssdict.get(latt,['',])
     3335#        SSGptgp = SGData['SGLatt']+SGData['SGPtGrp']
     3336#        SSChoice = G2spc.ptssdict.get(SSGptgp,[])
    32993337        ssChoice = []
    33003338        for item in SSChoice:
     
    33383376        ssSizer.Add(maxMH,0,WACV)
    33393377        findMV = wx.Button(G2frame.dataWindow,label="Find mod. vec.?")
    3340         findMV.Bind(wx.EVT_BUTTON,OnFindMV)
     3378        findMV.Bind(wx.EVT_BUTTON,OnFindOneMV)
    33413379        ssSizer.Add(findMV,0,WACV)
     3380        findallMV = wx.Button(G2frame.dataWindow,label="Try all?")
     3381        findallMV.Bind(wx.EVT_BUTTON,OnFindMV)
     3382        ssSizer.Add(findallMV,0,WACV)
    33423383        mainSizer.Add(ssSizer,0)
    33433384
Note: See TracChangeset for help on using the changeset viewer.