Changeset 4095 for trunk/GSASIIsasd.py


Ignore:
Timestamp:
Aug 16, 2019 10:58:08 AM (2 years ago)
Author:
vondreele
Message:

improve dmax estimation - use proper selected weights
ditto P(R) calculation
remove Seq fit from all but particle fits - not appropriate for rest.
Add option for bead separation in SHAPES results - improves appearance in small proteins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIsasd.py

    r4094 r4095  
    750750                z = a[i][j] - z
    751751                if j == i:
    752                     y = math.sqrt(z)
     752                    y = math.sqrt(max(0.,z))
    753753                else:
    754754                    y = z / fl[j][j]
     
    11291129            N += 1
    11301130        MPV = np.ones(N)*1.e-5
    1131 #        MPV[0] = Q[Ibeg]
    11321131        dmax = pairData['MaxRadius']
     1132        if 'User' in pairData['Errors']:
     1133            Wt = wt[Ibeg:Ifin]
     1134        elif 'Sqrt' in pairData['Errors']:
     1135            Wt = 1./Io[Ibeg:Ifin]
     1136        elif 'Percent' in pairData['Errors']:
     1137            Wt = 1./(pairData['Percent error']*Io[Ibeg:Ifin])
    11331138        result = so.leastsq(calcSASD,MPV,full_output=True,epsfcn=1.e-8,   #ftol=Ftol,
    1134             args=(Q[Ibeg:Ifin],Io[Ibeg:Ifin],wtFactor*wt[Ibeg:Ifin],Ifb[Ibeg:Ifin],dmax,ifBack))
     1139            args=(Q[Ibeg:Ifin],Io[Ibeg:Ifin],wtFactor*Wt,Ifb[Ibeg:Ifin],dmax,ifBack))
    11351140        if ifBack:
    11361141            MPVR = result[0][:-1]
     
    14411446    Ifin = np.searchsorted(Q,Qmax)+1    #include last point
    14421447    Ic[:] = 0
     1448    pairData = Model['Pair']
     1449    if 'User' in pairData['Errors']:
     1450        Wt = wt[Ibeg:Ifin]
     1451    elif 'Sqrt' in pairData['Errors']:
     1452        Wt = 1./Io[Ibeg:Ifin]
     1453    elif 'Percent' in pairData['Errors']:
     1454        Wt = 1./(pairData['Percent error']*Io[Ibeg:Ifin])
    14431455    parmDict,varyList,values = GetModelParms()
    14441456    result = so.leastsq(calcSASD,values,full_output=True,epsfcn=1.e-12,factor=0.1,  #ftol=Ftol,
    1445         args=(Q[Ibeg:Ifin],Io[Ibeg:Ifin],wtFactor*wt[Ibeg:Ifin],Ifb[Ibeg:Ifin],parmDict,varyList))
     1457        args=(Q[Ibeg:Ifin],Io[Ibeg:Ifin],wtFactor*Wt,Ifb[Ibeg:Ifin],parmDict,varyList))
    14461458    parmDict.update(dict(zip(varyList,result[0])))
    14471459    chisq = np.sum(result[2]['fvec']**2)
Note: See TracChangeset for help on using the changeset viewer.