Changeset 3227


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

incommensurate ndexing changes & fixes

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIindex.py

    r3136 r3227  
    288288        Peaks = np.array(IndexSSPeaks(peaks,HKL)[1]).T
    289289        Qo = 1./Peaks[-2]**2
    290         Qc = G2lat.calc_rDsqTSS(Peaks[4:8],A,vec,Z,Peaks[0],difC)
     290        Qc = G2lat.calc_rDsqTSS(Peaks[4:8],A,Vec,Z,Peaks[0],difC)
    291291        chi = np.sum((Qo-Qc)**2)
    292292        if dlg:
     
    305305    values = []
    306306    ranges = []
    307     dT = 0.02       #seems to be a good choice
     307    dT = 0.005       #seems to be a good choice
    308308    for v,r in zip(ssopt['ModVec'],Vref):
    309309        if r:
  • 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
  • trunk/GSASIIspc.py

    r3225 r3227  
    31603160            '(00g)','(00g)s00','(1/20g)','(01/2g)','(01/2g)s00','(1/21/2g)','(1/2b1/2)q0q',
    31613161            '(a00)','(a00)0s0','(a01/2)','(a01/2)0s0','(a1/20)','(a1/21/2)','(a1/21/2)00q',],
    3162     'Cmm2':['(00g)','(00g)s0s','(00g)ss0','(10g)','(10g)s0s','(10g)ss0',
     3162    'Cmm2':['(00g)','(00g)s0s','(00g)ss0',
     3163            '(10g)','(10g)s0s','(10g)ss0',
    31633164            '(a00)','(a00)0s0','(a01/2)','(a01/2)0s0',
    31643165            '(0b0)','(0b0)s00','(0b1/2)','(0b1/2)s00',],
     
    31883189    'Im2m':['(0b0)','(0b0)s0s','(0b0)0ss','(0b0)ss0','(00g)','(00g)s00','(a00)','(a00)00s',],
    31893190#47-74
    3190     'Pmmm':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(01/2g)','(01/2g)s00','(1/20g)','(1/20g)0s0','(1/21/2g)',
    3191             '(a00)','(a00)0s0','(a00)00s','(a00)0ss','(a01/2)','(a01/2)0s0','(a1/20)','(a1/20)00s','(a1/21/2)',
    3192             '(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s','(1/2b0)','(1/2b0)00s','(0b1/2)','(0b1/2)s00','(1/2b1/2)',],
     3191    'Pmmm':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(01/2g)','(01/2g)s00','(01/2g)0s0','(01/2g)ss0',
     3192            '(1/20g)','(1/20g)0s0','(1/20g)s00','(1/20g)ss0','(1/21/2g)',
     3193            '(a00)','(a00)0s0','(a00)00s','(a00)0ss','(a01/2)','(a01/2)0s0','(a01/2)00s','(a01/2)0ss',
     3194            '(a1/20)','(a1/20)00s','(a1/20)0ss','(a1/20)0s0','(a1/21/2)',
     3195            '(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s','(1/2b0)','(1/2b0)00s','(1/2b0)s00','(1/2b0)s0s',
     3196            '(0b1/2)','(0b1/2)s00','(0b1/2)00s','(0b1/2)s0s','(1/2b1/2)',],
    31933197    'Cmmm':['(00g)','(00g)s00','(00g)ss0','(10g)','(10g)s00','(10g)ss0','(01g)','(01g)0s0','(01g)ss0',
    31943198            '(a00)','(a00)00s','(a00)0ss','(a00)0s0','(a01/2)','(a01/2)0s0',
     
    32533257        }
    32543258
    3255 ssdict = {}
    32563259
    32573260#'A few non-standard space groups for test use'
  • trunk/testSSymbols.py

    r3172 r3227  
    1111] = [wx.NewId() for _init_coll_File_Items in range(1)]
    1212WACV = wx.ALIGN_CENTER_VERTICAL
     13laueSS = {'2/m':['(a0g)','(a1/2g)','(0b0)','(1/2b0)','(0b1/2)','(1/2b1/2)'],
     14        'mmm':['(a00)','(a1/20)','(a01/2)','(a1/21/2)','(a10)','(a01)',
     15               '(0b0)','(1/2b0)','(0b1/2)','(1/2b1/2)','(1b0)','(0b1)',
     16               '(00g)','(1/20g)','(01/2g)','(1/21/2g)','(10g)','(01g)']}
     17       
     18laueTS = {'2/m':['','s','s0','0s','ss'],
     19          'mmm':['000','s00','0s0','00s','ss0','s0s','0ss','q00','0q0','00q','0qq','q0q','qq0'],
     20          }
    1321
    1422class testSSymbols(wx.Frame):
     
    4452    def UpdateData(self,Data):
    4553       
    46         def OnTryAll(event):
    47             SSList = G2spc.ssdict.get(Data['SGData']['SpGrp'],['',])
     54        def OnExhaustive(event):
     55            laue = Data['SGData']['SGLaue']
     56            good = []
     57            if laue in ['2/m','mmm']:
     58                SSList = []
     59                for ax in laueSS[laue]:
     60                    for sx in laueTS[laue]:
     61                        SSList.append(ax+sx)               
     62            else:
     63                latt = Data['SGData']['SGLatt']+Data['SGData']['SGPtGrp']
     64                SSList = G2spc.ptssdict.get(latt,['',])
    4865            for SSymbol in SSList:
    4966                E,SSGData = G2spc.SSpcGroup(Data['SGData'],SSymbol)
    5067                if SSGData:
     68                    good.append(SSymbol)
    5169                    text,table = G2spc.SSGPrint(Data['SGData'],SSGData)
    5270                    Data['SSGData'] = SSGData
    5371                    Data['SuperSg'] = SSymbol
    5472                    msg = 'Superspace Group Information'
    55                     G2G.SGMessageBox(self,msg,text,table).Show()
    56                 else:
    57                     msg = 'Superspace Group Error for'+SSymbol
    58                     Style = wx.ICON_EXCLAMATION
    59                     Text = '\n'+E
    60                     wx.MessageBox(Text,caption=msg,style=Style)
    61                    
    62         def OnExhaustive(event):
    63             latt = Data['SGData']['SGLatt']+Data['SGData']['SGPtGrp']
    64             SSList = G2spc.ptssdict.get(latt,['',])
    65             for SSymbol in SSList:
    66                 E,SSGData = G2spc.SSpcGroup(Data['SGData'],SSymbol)
    67                 if SSGData:
    68                     text,table = G2spc.SSGPrint(Data['SGData'],SSGData)
    69                     Data['SSGData'] = SSGData
    70                     Data['SuperSg'] = SSymbol
    71                     msg = 'Superspace Group Information'
    72                     G2G.SGMessageBox(self,msg,text,table).Show()
    73                 else:
    74                     msg = 'Superspace Group Error for'+SSymbol
    75                     Style = wx.ICON_EXCLAMATION
    76                     Text = '\n'+E
    77                     wx.MessageBox(Text,caption=msg,style=Style)           
     73#                    G2G.SGMessageBox(self,msg,text,table).Show()
     74#                else:
     75#                    msg = 'Superspace Group Error for'+SSymbol
     76#                    Style = wx.ICON_EXCLAMATION
     77#                    Text = '\n'+E
     78#                    wx.MessageBox(Text,caption=msg,style=Style)
     79            print(good)           
    7880       
    7981        def OnSpaceGroup(event):
     
    143145        latt = Data['SGData']['SGLatt']+Data['SGData']['SGPtGrp']
    144146        SSChoice = G2spc.ptssdict.get(latt,['',])
    145         if SSChoice:
    146             superGp = wx.ComboBox(self.testSSPanel,value=Data['SuperSg'],choices=SSChoice,style=wx.CB_DROPDOWN)   #wx.CB_READONLY|
     147        ssChoice = []
     148        for item in SSChoice:
     149            E,SSG = G2spc.SSpcGroup(SGData,item)
     150            if SSG: ssChoice.append(item)
     151        if ssChoice:
     152            superGp = wx.ComboBox(self.testSSPanel,value=Data['SuperSg'],choices=ssChoice,style=wx.CB_DROPDOWN)   #wx.CB_READONLY|
    147153            superGp.Bind(wx.EVT_COMBOBOX,OnSuperGp)
    148154            superGp.Bind(wx.EVT_TEXT_ENTER,OnSuperGp)
     
    151157            superGp.Bind(wx.EVT_TEXT_ENTER,OnSuperGp)                       
    152158        mainSizer.Add(superGp,0,WACV)
    153         mainSizer.Add(wx.StaticText(self.testSSPanel,-1,' Try all SS symbols: '),0,WACV)
    154         SStry = wx.Button(self.testSSPanel,-1,'OK')
    155         SStry.Bind(wx.EVT_BUTTON,OnTryAll)
    156         mainSizer.Add(SStry,0,WACV)
    157159        mainSizer.Add(wx.StaticText(self.testSSPanel,-1,' Exhaustive try: '),0,WACV)
    158160        ESStry = wx.Button(self.testSSPanel,-1,'OK')
Note: See TracChangeset for help on using the changeset viewer.