Changeset 1270 for trunk/GSASIIsasd.py


Ignore:
Timestamp:
Apr 5, 2014 10:01:24 AM (8 years ago)
Author:
vondreele
Message:

resolve scaling in SASD modelling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIsasd.py

    r1269 r1270  
    2626import scipy.stats as st
    2727import scipy.optimize as so
     28#import pdb
    2829
    2930import GSASIIpath
     
    931932        'Unified rod':[UniRodFF,UniRodVol],'Unified rod AR':[UniRodARFF,UniRodARVol],
    932933        'Unified disk':[UniDiskFF,UniDiskVol],'Sphere':[SphereFF,SphereVol]}
     934#    pdb.set_trace()
    933935    partData = sasdData['Particle']
    934936    rhoMat = Substances['Substances'][partData['Matrix']['Name']].get('XAnom density',0.0)
     
    959961        contrast = rho**2-rhoMat**2
    960962        parmDict = level[controls['DistType']]
    961         rBins,dist = MakeDiamDist(controls['DistType'],controls['NumPoints'],controls['Cutoff'],parmDict)
    962         Gmat = G_matrix(Q[Ibeg:Ifin],rBins,contrast,FFfxn,Volfxn,FFargs)
     963        rBins,dBins,dist = MakeDiamDist(controls['DistType'],controls['NumPoints'],controls['Cutoff'],parmDict)
     964        Gmat = 2.*G_matrix(Q[Ibeg:Ifin],rBins,contrast,FFfxn,Volfxn,FFargs).T*dBins
    963965        dist *= level[distFxn]['Volume'][0]
    964         Ic[Ibeg:Ifin] += np.dot(Gmat.T,dist)*100.
     966        Ic[Ibeg:Ifin] += np.dot(Gmat,dist)
    965967        Rbins.append(rBins)
    966968        Dist.append(dist)
    967        
    968969    return Rbins,Dist
    969              
    970970   
    971971def MakeDiamDist(DistName,nPoints,cutoff,parmDict):
     
    10121012    Diam = np.logspace(0.,5.,500,True)
    10131013    TCW = eval(cumeFxn+'(Diam,pos,args)')
    1014     CumeTgts = np.linspace(cutoff,(1.-cutoff),nPoints,True)
     1014    CumeTgts = np.linspace(cutoff,(1.-cutoff),nPoints+1,True)
    10151015    rBins = np.interp(CumeTgts,TCW,Diam,0,0)
    1016     return rBins,eval(distFxn+'(rBins,pos,args)')
     1016    dBins = np.diff(rBins)
     1017    rBins = rBins[:-1]+dBins/2.
     1018    return rBins,dBins,eval(distFxn+'(rBins,pos,args)')
    10171019
    10181020################################################################################
Note: See TracChangeset for help on using the changeset viewer.