Changeset a807206 in sasmodels for sasmodels/models/pearl_necklace.py


Ignore:
Timestamp:
Sep 30, 2016 10:42:06 PM (8 years ago)
Author:
butler
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:
caddb14, 5031ca3
Parents:
2222134
Message:

updating more parameter names addressing #649

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/pearl_necklace.py

    r42356c8 ra807206  
    4646pearl_necklace model are the following 
    4747 
    48 NB: *number_of_pearls* must be an integer. 
     48NB: *num_pearls* must be an integer. 
    4949 
    5050References 
     
    6868sld_string: the SLD of the strings 
    6969sld_solvent: the SLD of the solvent 
    70 number_of_pearls: number of the pearls 
     70num_pearls: number of the pearls 
    7171radius: the radius of a pearl 
    72 edge_separation: the length of string segment; surface to surface 
    73 string_thickness: thickness (ie, diameter) of the string 
     72edge_sep: the length of string segment; surface to surface 
     73thick_string: thickness (ie, diameter) of the string 
    7474""" 
    7575category = "shape:cylinder" 
     
    7878parameters = [["radius", "Ang", 80.0, [0, inf], "volume", 
    7979               "Mean radius of the chained spheres"], 
    80               ["edge_separation", "Ang", 350.0, [0, inf], "volume", 
     80              ["edge_sep", "Ang", 350.0, [0, inf], "volume", 
    8181               "Mean separation of chained particles"], 
    82               ["string_thickness", "Ang", 2.5, [0, inf], "volume", 
     82              ["thick_string", "Ang", 2.5, [0, inf], "volume", 
    8383               "Thickness of the chain linkage"], 
    84               ["number_of_pearls", "none", 3, [0, inf], "volume", 
     84              ["num_pearls", "none", 3, [0, inf], "volume", 
    8585               "Number of pearls in the necklace (must be integer)"], 
    8686              ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "sld", 
     
    9595single = False  # use double precision unless told otherwise 
    9696 
    97 def volume(radius, edge_separation, string_thickness, number_of_pearls): 
     97def volume(radius, edge_sep, thick_string, num_pearls): 
    9898    """ 
    9999    Calculates the total particle volume of the necklace. 
    100100    Redundant with form_volume. 
    101101    """ 
    102     number_of_strings = number_of_pearls - 1.0 
    103     string_vol = edge_separation * pi * pow((string_thickness / 2.0), 2.0) 
     102    number_of_strings = num_pearls - 1.0 
     103    string_vol = edge_sep * pi * pow((thick_string / 2.0), 2.0) 
    104104    pearl_vol = 4.0 /3.0 * pi * pow(radius, 3.0) 
    105105    total_vol = number_of_strings * string_vol 
    106     total_vol += number_of_pearls * pearl_vol 
     106    total_vol += num_pearls * pearl_vol 
    107107    return total_vol 
    108108 
    109 def ER(radius, edge_separation, string_thickness, number_of_pearls): 
     109def ER(radius, edge_sep, thick_string, num_pearls): 
    110110    """ 
    111111    Calculation for effective radius. 
    112112    """ 
    113     tot_vol = volume(radius, edge_separation, string_thickness, number_of_pearls) 
     113    tot_vol = volume(radius, edge_sep, thick_string, num_pearls) 
    114114    rad_out = pow((3.0*tot_vol/4.0/pi), 0.33333) 
    115115    return rad_out 
    116116 
    117117# parameters for demo 
    118 demo = dict(scale=1, background=0, radius=80.0, edge_separation=350.0, 
    119             number_of_pearls=3, sld=1, sld_solvent=6.3, sld_string=1, 
    120             string_thickness=2.5, 
     118demo = dict(scale=1, background=0, radius=80.0, edge_sep=350.0, 
     119            num_pearls=3, sld=1, sld_solvent=6.3, sld_string=1, 
     120            thick_string=2.5, 
    121121            radius_pd=.2, radius_pd_n=5, 
    122             edge_separation_pd=25.0, edge_separation_pd_n=5, 
    123             number_of_pearls_pd=0, number_of_pearls_pd_n=0, 
    124             string_thickness_pd=0.2, string_thickness_pd_n=5, 
     122            edge_sep_pd=25.0, edge_sep_pd_n=5, 
     123            num_pearls_pd=0, num_pearls_pd_n=0, 
     124            thick_string_pd=0.2, thick_string_pd_n=5, 
    125125           ) 
    126126 
Note: See TracChangeset for help on using the changeset viewer.