Changeset 3736 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
Nov 17, 2018 7:36:26 PM (3 years ago)
Author:
vondreele
Message:

modifications to allow Load Unit Cell command for incommensurate phases. (not for phases from mcif files!)
cleanup space group display for magnetic/incommensurate phases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r3730 r3736  
    30043004    if 'C' in Inst['Type'][0] or 'PKS' in Inst['Type'][0]:
    30053005        wave = G2mth.getWave(Inst)
    3006         dmin = G2lat.Pos2dsp(Inst,Limits[1])
     3006        dmin = max(1.0,G2lat.Pos2dsp(Inst,Limits[1]))
    30073007    else:
    30083008        difC = Inst['difC'][1]
     
    32283228        SGData = ssopt.get('SGData',G2spc.SpcGroup(spc)[1])
    32293229        Symb = SGData['SpGrp']
     3230        M20 = X20 = 0.
    32303231        if ssopt.get('Use',False):
    32313232            SSGData = G2spc.SSpcGroup(SGData,ssopt['ssSymb'])[1]
     3233            if SSGData is None:
     3234                SSGData = G2spc.SSpcGroup(SGData,ssopt['ssSymb'][:-1])[1]     #skip trailing 's' for mag.
    32323235            Symb = SSGData['SSpGrp']
    32333236            Vec = ssopt['ModVec']
    32343237            maxH = ssopt['maxH']
    32353238            G2frame.HKL = G2pwd.getHKLMpeak(dmin,Inst,SGData,SSGData,Vec,maxH,A)
    3236             peaks = [G2indx.IndexSSPeaks(peaks[0],G2frame.HKL)[1],peaks[1]]   #keep esds from peak fit
    3237             M20,X20 = G2indx.calc_M20SS(peaks[0],G2frame.HKL)
     3239            if len(peaks[0]):           
     3240                peaks = [G2indx.IndexSSPeaks(peaks[0],G2frame.HKL)[1],peaks[1]]   #keep esds from peak fit
     3241                M20,X20 = G2indx.calc_M20SS(peaks[0],G2frame.HKL)
    32383242        else:
     3243            G2frame.HKL = G2pwd.getHKLpeak(dmin,SGData,A,Inst)
    32393244            if len(peaks[0]):
    3240                 G2frame.HKL = G2pwd.getHKLpeak(dmin,SGData,A,Inst)
    32413245                peaks = [G2indx.IndexPeaks(peaks[0],G2frame.HKL)[1],peaks[1]]   #keep esds from peak fit
    32423246                M20,X20 = G2indx.calc_M20(peaks[0],G2frame.HKL)
    3243             else:
    3244                 M20 = X20 = 0.
    3245                 G2frame.HKL = G2pwd.getHKLpeak(dmin,SGData,A,Inst)
    32463247        G2frame.HKL = np.array(G2frame.HKL)
    32473248        if len(G2frame.HKL):
     
    33123313        item, cookie = G2frame.GPXtree.GetFirstChild(pId)
    33133314        while item:
    3314             Phases.append(G2frame.GPXtree.GetItemText(item))
    3315             item, cookie = G2frame.GPXtree.GetNextChild(pId, cookie)   
     3315            pName = G2frame.GPXtree.GetItemText(item)
     3316            Phase = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,pId,pName))
     3317            if not Phase['General']['SGData'].get('SGFixed',False):
     3318                Phases.append(G2frame.GPXtree.GetItemText(item))
     3319            item, cookie = G2frame.GPXtree.GetNextChild(pId, cookie)
     3320        if not len(Phases):
     3321                wx.MessageBox('NB: Magnetic phases from mcif files are not suitable for this purpose,\n because of space group symbol - operators mismatches',
     3322                    caption='No usable space groups',style=wx.ICON_EXCLAMATION)
     3323                return           
    33163324        pNum = G2G.ItemSelector(Phases,G2frame,'Select phase',header='Phase')
    33173325        if pNum is None: return
     
    33203328        Cell = Phase['General']['Cell']
    33213329        SGData = Phase['General']['SGData']
     3330        if Phase['General']['Type'] == 'nuclear' and 'MagSpGrp' in SGData:
     3331            SGData = G2spc.SpcGroup(SGData['SpGrp'])[1]
     3332        G2frame.dataWindow.RunSubGroups.Enable(True)
     3333        if 'SuperSg' in Phase['General'] or SGData.get('SGGray',False):
     3334            ssopt.update({'SGData':SGData,'ssSymb':Phase['General']['SuperSg'],'ModVec':Phase['General']['SuperVec'][0],'Use':True,'maxH':1})
     3335            ssopt['ssSymb'] = ssopt['ssSymb'].replace(',','')
     3336            ssSym = ssopt['ssSymb']
     3337            if SGData['SGGray']:
     3338                ssSym = ssSym[:-1]
     3339            if ssSym not in G2spc.SSChoice(SGData):
     3340                ssSym = ssSym.split(')')[0]+')000'
     3341                ssopt['ssSymb'] = ssSym
     3342                wx.MessageBox('Super space group '+SGData['SpGrp']+ssopt['ssSymb']+' not valid;\n It is set to '+ssSym,
     3343                    caption='Unusable super space group',style=wx.ICON_EXCLAMATION)
     3344            G2frame.dataWindow.RunSubGroups.Enable(False)
    33223345        SpGrp = SGData['SpGrp']
    33233346        if 'mono' in SGData['SGSys']:
    33243347            SpGrp = G2spc.fixMono(SpGrp)
    33253348            if SpGrp == None:
    3326                 wx.MessageBox('Unusable space group',caption='Monoclinic '+SGData['SpGrp']+' not usable here',style=wx.ICON_EXCLAMATION)
     3349                wx.MessageBox('Monoclinic '+SGData['SpGrp']+' not usable here',caption='Unusable space group',style=wx.ICON_EXCLAMATION)
    33273350                return
    33283351        controls[13] = SpGrp
     
    33373360        if 'N' in Inst['Type'][0]:
    33383361            if not ssopt.get('Use',False):
    3339                 G2frame.dataWindow.RunSubGroupsMag.Enable(True)
    3340         G2frame.dataWindow.RunSubGroups.Enable(True)
     3362                G2frame.dataWindow.RunSubGroups.Enable(True)
     3363        data = controls,bravais,cells,dminx,ssopt,magcells
    33413364        G2frame.GPXtree.SetItemPyData(UnitCellsId,data)
    33423365        G2frame.dataWindow.RefineCell.Enable(True)
     
    42294252        ssChoice = G2spc.SSChoice(SGData)
    42304253        if ssopt['ssSymb'] not in ssChoice:
    4231             ssopt['ssSymb'] = ssChoice[0]
     4254            ssopt['ssSymb'] = ssopt['ssSymb'][:-1]
    42324255        ssSizer = wx.BoxSizer(wx.HORIZONTAL)
    42334256        ssSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Supersymmetry space group: '+SpSg+' '),0,WACV)
Note: See TracChangeset for help on using the changeset viewer.