Changeset 1618


Ignore:
Timestamp:
Dec 26, 2014 9:08:45 PM (7 years ago)
Author:
vondreele
Message:

fix space group print in shelx export
fix errors when data is deleted
add HKLshow to change in space group in index page
more on supersymmetry refinement

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1606 r1618  
    27942794        DelList = []
    27952795        DelItemList = []
     2796        nItems = {'PWDR':0,'SASD':0,'IMG':0,'HKLF':0,'PDF':0}
    27962797        ifPWDR = False
    27972798        ifSASD = False
     
    28052806                if name not in ['Notebook','Controls','Covariance','Constraints',
    28062807                    'Restraints','Phases','Rigid bodies']:
    2807                     if 'PWDR' in name: ifPWDR = True
    2808                     if 'SASD' in name: ifSASD = True
    2809                     if 'IMG' in name: ifIMG = True
    2810                     if 'HKLF' in name: ifHKLF = True
    2811                     if 'PDF' in name: ifPDF = True
     2808                    if 'PWDR' in name: ifPWDR = True; nItems['PWDR'] += 1
     2809                    if 'SASD' in name: ifSASD = True; nItems['SASD'] += 1
     2810                    if 'IMG' in name: ifIMG = True; nItems['IMG'] += 1
     2811                    if 'HKLF' in name: ifHKLF = True; nItems['HKLF'] += 1
     2812                    if 'PDF' in name: ifPDF = True; nItems['PDF'] += 1
    28122813                    TextList.append(name)
    28132814                item, cookie = self.PatternTree.GetNextChild(self.root, cookie)
     
    28362837                    item, cookie = self.PatternTree.GetFirstChild(self.root)
    28372838                    while item:
    2838                         if self.PatternTree.GetItemText(item) in DelList: DelItemList.append(item)
     2839                        itemName = self.PatternTree.GetItemText(item)
     2840                        if itemName in DelList:
     2841                            if 'PWDR' in itemName: nItems['PWDR'] -= 1
     2842                            elif 'SASD' in itemName: nItems['SASD'] -= 1
     2843                            elif 'IMG' in itemName: nItems['IMG'] -= 1
     2844                            elif 'HKLF' in itemName: nItems['HKLF'] -= 1
     2845                            elif 'PDF' in itemName: nItems['PDF'] -= 1
     2846                            DelItemList.append(item)
    28392847                        item, cookie = self.PatternTree.GetNextChild(self.root, cookie)
    28402848                    for item in DelItemList:
    28412849                        self.PatternTree.Delete(item)
    28422850                    self.PickId = 0
    2843                     wx.CallAfter(G2plt.PlotPatterns,self,True)                        #so plot gets updated
     2851                    if nItems['PWDR']:
     2852                        wx.CallAfter(G2plt.PlotPatterns,self,True)
     2853                    else:
     2854                        self.G2plotNB.Delete('Powder Patterns')
     2855                    if not nItems['IMG']:
     2856                        self.G2plotNB.Delete('2D Powder Image')
     2857                    if not nItems['HKLF']:
     2858                        self.G2plotNB.Delete('Structure Factors')
     2859                        if '3D Structure Factors' in self.G2plotNB.plotList:
     2860                            self.G2plotNB.Delete('3D Structure Factors')
    28442861            finally:
    28452862                dlg.Destroy()
     
    32813298
    32823299        return HistogramNames
    3283 
    32843300                   
    32853301    def GetUsedHistogramsAndPhasesfromTree(self):
  • trunk/GSASIIgrid.py

    r1614 r1618  
    13601360            Ncol = 3
    13611361        OpList = []
    1362         for M,T in SGData['SGOps']:
    1363             OpList.append(G2spc.MT2text(M,T))
     1362        for Opr in SGData['SGOps']:
     1363            OpList.append(G2spc.MT2text(Opr))
    13641364        self.oprs = wx.RadioBox(panel,-1,'Choose space group operator?',choices=OpList,
    13651365            majorDimension=Ncol)
  • trunk/GSASIIplot.py

    r1613 r1618  
    16471647        if G2frame.PatternTree.GetItemText(PickId) in ['Index Peak List','Unit Cells List']:
    16481648            peaks = np.array((G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Index Peak List'))))
    1649             if not peaks: return # are there any peaks?
     1649            if not len(peaks): return # are there any peaks?
    16501650            for peak in peaks[0]:
    16511651                if peak[2]:
  • trunk/GSASIIpwdGUI.py

    r1617 r1618  
    23022302        controls[13] = spcSel.GetString(spcSel.GetSelection())
    23032303        G2frame.dataFrame.RefineCell.Enable(True)
     2304        OnHklShow(event)
    23042305       
    23052306    def SetCellValue(Obj,ObjId,value):
     
    23762377        spc = controls[13]
    23772378        SGData = G2spc.SpcGroup(spc)[1]
    2378         if 'C' in Inst['Type'][0]:
    2379             dmin = G2lat.Pos2dsp(Inst,limits[1])
    2380         else:   #TOF - use other limit!
    2381             dmin = G2lat.Pos2dsp(Inst,limits[0])
     2379#        if 'C' in Inst['Type'][0]:
     2380#            dmin = G2lat.Pos2dsp(Inst,limits[1])
     2381#        else:   #TOF - use other limit!
     2382#            dmin = G2lat.Pos2dsp(Inst,limits[0])
    23822383        if ssopt.get('Use',False):
     2384            dmin = peaks[0][-1][8]
    23832385            SSGData = G2spc.SSpcGroup(SGData,ssopt['ssSymb'])[1]
    23842386            Vec = ssopt['ModVec']
     
    23882390            M20,X20 = G2indx.calc_M20SS(peaks[0],G2frame.HKL)
    23892391        else:
     2392            dmin = peaks[0][-1][7]
    23902393            G2frame.HKL = G2pwd.getHKLpeak(dmin,Inst,SGData,A)
    23912394            peaks = [G2indx.IndexPeaks(peaks[0],G2frame.HKL)[1],peaks[1]]   #keep esds from peak fit
    23922395            M20,X20 = G2indx.calc_M20(peaks[0],G2frame.HKL)
    2393         print ' new M20,X20: %.2f %d'%(M20,X20)
     2396        print ' new M20,X20: %.2f %d fraction found: %.3f'%(M20,X20,float(len(peaks[0]))/len(G2frame.HKL))
    23942397        G2frame.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Index Peak List'),peaks)
    23952398        if 'PKS' in G2frame.PatternTree.GetItemText(G2frame.PatternId):
  • trunk/GSASIIstrIO.py

    r1616 r1618  
    10241024                   
    10251025        Natoms[pfx] = 0
     1026        maxSSwave = {'Sfrac':0,'Spos':0,'Sadp':0,'Smag':0}
    10261027        if Atoms and not General.get('doPawley'):
    10271028            cx,ct,cs,cia = General['AtomPtrs']
     
    11241125                                            eqv[1] /= coef
    11251126                                        G2mv.StoreEquivalence(name,equiv[1:])
     1127                        maxSSwave['Stype'] = max(maxSSwave['Stype'],iw+1)
     1128            phaseDict[pfx+'maxSSwave'] = maxSSwave   
    11261129            textureData = General['SH Texture']
    11271130            if textureData['Order']:
  • trunk/GSASIIstrMath.py

    r1613 r1618  
    534534    return Tdata,Mdata,Fdata,Xdata,dXdata,IAdata,Uisodata,Uijdata
    535535   
     536def GetAtomSSFXU(pfx,calcControls,parmDict):
     537    'Needs a doc string'
     538    Natoms = calcControls['Natoms'][pfx]
     539    maxSSwave = parmDict[pfx+'maxSSwave']
     540    Nwave = {'F':maxSSwave['Sfrac'],'X':maxSSwave['Spos'],'Y':maxSSwave['Spos'],'Z':maxSSwave['Spos'],
     541        'U':maxSSwave['Sadp'],'M':maxSSwave['Smag']}
     542    XSSdata = np.zeros((6,maxSSwave['Spos'],Natoms))
     543    FSSdata = np.zeros((2,maxSSwave['Sfrac'],Natoms))
     544    USSdata = np.zeros((12,maxSSwave['Sadp'],Natoms))
     545    MSSdata = np.zeros((6,maxSSwave['Smag'],Natoms))
     546    keys = {'Fsin:':FSSdata[0],'Fcos:':FSSdata[1],
     547        'Xsin:':XSSdata[0],'Ysin:':XSSdata[1],'Zsin:':XSSdata[2],'Xcos:':XSSdata[3],'Ycos:':XSSdata[4],'Zcos:':XSSdata[5],
     548        'U11sin:':USSdata[0],'U22sin:':USSdata[1],'U33sin:':USSdata[2],'U12sin:':USSdata[3],'U13sin:':USSdata[4],'U23sin:':USSdata[5],
     549        'U11cos:':USSdata[6],'U22cos:':USSdata[7],'U33cos:':USSdata[8],'U12cos:':USSdata[9],'U13cos:':USSdata[10],'U23cos:':USSdata[11],
     550        'MXsin:':MSSdata[0],'MYsin:':MSSdata[1],'MZsin:':MSSdata[2],'MXcos:':MSSdata[3],'MYcos:':MSSdata[4],'MZcos:':MSSdata[5]}
     551    for iatm in range(Natoms):
     552        for key in keys:
     553            for m in range(Nwave[key[0]]):
     554                parm = pfx+key+str(iatm)+':%d'%(m)
     555                if parm in parmDict:
     556                    keys[key][iatm] = parmDict[parm]
     557    return FSSdata,XSSdata,USSdata,MSSdata   
     558   
    536559def StructureFactor(refDict,G,hfx,pfx,SGData,calcControls,parmDict):
    537560    ''' Not Used: here only for comparison the StructureFactor2 - faster version
     
    635658    SGMT = np.array([ops[0].T for ops in SGData['SGOps']])
    636659    SGT = np.array([ops[1] for ops in SGData['SGOps']])
     660    SSGMT = np.array([ops[0].T for ops in SSGData['SSGOps']])
     661    SSGT = np.array([ops[1] for ops in SSGData['SSGOps']])
    637662    FFtables = calcControls['FFtables']
    638663    BLtables = calcControls['BLtables']
    639664    Tdata,Mdata,Fdata,Xdata,dXdata,IAdata,Uisodata,Uijdata = GetAtomFXU(pfx,calcControls,parmDict)
     665    SSFdata,SSXdata,SSUdata,SSMdata = GetAtomSSFXU(pfx,calcControls,parmDict)
    640666    FF = np.zeros(len(Tdata))
    641667    if 'NC' in calcControls[hfx+'histType']:
     
    658684        fbs = np.array([0,0])
    659685        H = refl[:4]
    660         if refl[3]:
    661             continue
    662686        SQ = 1./(2.*refl[4+im])**2
    663687        SQfactor = 4.0*SQ*twopisq
     
    18501874        if not Phase['General'].get('doPawley'):
    18511875            time0 = time.time()
    1852             StructureFactor2(refDict,G,hfx,pfx,SGData,calcControls,parmDict)
     1876            if im:
     1877                SStructureFactor(refDict,im,G,hfx,pfx,SGData,calcControls,parmDict)
     1878            else:
     1879                StructureFactor2(refDict,G,hfx,pfx,SGData,calcControls,parmDict)
    18531880#            print 'sf calc time: %.3fs'%(time.time()-time0)
    18541881        time0 = time.time()
     
    20262053        if not Phase['General'].get('doPawley'):
    20272054            time0 = time.time()
    2028             dFdvDict = StructureFactorDerv(refDict,G,hfx,pfx,SGData,calcControls,parmDict)
     2055            if im:
     2056                dFdvDict = StructureFactorDerv(refDict,im,G,hfx,pfx,SGData,calcControls,parmDict)
     2057            else:
     2058                dFdvDict = StructureFactorDerv(refDict,G,hfx,pfx,SGData,calcControls,parmDict)
    20292059#            print 'sf-derv time %.3fs'%(time.time()-time0)
    20302060            ApplyRBModelDervs(dFdvDict,parmDict,rigidbodyDict,Phase)
     
    22642294    G,g = G2lat.A2Gmat(A)       #recip & real metric tensors
    22652295    refDict = Histogram['Data']
    2266     dFdvDict = StructureFactorDerv(refDict,G,hfx,pfx,SGData,calcControls,parmDict)
     2296    if im:
     2297        dFdvDict = StructureFactorDerv(refDict,im,G,hfx,pfx,SGData,calcControls,parmDict)
     2298    else:
     2299        dFdvDict = StructureFactorDerv(refDict,G,hfx,pfx,SGData,calcControls,parmDict)
    22672300    ApplyRBModelDervs(dFdvDict,parmDict,rigidbodyDict,Phase)
    22682301    dMdvh = np.zeros((len(varylist),len(refDict['RefList'])))
     
    25372570                SStructureFactor(refDict,im,G,hfx,pfx,SGData,calcControls,parmDict)
    25382571            else:
    2539                 StructureFactor(refDict,G,hfx,pfx,SGData,calcControls,parmDict)
    2540 #                StructureFactor2(refDict,G,hfx,pfx,SGData,calcControls,parmDict)
     2572                StructureFactor2(refDict,G,hfx,pfx,SGData,calcControls,parmDict)
    25412573#            print 'sf-calc time: %.3f'%(time.time()-time0)
    25422574            df = np.zeros(len(refDict['RefList']))
  • trunk/exports/G2export_shelx.py

    r1261 r1618  
    6767            self.Write("LATT "+str(lattnum))
    6868            # generate symmetry operations not including centering and center of symmetry
    69             for M,T in phasedict['General']['SGData']['SGOps']:
    70                 sym = G2spc.MT2text(M,T).lower().replace(" ,",", ")
     69            for Opr in phasedict['General']['SGData']['SGOps']:
     70                sym = G2spc.MT2text(Opr).lower().replace(" ,",", ")
    7171                self.Write('SYMM '+G2IO.trim(sym))
    7272            # scan through atom types, count the number of times that each element occurs
Note: See TracChangeset for help on using the changeset viewer.