Changeset 1248 for trunk/GSASIIsasd.py


Ignore:
Timestamp:
Mar 13, 2014 2:16:20 PM (8 years ago)
Author:
vondreele
Message:

add setscale for SASD data
don't square the 1/cos(2-theta) correction to integrated intensities in ImageIntegrate?
scale SASD error bars by Scale
replace ':' with ';' in BkPk? parameter names
fix bug of missing Residuals in LS Refine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIsasd.py

    r1246 r1248  
    689689if __name__ == '__main__':
    690690    tests()
     691   
     692###############################################################################
     693#### SASD Utilities
     694###############################################################################
     695
     696def SetScale(Data,refData):
     697    Profile,Limits,Sample = Data
     698    refProfile,refLimits,refSample = refData
     699    x,y = Profile[:2]
     700    rx,ry = refProfile[:2]
     701    Beg = np.max([rx[0],x[0],Limits[1][0],refLimits[1][0]])
     702    Fin = np.min([rx[-1],x[-1],Limits[1][1],refLimits[1][1]])
     703    iBeg = np.searchsorted(x,Beg)
     704    iFin = np.searchsorted(x,Fin)
     705    sum = np.sum(y[iBeg:iFin])
     706    refsum = np.sum(np.interp(x[iBeg:iFin],rx,ry,0,0))
     707    Sample['Scale'][0] = refSample['Scale'][0]*refsum/sum
    691708   
    692709###############################################################################
     
    722739        Ic[Ibeg:Ifin] = Back[0]
    723740    Gmat = G_matrix(Q[Ibeg:Ifin],Bins,Contrast,shapes[Shape][0],shapes[Shape][1],args=Parms)
    724     chisq,BinMag,Ic[Ibeg:Ifin] = MaxEnt_SB(Io[Ibeg:Ifin]-Back[0],1./np.sqrt(wtFactor*wt[Ibeg:Ifin]),BinsBack,
     741    chisq,BinMag,Ic[Ibeg:Ifin] = MaxEnt_SB(Sample['Scale'][0]*Io[Ibeg:Ifin]-Back[0],
     742        Sample['Scale'][0]/np.sqrt(wtFactor*wt[Ibeg:Ifin]),BinsBack,
    725743        data['Size']['MaxEnt']['Niter'],Gmat,report=True)
    726744    print ' Final chi^2: %.3f'%(chisq)
Note: See TracChangeset for help on using the changeset viewer.