Changeset e262dd6 in sasmodels


Ignore:
Timestamp:
Jul 6, 2018 10:49:00 AM (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:
9f2216f
Parents:
0076d6e
Message:

futher cleanup; include Yun's hardsphere and sphere models from matlab

Location:
explore/beta
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • explore/beta/sasfit_compare.py

    r0076d6e re262dd6  
    222222    if radius_effective is None: 
    223223        radius_effective = radius_eff/total_weight 
    224     SQ = hardsphere_simple(q, radius_effective, volfraction) 
    225224    if norm == 'sasfit': 
    226         beta = F1**2/F2 
    227         SQ_EFF = 1 + beta*(SQ - 1) 
    228225        IQD = F2 
    229         IQSD = IQD*SQ 
    230         IQBD = IQD*SQ_EFF 
    231226    elif norm == 'sasview': 
    232         SQ_EFF = None 
    233227        # Note: internally, sasview uses F2/total_volume because: 
    234228        #   average_volume = total_volume/total_weight 
     
    237231        #     = F2/total_volume 
    238232        IQD = F2/average_volume*1e-4*volfraction 
    239         IQSD = IQD*SQ 
    240         IQBD = None 
    241233    elif norm == 'yun': 
    242         #F1 /= average_volume 
    243         #F2 /= average_volume**2 
    244234        F1 *= 1e-6  # Yun is using sld in 1/A^2, not 1e-6/A^2 
    245235        F2 *= 1e-12 
    246         beta = F1**2/F2 
    247         SQ_EFF = 1 + beta*(SQ - 1) 
    248236        IQD = F2/average_volume*1e8*volfraction 
    249         IQSD = IQD*SQ 
    250         IQBD = IQD*SQ_EFF 
     237    SQ = hardsphere_simple(q, radius_effective, volfraction) 
     238    beta = F1**2/F2 
     239    SQ_EFF = 1 + beta*(SQ - 1) 
     240    IQSD = IQD*SQ 
     241    IQBD = IQD*SQ_EFF 
    251242    return Theory(Q=q, F1=F1, F2=F2, P=IQD, S=SQ, I=IQSD, Seff=SQ_EFF, Ibeta=IQBD) 
    252243 
     
    279270    if radius_effective is None: 
    280271        radius_effective = radius 
    281     SQ = hardsphere_simple(q, radius_effective, volfraction) 
    282     volume = 4./3.*pi*radius**3 
    283272    average_volume = total_volume/total_weight 
    284273    if norm == 'sasfit': 
    285         beta = F1**2/F2 
    286         SQ_EFF = 1 + beta*(SQ - 1) 
    287274        IQD = F2 
    288         IQSD = IQD*SQ 
    289         IQBD = IQD*SQ_EFF 
    290275    elif norm == 'sasview': 
    291         SQ_EFF = None 
    292276        IQD = F2/average_volume*1e-4*volfraction 
    293         IQSD = IQD*SQ 
    294         IQBD = None 
    295277    elif norm == 'yun': 
    296         # Note: yun uses gauss limits from R0/10 to R0 + 5 sigma steps sigma/100 
    297         # With pd = 0.1, that's 14 sigma, or 1400 points. 
    298278        F1 *= 1e-6  # Yun is using sld in 1/A^2, not 1e-6/A^2 
    299279        F2 *= 1e-12 
    300         beta = F1**2/F2 
    301         SQ_EFF = 1 + beta*(SQ - 1) 
    302280        IQD = F2/average_volume*1e8*volfraction 
    303         IQSD = IQD*SQ 
    304         IQBD = IQD*SQ_EFF 
     281    SQ = hardsphere_simple(q, radius_effective, volfraction) 
     282    beta = F1**2/F2 
     283    SQ_EFF = 1 + beta*(SQ - 1) 
     284    IQSD = IQD*SQ 
     285    IQBD = IQD*SQ_EFF 
    305286    return Theory(Q=q, F1=F1, F2=F2, P=IQD, S=SQ, I=IQSD, Seff=SQ_EFF, Ibeta=IQBD) 
    306287 
     
    454435 
    455436def compare_yun_sphere_gauss(): 
     437    # Note: yun uses gauss limits from R0/10 to R0 + 5 sigma steps sigma/100 
     438    # With pd = 0.1, that's 14 sigma and 1400 points. 
    456439    pars = { 
    457440        'radius': 20, 'radius_pd': 0.1, 'radius_pd_type': 'gaussian', 
Note: See TracChangeset for help on using the changeset viewer.