Changeset 1637


Ignore:
Timestamp:
Feb 6, 2015 3:09:50 PM (7 years ago)
Author:
vondreele
Message:

fixes to peak indexing routines; new Inst argument for getHKLpeak messed up indexing routines. Now optional at end of arguments.
some more work on SS constraints.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIindex.py

    r1593 r1637  
    292292        difC = Inst['difC'][1]
    293293    SGData = G2spc.SpcGroup(controls[13])[1]
    294     SSGData = G2spc.SSpcGroup(SGData,ssopt['ssSymb'])
     294    SSGData = G2spc.SSpcGroup(SGData,ssopt['ssSymb'])[1]
    295295    A = G2lat.cell2A(controls[6:12])
    296296    Z = controls[1]
  • trunk/GSASIIpwd.py

    r1594 r1637  
    796796    return lenR,dRdS
    797797
    798 def getHKLpeak(dmin,Inst,SGData,A):
     798def getHKLpeak(dmin,SGData,A,Inst=None):
    799799    'needs a doc string'
    800800    HKL = G2lat.GenHLaue(dmin,SGData,A)       
     
    803803        ext = G2spc.GenHKLf([h,k,l],SGData)[0]
    804804        if not ext:
    805             HKLs.append([h,k,l,d,G2lat.Dsp2pos(Inst,d),-1])
     805            if Inst == None:
     806                HKLs.append([h,k,l,d,0,-1])
     807            else:
     808                HKLs.append([h,k,l,d,G2lat.Dsp2pos(Inst,d),-1])
    806809    return HKLs
    807810
  • trunk/GSASIIpwdGUI.py

    r1633 r1637  
    23962396        else:
    23972397            dmin = peaks[0][-1][7]
    2398             G2frame.HKL = G2pwd.getHKLpeak(dmin,Inst,SGData,A)
     2398            G2frame.HKL = G2pwd.getHKLpeak(dmin,SGData,A,Inst)
    23992399            peaks = [G2indx.IndexPeaks(peaks[0],G2frame.HKL)[1],peaks[1]]   #keep esds from peak fit
    24002400            M20,X20 = G2indx.calc_M20(peaks[0],G2frame.HKL)
     
    24782478                    G2indx.refinePeaksZSS(peaks[0],wave,Inst,SGData,SSGData,ssopt['maxH'],ibrav,A,ssopt['ModVec'],vecFlags,controls[1],controls[0])
    24792479            else:
    2480                 G2frame.HKL = G2pwd.getHKLpeak(dmin,Inst,SGData,A)
     2480                G2frame.HKL = G2pwd.getHKLpeak(dmin,SGData,A,Inst)
    24812481                peaks = [G2indx.IndexPeaks(peaks[0],G2frame.HKL)[1],peaks[1]]   #put peak fit esds back in peaks
    24822482                Lhkl,M20,X20,Aref,Zero = G2indx.refinePeaksZ(peaks[0],wave,ibrav,A,controls[1],controls[0])
    24832483        else:   #'T'OF - doesn't seem to work
    2484             G2frame.HKL = G2pwd.getHKLpeak(dmin,Inst,SGData,A)
     2484            G2frame.HKL = G2pwd.getHKLpeak(dmin,SGData,A,Inst)
    24852485            peaks = [G2indx.IndexPeaks(peaks[0],G2frame.HKL)[1],peaks[1]]   #put peak fit esds back in peaks
    24862486            Lhkl,M20,X20,Aref,Zero = G2indx.refinePeaksT(peaks[0],difC,ibrav,A,controls[1],controls[0])           
     
    24962496            G2frame.HKL = G2pwd.getHKLMpeak(dmin,Inst,SGData,SSGData,ssopt['ModVec'],ssopt['maxH'],A)
    24972497        else:
    2498             G2frame.HKL = G2pwd.getHKLpeak(dmin,Inst,SGData,A)
     2498            G2frame.HKL = G2pwd.getHKLpeak(dmin,SGData,A,Inst)
    24992499        data = [controls,bravais,cells,dmin,ssopt]
    25002500        G2frame.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Unit Cells List'),data)
  • trunk/GSASIIspc.py

    r1636 r1637  
    14921492    SSop = []
    14931493    Sop = []
     1494    Sdtau = []
    14941495    for iop,Op in enumerate(SGOps):         
    14951496        nxyz = (np.inner(Op[0],xyz)+Op[1])%1.
     
    14971498            SSop.append(SSGOps[iop])
    14981499            Sop.append(SGOps[iop])
     1500            ssopinv = nl.inv(SSGOps[iop][0])
     1501            mst = ssopinv[3][:3]
     1502            epsinv = ssopinv[3][3]
     1503            Sdtau.append(np.sum(mst*(XYZ-SGOps[iop][1])-epsinv*SSGOps[iop][1][3]))
     1504    Sdtau = np.array(Sdtau)
     1505    SdIndx = np.argsort(Sdtau)
     1506    print SdIndx
    14991507    OpText =  [MT2text(s).replace(' ','') for s in Sop]         #debug?
    15001508    SSOpText = [SSMT2text(ss).replace(' ','') for ss in SSop]   #debug?
     
    15341542    dXTP = []
    15351543    dUTP = []
    1536     for sop,ssop in zip(Sop,SSop):
     1544    for i in SdIndx:
     1545        sop = Sop[i]
     1546        ssop = SSop[i]
    15371547        fsc = np.ones(2,dtype='i')
    15381548        xsc = np.ones(6,dtype='i')
     
    15461556        if np.any(dtau%.5):
    15471557            dT = np.tan(np.pi*np.sum(dtau))
    1548         print sdet,ssdet,dtau,np.sum(dtau),dT
    15491558        tauT = np.inner(mst,XYZ-sop[1])+epsinv*(tau-ssop[1][3])
    15501559        if waveType == 'Fourier':
Note: See TracChangeset for help on using the changeset viewer.