Changeset 1253


Ignore:
Timestamp:
Mar 19, 2014 11:28:33 AM (8 years ago)
Author:
vondreele
Message:

fix James Hester's found typo in G2strIO
IPG/TNNLS now works for Size Distribution from SASD.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r1252 r1253  
    25972597        sizeSizer.Add((5,5),0)
    25982598        fitSizer = wx.BoxSizer(wx.HORIZONTAL)
    2599         methods = ['MaxEnt',]   #'IPG',]
     2599        methods = ['MaxEnt','IPG',]
    26002600        fitSizer.Add(wx.StaticText(G2frame.dataDisplay,label='Fitting method: '),0,WACV)
    26012601        method = wx.ComboBox(G2frame.dataDisplay,value=data['Size']['Method'],choices=methods,
  • trunk/GSASIIsasd.py

    r1252 r1253  
    693693    Amat = GmatE*QvecP[:np.newaxis]
    694694    AAmat = np.inner(Amat,Amat)
    695     Bvec = datum*QvecP
    696     Xw = np.ones_like(Bins)*1.e-6
     695    Bvec = IntE*QvecP
     696    Xw = np.ones_like(Bins)*1.e-32
    697697    calc = np.dot(G.T,Xw)
    698698    nIter = 0
     
    700700    while (nIter<IterMax) and (err > 1.):
    701701        #Step 1 in M&Z paper:
    702         Qk = np.dot(AAmat,Xw)-np.dot(Amat,Bvec)
    703         Dk = Xw/np.dot(AAmat,Xw)
     702        Qk = np.inner(AAmat,Xw)-np.inner(Amat,Bvec)
     703        Dk = Xw/np.inner(AAmat,Xw)
    704704        Pk = -Dk*Qk
    705705        #Step 2 in M&Z paper:
    706         alpSt = -np.dot(Pk,Qk)/np.dot(Pk,np.dot(AAmat,Pk))
     706        alpSt = -np.inner(Pk,Qk)/np.inner(Pk,np.inner(AAmat,Pk))
    707707        alpWv = -Xw/Pk
    708         AkSt = [np.where(Pk[i]<0,np.min((approach*alpWv[i],alpSt)),Pk[i]) for i in range(Pk.shape[0])]
     708        AkSt = [np.where(Pk[i]<0,np.min((approach*alpWv[i],alpSt)),alpSt) for i in range(Pk.shape[0])]
    709709        #Step 3 in M&Z paper:
    710710        shift = AkSt*Pk
    711         print np.sum(shift**2)
    712711        Xw += shift
    713712        #done IPG; now results
     
    717716        err = chisq/len(datum)
    718717        if report:
    719             print ' Iteration: %d, chisq: %.3g'%(nIter,chisq)
     718            print ' Iteration: %d, chisq: %.3g, sum(shift^2): %.3g'%(nIter,chisq,np.sum(shift**2))
    720719    return chisq,Xw,calc
    721720
     
    759758    Scale = Sample['Scale'][0]
    760759    Sky = 10**data['Size']['MaxEnt']['Sky']
    761     BinsBack = np.ones_like(Bins)*Sky*Scale/Contrast #How about *Scale/Contrast?
     760    BinsBack = np.ones_like(Bins)*Sky*Scale/Contrast
    762761    Back = data['Back']
    763762    Q,Io,wt,Ic,Ib = Profile
  • trunk/GSASIIstrIO.py

    r1248 r1253  
    578578            elif SGLaue in ['3R','3mR']:
    579579                isum = ih**2+ik**2+il**2
    580                 jsum = jh**2+jk**2*jl**2
     580                jsum = jh**2+jk**2+jl**2
    581581                isum2 = ih*ik+ih*il+ik*il
    582582                jsum2 = jh*jk+jh*jl+jk*jl
Note: See TracChangeset for help on using the changeset viewer.