Changeset 2024


Ignore:
Timestamp:
Oct 24, 2015 1:57:02 AM (6 years ago)
Author:
vondreele
Message:

dmin in indexing of unit cells is now taken directly from the powder pattern limits rather than some saved value which caused issues with TOF data.
minor revisions to SS structure factor

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r2022 r2024  
    23742374        'P 4/m m m','F m m m','I m m m','C m m m','P m m m','C 2/m','P 2/m','P -1']
    23752375    Inst = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Instrument Parameters'))[0]
     2376    Limits = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Limits'))[1]
    23762377    if 'C' in Inst['Type'][0] or 'PKS' in Inst['Type'][0]:
    23772378        wave = G2mth.getWave(Inst)
     2379        dmin = G2lat.Pos2dsp(Inst,Limits[1])
    23782380    else:
    23792381        difC = Inst['difC'][1]
     2382        dmin = G2lat.Pos2dsp(Inst,Limits[0])
    23802383   
    23812384    def SetLattice(controls):
     
    25822585        peaks = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Index Peak List'))
    25832586        limits = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Limits'))[1]
    2584         controls,bravais,cells,dmin,ssopt = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Unit Cells List'))
     2587        controls,bravais,cells,dminx,ssopt = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Unit Cells List'))
    25852588        cell = controls[6:12]
    25862589        A = G2lat.cell2A(cell)
     
    25882591        spc = controls[13]
    25892592        SGData = G2spc.SpcGroup(spc)[1]
    2590         if 'C' in Inst['Type'][0]:
    2591             dmin = G2lat.Pos2dsp(Inst,limits[1])
    2592         else:   #TOF - use other limit!
    2593             dmin = G2lat.Pos2dsp(Inst,limits[0])
    25942593        if ssopt.get('Use',False):
    2595 #            dmin = peaks[0][-1][8]
    25962594            SSGData = G2spc.SSpcGroup(SGData,ssopt['ssSymb'])[1]
    25972595            Vec = ssopt['ModVec']
     
    26022600        else:
    26032601            if len(peaks[0]):
    2604                 dmin = peaks[0][-1][7]
     2602#                dmin = peaks[0][-1][7]
    26052603                G2frame.HKL = G2pwd.getHKLpeak(dmin,SGData,A,Inst)
    26062604                peaks = [G2indx.IndexPeaks(peaks[0],G2frame.HKL)[1],peaks[1]]   #keep esds from peak fit
     
    26192617           
    26202618    def OnSortCells(event):
    2621         controls,bravais,cells,dmin,ssopt = G2frame.PatternTree.GetItemPyData(UnitCellsId)
     2619        controls,bravais,cells,dminx,ssopt = G2frame.PatternTree.GetItemPyData(UnitCellsId)
    26222620        c =  event.GetCol()
    26232621        if colLabels[c] == 'M20':
     
    26342632       
    26352633    def CopyUnitCell(event):
    2636         controls,bravais,cells,dmin,ssopt = G2frame.PatternTree.GetItemPyData(UnitCellsId)
     2634        controls,bravais,cells,dminx,ssopt = G2frame.PatternTree.GetItemPyData(UnitCellsId)
    26372635        for Cell in cells:
    26382636            if Cell[-2]:
     
    26752673            return       
    26762674        print ' Refine cell'
    2677         controls,bravais,cells,dmin,ssopt = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Unit Cells List'))
     2675        controls,bravais,cells,dminx,ssopt = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Unit Cells List'))
    26782676        cell = controls[6:12]
    26792677        A = G2lat.cell2A(cell)
    26802678        ibrav = bravaisSymb.index(controls[5])
    26812679        SGData = G2spc.SpcGroup(controls[13])[1]
    2682 #        dmin = G2indx.getDmin(peaks[0])-0.005
    26832680        if 'C' in Inst['Type'][0]:
    26842681            if ssopt.get('Use',False):
     
    27332730        keepcells = []
    27342731        try:
    2735             controls,bravais,cells,dmin,ssopt = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Unit Cells List'))
     2732            controls,bravais,cells,dminx,ssopt = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Unit Cells List'))
    27362733            for cell in cells:
    27372734                if cell[11]:
     
    27822779    def RefreshUnitCellsGrid(event):
    27832780        data = G2frame.PatternTree.GetItemPyData(UnitCellsId)
    2784         cells,dmin = data[2:4]
     2781        cells,dminx = data[2:4]
    27852782        r,c =  event.GetRow(),event.GetCol()
    27862783        if cells:
     
    28482845    G2frame.Bind(wx.EVT_MENU, OnExportCells, id=G2gd.wxID_EXPORTCELLS)
    28492846       
    2850     controls,bravais,cells,dmin,ssopt = data
     2847    controls,bravais,cells,dminx,ssopt = data
    28512848    if len(controls) < 13:              #add cell volume if missing
    28522849        controls.append(G2lat.calc_V(G2lat.cell2A(controls[6:12])))
  • trunk/GSASIIstrMath.py

    r2014 r2024  
    953953    return dFdvDict
    954954   
    955 def SStructureFactor2(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict):
     955def SStructureFactor(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict):
    956956    '''
    957957    Compute super structure factors for all h,k,l,m for phase
     
    976976    SSGMT = np.array([ops[0].T for ops in SSGData['SSGOps']])
    977977    SSGT = np.array([ops[1] for ops in SSGData['SSGOps']])
     978    eps = SSGMT[:,3,3]
    978979    FFtables = calcControls['FFtables']
    979980    BLtables = calcControls['BLtables']
     
    992993    waveTypes,FSSdata,XSSdata,USSdata,MSSdata = GetAtomSSFXU(pfx,calcControls,parmDict)
    993994    Smult,TauT = GetSSTauM(SGData['SGOps'],SSGData['SSGOps'],pfx,calcControls,Xdata)
     995#    GSASIIpath.IPyBreak()
    994996    if SGInv:
    995997        TauT = np.hstack((TauT,-TauT))
     998        eps = np.concatenate((eps,-eps))
    996999    modQ = np.array([parmDict[pfx+'mV0'],parmDict[pfx+'mV1'],parmDict[pfx+'mV2']])
    9971000    FF = np.zeros(len(Tdata))
     
    10521055        Tindx = np.array([refDict['FF']['El'].index(El) for El in Tdata])
    10531056        FF = np.repeat(refDict['FF']['FF'][iBeg:iFin].T[Tindx].T,Uniq.shape[1]*len(TwinLaw),axis=0)
    1054         phase = twopi*(np.inner(Uniq[:,:,:3],(dXdata.T+Xdata.T))+Phi[:,:,nxs])
     1057        phase = twopi*(np.inner(Uniq[:,:,:3],(dXdata.T+Xdata.T))+Phi[:,:,nxs]) #+TauT.T[nxs,:,:]*eps[nxs,:,nxs]
    10551058        sinp = np.sin(phase)
    10561059        cosp = np.cos(phase)
     
    29102913            time0 = time.time()
    29112914            if im:
    2912                 SStructureFactor2(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict)
     2915                SStructureFactor(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict)
    29132916            else:
    29142917                StructureFactor2(refDict,G,hfx,pfx,SGData,calcControls,parmDict)
Note: See TracChangeset for help on using the changeset viewer.