Changeset 6f0e04f in sasmodels for sasmodels/models/core_multi_shell.py


Ignore:
Timestamp:
Mar 30, 2016 5:14:38 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
204fd9b
Parents:
b7172bb
Message:

allow core multi shell and spherical sld to pass tests even though they are not finished

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_multi_shell.py

    rb274bec r6f0e04f  
    8989parameters = [["volfraction", "", 0.05, [0,1],"", 
    9090               "volume fraction of spheres"], 
    91               ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", 
     91              ["sld_core", "1e-6/Ang^2", 1.0, [-inf, inf], "", 
    9292               "Core scattering length density"], 
    93               ["radius", "Ang", 200., [0, inf], "", 
     93              ["radius", "Ang", 200., [0, inf], "volume", 
    9494               "Radius of the core"], 
    9595              ["sld_solvent", "1e-6/Ang^2", 6.4, [-inf, inf], "", 
     
    9797              ["n", "", 1, [0, 10], "volume", 
    9898               "number of shells"], 
    99               ["sld_shell[n]", "1e-6/Ang^2", 1.7, [-inf, inf], "", 
     99              ["sld[n]", "1e-6/Ang^2", 1.7, [-inf, inf], "", 
    100100               "scattering length density of shell k"], 
    101               ["thick_shell[n]", "Ang", 40., [0, inf], "volume", 
     101              ["thickness[n]", "Ang", 40., [0, inf], "volume", 
    102102               "Thickness of shell k"], 
    103103              ] 
     
    112112 
    113113 
    114 def shape(core_sld, core_radius, solvent_sld, n, in_sld, out_sld, thickness, A): 
     114def profile(volfraction, sld_core, radius, sld_solvent, n, sld, thickness): 
    115115    """ 
    116116    SLD profile 
     
    153153# cut an the onion.  Seems like we should be consistant? 
    154154 
    155     total_radius = 1.25*(sum(thickness[:n]) + core_radius + 1) 
    156     dr = total_radius/400  # 400 points for a smooth plot 
     155    total_radius = 1.25*(sum(thickness[:n]) + radius + 1) 
    157156 
    158157    r = [] 
     
    170169        r0 = r[-1] 
    171170        r.append(r0) 
    172         beta.append(sld_shell[k]) 
     171        beta.append(sld[k]) 
    173172        r.append(r0 + thickness[k]) 
    174         beta.append(sld_shell[k]) 
     173        beta.append(sld[k]) 
    175174   # add in the solvent 
    176175    r.append(r[-1]) 
    177     beta.append(solvent_sld) 
     176    beta.append(sld_solvent) 
    178177    r.append(total_radius) 
    179     beta.append(solvent_sld) 
     178    beta.append(sld_solvent) 
    180179 
    181180    return np.asarray(r), np.asarray(beta) 
    182181 
    183 def ER(radius, n, thick_shell): 
    184     return np.sum(thick_shell[:n], axis=0) + core_radius 
     182def ER(radius, n, thickness): 
     183    n = n[0]  # n cannot be polydisperse 
     184    return np.sum(thickness[:n], axis=0) + radius 
    185185 
    186186def VR(radius, n, thick_shell): 
    187     return 1.0 
    188  
    189 parameters = [["volfraction", "", 0.05, [0,1],"", 
    190                "volume fraction of spheres"], 
    191               ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", 
    192                "Core scattering length density"], 
    193               ["radius", "Ang", 200., [0, inf], "", 
    194                "Radius of the core"], 
    195               ["sld_solvent", "1e-6/Ang^2", 6.4, [-inf, inf], "", 
    196                "Solvent scattering length density"], 
    197               ["n", "", 1, [0, 10], "volume", 
    198                "number of shells"], 
    199               ["sld_shell[n]", "1e-6/Ang^2", 1.7, [-inf, inf], "", 
    200                "scattering length density of shell k"], 
    201               ["thick_shell[n]", "Ang", 40., [0, inf], "volume", 
    202                "Thickness of shell k"], 
    203                ] 
     187    return 1.0, 1.0 
    204188 
    205189demo = dict(volfraction = 1.0, 
Note: See TracChangeset for help on using the changeset viewer.