Changeset 502c7b8 in sasmodels for explore


Ignore:
Timestamp:
Aug 7, 2018 5:14:59 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
7b0abf8
Parents:
cdd676e (diff), 01c8d9e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'greg/beta_approx' into beta_approx

Location:
explore/beta
Files:
5 added
1 edited

Legend:

Unmodified
Added
Removed
  • explore/beta/sasfit_compare.py

    rcdd676e r502c7b8  
    33import sys, os 
    44BETA_DIR = os.path.dirname(os.path.realpath(__file__)) 
    5 SASMODELS_DIR = os.path.dirname(os.path.dirname(BETA_DIR)) 
     5#SASMODELS_DIR = os.path.dirname(os.path.dirname(BETA_DIR)) 
     6SASMODELS_DIR = r"C:\Source\sasmodels" 
    67sys.path.insert(0, SASMODELS_DIR) 
    78 
     
    6162    calculator = DirectModel(data, model,cutoff=0) 
    6263    calculator.pars = pars.copy() 
    63     calculator.pars.setdefault('background', 1e-3) 
     64    calculator.pars.setdefault('background', 0) 
    6465    return calculator 
    6566 
     
    231232        #     = F2/total_volume 
    232233        IQD = F2/average_volume*1e-4*volfraction 
     234        F1 *= 1e-2  # Yun is using sld in 1/A^2, not 1e-6/A^2 
     235        F2 *= 1e-4 
    233236    elif norm == 'yun': 
    234237        F1 *= 1e-6  # Yun is using sld in 1/A^2, not 1e-6/A^2 
     
    336339    I = build_model(Pname+"@hardsphere", q) 
    337340    Pq = P(**Ppars)*pars.get('volfraction', 1) 
    338     #Sq = S(**Spars) 
     341    Sq = S(**Spars) 
    339342    Iq = I(**Ipars) 
    340343    #Iq = Pq*Sq*pars.get('volfraction', 1) 
    341     Sq = Iq/Pq 
    342     return Theory(Q=q, F1=None, F2=None, P=Pq, S=Sq, I=Iq, Seff=None, Ibeta=None) 
     344    #Sq = Iq/Pq 
     345    #Iq = None#= Sq = None 
     346    r=I._kernel.results 
     347    return Theory(Q=q, F1=None, F2=None, P=Pq, S=None, I=None, Seff=r[1], Ibeta=Iq) 
    343348 
    344349def compare(title, target, actual, fields='F1 F2 P S I Seff Ibeta'): 
     
    400405        radius_equatorial_pd=.1, radius_equatorial_pd_type=pd_type, 
    401406        volfraction=0.15, 
     407        radius_effective=270.7543927018, 
    402408        #radius_effective=12.59921049894873, 
    403409        ) 
    404     target = sasmodels_theory(q, model, **pars) 
     410    target = sasmodels_theory(q, model, beta_mode=1, **pars) 
    405411    actual = ellipsoid_pe(q, norm='sasview', **pars) 
    406412    title = " ".join(("sasmodels", model, pd_type)) 
     
    450456    S = data[5] 
    451457    Seff = data[6] 
    452     target = Theory(Q=Q, F1=F1, F2=F2, P=P, S=S, Seff=Seff) 
     458    target = Theory(Q=Q, F1=F1, P=P, S=S, Seff=Seff) 
    453459    actual = sphere_r(Q, norm='yun', **pars) 
    454460    title = " ".join(("yun", "sphere", "10% dispersion 10% Vf")) 
     
    462468    S = data[5] 
    463469    Seff = data[6] 
    464     target = Theory(Q=Q, F1=F1, F2=F2, P=P, S=S, Seff=Seff) 
     470    target = Theory(Q=Q, F1=F1, P=P, S=S, Seff=Seff) 
    465471    actual = sphere_r(Q, norm='yun', **pars) 
    466472    title = " ".join(("yun", "sphere", "15% dispersion 10% Vf")) 
Note: See TracChangeset for help on using the changeset viewer.