Changeset 1581


Ignore:
Timestamp:
Nov 24, 2014 9:27:52 AM (7 years ago)
Author:
vondreele
Message:

fix problem editing R3cR lattice parameters - incorrect angle index
begin GUI for modulation vector search

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIindex.py

    r1578 r1581  
    386386    else:
    387387        Nskip = 6
     388    Vec = []
    388389    i = 0
    389     for v,r in zip(vec,Vref):
     390    for j,r in enumerate(Vref):
    390391        if r:
    391             v = val[i+Nskip]
     392            Vec.append(val[i+Nskip])
    392393            i += 1
    393     return np.array(vec) 
     394        else:
     395            Vec.append(vec[j])
     396    return np.array(Vec) 
    394397
    395398def FitHKL(ibrav,peaks,A,Pwr):
     
    456459    if Zref:
    457460        values.append(Z)
    458     result = so.leastsq(errFit,values,full_output=True,ftol=0.0001,factor=0.001,
     461    result = so.leastsq(errFit,values,full_output=True,ftol=1.e-6,factor=1.,
    459462        args=(ibrav,Peaks[8],Peaks[4:8],Peaks[0],wave,V,Vref,Zref,Pwr))
    460463    A = Values2A(ibrav,result[0])
  • trunk/GSASIIlattice.py

    r1578 r1581  
    4545acosd = lambda x: 180.*np.arccos(x)/np.pi
    4646rdsq2d = lambda x,p: round(1.0/np.sqrt(x),p)
     47rpd = np.pi/180.
    4748
    4849def sec2HMS(sec):
     
    458459def calc_rDsqZ(H,A,Z,tth,lam):
    459460    'needs doc string'
    460     rpd = np.pi/180.
    461461    rdsq = calc_rDsq(H,A)+Z*sind(tth)*2.0*rpd/lam**2
    462462    return rdsq
     
    464464def calc_rDsqZSS(H,A,vec,Z,tth,lam):
    465465    'needs doc string'
    466     rpd = np.pi/180.
    467466    rdsq = calc_rDsq(H[:3]+(H[3][:,np.newaxis]*vec).T,A)+Z*sind(tth)*2.0*rpd/lam**2
    468467    return rdsq
     
    970969    """                         
    971970   
    972     rpd = math.pi/180.
    973971    if IFCoup:
    974972        GSomeg = sind(Gangls[2]+Tth)
  • trunk/GSASIImath.py

    r1531 r1581  
    29782978    x0 = [parmDict[val] for val in varyList]
    29792979    ifInv = SGData['SGInv']
     2980    # consider replacing anneal with scipy.optimize.basinhopping
    29802981    results = anneal(mcsaCalc,x0,args=(refs,rcov,cosTable,ifInv,allFF,RBdata,varyList,parmDict),
    29812982        schedule=MCSA['Algorithm'], full_output=True,
  • trunk/GSASIIphsGUI.py

    r1578 r1581  
    286286           
    287287            cellGUIlist = [[['m3','m3m'],4,zip([" Unit cell: a = "," Vol = "],["%.5f","%.3f"],[True,False],[0,0])],
    288             [['3R','3mR'],6,zip([" a = "," alpha = "," Vol = "],["%.5f","%.3f","%.3f"],[True,True,False],[0,2,0])],
     288            [['3R','3mR'],6,zip([" a = "," alpha = "," Vol = "],["%.5f","%.3f","%.3f"],[True,True,False],[0,3,0])],
    289289            [['3','3m1','31m','6/m','6/mmm','4/m','4/mmm'],6,zip([" a = "," c = "," Vol = "],["%.5f","%.5f","%.3f"],[True,True,False],[0,2,0])],
    290290            [['mmm'],8,zip([" a = "," b = "," c = "," Vol = "],["%.5f","%.5f","%.5f","%.3f"],
     
    381381                    if denSizer[2]:
    382382                        denSizer[2].SetValue('%.3f'%(mattCoeff))
    383                 generalData['Cell'] = cell
    384383           
    385384            cell = generalData['Cell']
  • trunk/GSASIIpwdGUI.py

    r1578 r1581  
    22692269        OnHklShow(event)
    22702270       
     2271    def OnFindMV(event):
     2272        print 'find MV'
     2273       
    22712274    def OnBravSel(event):
    22722275        brav = bravSel.GetString(bravSel.GetSelection())
     
    23612364            G2frame.HKL = G2pwd.getHKLMpeak(dmin,Inst,SGData,SSGData,Vec,maxH,A)
    23622365            peaks = [G2indx.IndexSSPeaks(peaks[0],G2frame.HKL)[1],peaks[1]]   #keep esds from peak fit
     2366            M20,X20 = G2indx.calc_M20SS(peaks[0],G2frame.HKL)
    23632367        else:
    23642368            G2frame.HKL = G2pwd.getHKLpeak(dmin,Inst,SGData,A)
    23652369            peaks = [G2indx.IndexPeaks(peaks[0],G2frame.HKL)[1],peaks[1]]   #keep esds from peak fit
     2370            M20,X20 = G2indx.calc_M20(peaks[0],G2frame.HKL)
     2371        print ' new M20,X20: %.2f %d'%(M20,X20)
    23662372        G2frame.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Index Peak List'),peaks)
    23672373        if 'PKS' in G2frame.PatternTree.GetItemText(G2frame.PatternId):
     
    23982404        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)       
    23992405               
    2400     def RefineCell(event):  #want this to do modulation vector as well
     2406    def RefineCell(event):
     2407       
    24012408        def cellPrint(ibrav,A):
    24022409            cell = G2lat.A2cell(A)
     
    27502757        maxMH.Bind(wx.EVT_COMBOBOX, OnMaxMH)
    27512758        ssSizer.Add(maxMH,0,WACV)
     2759        findMV = wx.wx.Button(G2frame.dataDisplay,label="Find mod. vec.?")
     2760        findMV.Bind(wx.EVT_BUTTON,OnFindMV)
     2761        ssSizer.Add(findMV,0,WACV)
    27522762        mainSizer.Add(ssSizer,0)
    27532763
Note: See TracChangeset for help on using the changeset viewer.