Changeset 2022


Ignore:
Timestamp:
Oct 22, 2015 3:19:20 AM (6 years ago)
Author:
vondreele
Message:

fixes to TOF powder indexing & incommensurate structures

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIindex.py

    r1964 r2022  
    286286            dlg.Pulse()   
    287287        return chi
     288       
     289    def TSSfunc(values,peaks,dmin,Inst,SGData,SSGData,vec,Vref,maxH,A,difC,Z,dlg=None):
     290        Vec = Val2Vec(vec,Vref,values)
     291        HKL =  G2pwd.getHKLMpeak(dmin,Inst,SGData,SSGData,Vec,maxH,A)
     292        Peaks = np.array(IndexSSPeaks(peaks,HKL)[1]).T
     293        Qo = 1./Peaks[-2]**2
     294        Qc = G2lat.calc_rDsqTSS(Peaks[4:8],A,vec,Z,Peaks[0],difC)
     295        chi = np.sum((Qo-Qc)**2)
     296        if dlg:
     297            dlg.Pulse()   
     298        return chi
    288299
    289300    if 'C' in Inst['Type'][0]:
     
    303314            values += [v,]
    304315    dmin = getDmin(peaks)-0.005
    305     Peaks = np.copy(np.array(peaks).T)   
    306     result = so.brute(ZSSfunc,ranges,finish=so.fmin_cg,
    307         args=(peaks,dmin,Inst,SGData,SSGData,ssopt['ModVec'],Vref,ssopt['maxH'],A,wave,Z,dlg))
     316    Peaks = np.copy(np.array(peaks).T)
     317    if 'C' in Inst['Type'][0]:   
     318        result = so.brute(ZSSfunc,ranges,finish=so.fmin_cg,
     319            args=(peaks,dmin,Inst,SGData,SSGData,ssopt['ModVec'],Vref,ssopt['maxH'],A,wave,Z,dlg))
     320    else:
     321        result = so.brute(TSSfunc,ranges,finish=so.fmin_cg,
     322            args=(peaks,dmin,Inst,SGData,SSGData,ssopt['ModVec'],Vref,ssopt['maxH'],A,difC,Z,dlg))
    308323    return Val2Vec(ssopt['ModVec'],Vref,result)
    309324               
  • trunk/GSASIIlattice.py

    r1999 r2022  
    492492def calc_rDsqTSS(H,A,vec,Z,tof,difC):
    493493    'needs doc string'
    494     rdsq = calc_rDsq(H[:3]+H[3][:,np.newaxis]*vec,A)+Z/difC
     494    rdsq = calc_rDsq(H[:3]+(H[3][:,np.newaxis]*vec).T,A)+Z/difC
    495495    return rdsq
    496496       
  • trunk/GSASIIplot.py

    r2018 r2022  
    18531853            Phases = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId,'Reflection Lists'))
    18541854            for pId,phase in enumerate(Phases):
     1855                if 'list' in str(type(Phases[phase])):
     1856                    continue
    18551857                peaks = Phases[phase].get('RefList',[])
    18561858                if not len(peaks):
  • trunk/GSASIIpwd.py

    r2009 r2022  
    868868                DH = SSdH[dH]
    869869                H = [h+DH[0],k+DH[1],l+DH[2]]
    870                 d = 1/np.sqrt(G2lat.calc_rDsq(H,A))
     870                d = float(1/np.sqrt(G2lat.calc_rDsq(H,A)))
    871871                if d >= dmin:
    872872                    HKLM = np.array([h,k,l,dH])
  • trunk/GSASIIpwdGUI.py

    r1969 r2022  
    22232223    IndexId = G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Index Peak List')
    22242224    Inst = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Instrument Parameters'))[0]
     2225    Limits = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Limits'))
    22252226
    22262227    def RefreshIndexPeaksGrid(event):
     
    22922293                Unit.append({})
    22932294            controls,bravais,cellist,dmin,ssopt = Unit
     2295            if 'C' in Inst['Type'][0]:
     2296                dmin = G2lat.Pos2dsp(Inst,Limits[1][1])
     2297            else:   #TOF - use other limit!
     2298                dmin = G2lat.Pos2dsp(Inst,Limits[1][0])
    22942299            G2frame.HKL = []
    22952300            if ssopt.get('Use',False):
     
    25882593            dmin = G2lat.Pos2dsp(Inst,limits[0])
    25892594        if ssopt.get('Use',False):
    2590             dmin = peaks[0][-1][8]
     2595#            dmin = peaks[0][-1][8]
    25912596            SSGData = G2spc.SSpcGroup(SGData,ssopt['ssSymb'])[1]
    25922597            Vec = ssopt['ModVec']
     
    26752680        ibrav = bravaisSymb.index(controls[5])
    26762681        SGData = G2spc.SpcGroup(controls[13])[1]
    2677         dmin = G2indx.getDmin(peaks[0])-0.005
     2682#        dmin = G2indx.getDmin(peaks[0])-0.005
    26782683        if 'C' in Inst['Type'][0]:
    26792684            if ssopt.get('Use',False):
     
    28462851    if len(controls) < 13:              #add cell volume if missing
    28472852        controls.append(G2lat.calc_V(G2lat.cell2A(controls[6:12])))
    2848     if len(controls) < 14:              #add space gropu used in indexing
     2853    if len(controls) < 14:              #add space group used in indexing
    28492854        controls.append(spaceGroups[bravaisSymb.index(controls[5])])
    28502855    G2frame.PatternTree.SetItemPyData(UnitCellsId,data)            #update with volume
Note: See TracChangeset for help on using the changeset viewer.