Changeset fa5fd8d in sasmodels for sasmodels/models


Ignore:
Timestamp:
Apr 12, 2016 6:02:41 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:
04045f4
Parents:
7ae2b7f
Message:

support number of shells selection in sasview wrapper for onion model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/onion.py

    r2afc26d rfa5fd8d  
    299299              ["sld_solvent", "1e-6/Ang^2", 6.4, [-inf, inf], "", 
    300300               "Solvent scattering length density"], 
    301               ["n", "", 1, [0, 10], "volume", 
     301              ["n_shells", "", 1, [0, 10], "volume", 
    302302               "number of shells"], 
    303               ["sld_in[n]", "1e-6/Ang^2", 1.7, [-inf, inf], "", 
     303              ["sld_in[n_shells]", "1e-6/Ang^2", 1.7, [-inf, inf], "", 
    304304               "scattering length density at the inner radius of shell k"], 
    305               ["sld_out[n]", "1e-6/Ang^2", 2.0, [-inf, inf], "", 
     305              ["sld_out[n_shells]", "1e-6/Ang^2", 2.0, [-inf, inf], "", 
    306306               "scattering length density at the outer radius of shell k"], 
    307               ["thickness[n]", "Ang", 40., [0, inf], "volume", 
     307              ["thickness[n_shells]", "Ang", 40., [0, inf], "volume", 
    308308               "Thickness of shell k"], 
    309               ["A[n]", "", 1.0, [-inf, inf], "", 
     309              ["A[n_shells]", "", 1.0, [-inf, inf], "", 
    310310               "Decay rate of shell k"], 
    311311              ] 
     
    317317 
    318318profile_axes = ['Radius (A)', 'SLD (1e-6/A^2)'] 
    319 def profile(core_sld, core_radius, solvent_sld, n, in_sld, out_sld, thickness, A): 
     319def profile(core_sld, core_radius, solvent_sld, n_shells, 
     320            in_sld, out_sld, thickness, A): 
    320321    """ 
    321     SLD profile 
     322    Returns shape profile with x=radius, y=SLD. 
    322323    """ 
    323324 
    324     total_radius = 1.25*(sum(thickness[:n]) + core_radius + 1) 
     325    total_radius = 1.25*(sum(thickness[:n_shells]) + core_radius + 1) 
    325326    dr = total_radius/400  # 400 points for a smooth plot 
    326327 
     
    335336 
    336337    # add in the shells 
    337     for k in range(n): 
     338    for k in range(n_shells): 
    338339        # Left side of each shells 
    339340        r0 = r[-1] 
     
    362363    beta.append(solvent_sld) 
    363364 
    364     return np.asarray(r), np.asarray(beta) 
     365    return np.asarray(r), np.asarray(beta)*1e-6 
    365366 
    366367def ER(core_radius, n, thickness): 
Note: See TracChangeset for help on using the changeset viewer.