Changeset 5bfb213 in sasmodels


Ignore:
Timestamp:
Mar 18, 2016 9:55:52 AM (9 years ago)
Author:
richardh
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:
52a3db3
Parents:
6ab4ed8 (diff), 115d0f0 (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 branch 'master' of https://github.com/SasView/sasmodels

Location:
sasmodels/models
Files:
2 added
1 edited
7 moved

Legend:

Unmodified
Added
Removed
  • sasmodels/models/hardsphere.py

    raa2edb2 re98c1e0  
    5858category = "structure-factor" 
    5959structure_factor = True 
     60single = False 
    6061 
    6162#             ["name", "units", default, [lower, upper], "type","description"], 
  • sasmodels/models/lamellar_hg.py

    raa2edb2 r6ab4ed8  
    2626 
    2727where $\delta_T$ is *tail_length*, $\delta_H$ is *head_length*, 
    28 $\Delta\rho_H$ is the head contrast (*head_sld* $-$ *solvent_sld*), 
    29 and $\Delta\rho_T$ is tail contrast (*sld* $-$ *solvent_sld*). 
     28$\Delta\rho_H$ is the head contrast (*sld_head* $-$ *sld_solvent*), 
     29and $\Delta\rho_T$ is tail contrast (*sld* $-$ *sld_solvent*). 
    3030 
    3131The 2D scattering intensity is calculated in the same way as 1D, where 
     
    4949from numpy import inf 
    5050 
    51 name = "lamellar_FFHG" 
    52 title = "Random lamellar phase with Head Groups" 
     51name = "lamellar_hg" 
     52title = "Random lamellar phase with Head and Tail Groups" 
    5353description = """\ 
    54     [Random lamellar phase with Head Groups] 
     54    [Random lamellar phase with Head and Tail Groups] 
    5555        I(q)= 2*pi*P(q)/(2(H+T)*q^(2)), where 
    5656        P(q)= see manual 
    5757        layer thickness =(H+T+T+H) = 2(Head+Tail) 
    5858        sld = Tail scattering length density 
    59         head_sld = Head scattering length density 
    60         solvent_sld = solvent scattering length density 
     59        sld_head = Head scattering length density 
     60        sld_solvent = solvent scattering length density 
    6161        background = incoherent background 
    6262        scale = scale factor 
     
    6666# pylint: disable=bad-whitespace, line-too-long 
    6767#             ["name", "units", default, [lower, upper], "type","description"], 
    68 parameters = [["tail_length", "Ang",       15,   [0, inf],  "volume",  "Tail thickness"], 
    69               ["head_length", "Ang",       10,   [0, inf],  "volume",  "head thickness"], 
     68parameters = [["tail_length", "Ang",       15,   [0, inf],  "volume",  "Tail thickness ( total = H+T+T+H)"], 
     69              ["head_length", "Ang",       10,   [0, inf],  "volume",  "Head thickness"], 
    7070              ["sld",         "1e-6/Ang^2", 0.4, [-inf,inf], "",       "Tail scattering length density"], 
    71               ["head_sld",    "1e-6/Ang^2", 3.0, [-inf,inf], "",       "Head scattering length density"], 
    72               ["solvent_sld", "1e-6/Ang^2", 6,   [-inf,inf], "",       "Solvent scattering length density"]] 
     71              ["sld_head",    "1e-6/Ang^2", 3.0, [-inf,inf], "",       "Head scattering length density"], 
     72              ["sld_solvent", "1e-6/Ang^2", 6,   [-inf,inf], "",       "Solvent scattering length density"]] 
    7373# pylint: enable=bad-whitespace, line-too-long 
    7474 
     
    8181Iq = """ 
    8282    const double qsq = q*q; 
    83     const double drh = head_sld - solvent_sld; 
    84     const double drt = sld - solvent_sld;    //correction 13FEB06 by L.Porcar 
     83    const double drh = sld_head - sld_solvent; 
     84    const double drt = sld - sld_solvent;    //correction 13FEB06 by L.Porcar 
    8585    const double qT = q*tail_length; 
    8686    double Pq, inten; 
     
    106106demo = dict(scale=1, background=0, 
    107107            tail_length=15, head_length=10, 
    108             sld=0.4, head_sld=3.0, solvent_sld=6.0, 
     108            sld=0.4, sld_head=3.0, sld_solvent=6.0, 
    109109            tail_length_pd=0.2, tail_length_pd_n=40, 
    110110            head_length_pd=0.01, head_length_pd_n=40) 
     
    112112oldname = 'LamellarFFHGModel' 
    113113oldpars = dict(head_length='h_thickness', tail_length='t_length', 
    114                sld='sld_tail', head_sld='sld_head', solvent_sld='sld_solvent') 
     114               sld='sld_tail', sld_head='sld_head', sld_solvent='sld_solvent') 
    115115# 
    116116tests = [[{'scale': 1.0, 'background': 0.0, 'tail_length': 15.0, 'head_length': 10.0, 
    117            'sld': 0.4, 'head_sld': 3.0, 'solvent_sld': 6.0}, [0.001], [653143.9209]]] 
     117           'sld': 0.4, 'sld_head': 3.0, 'sld_solvent': 6.0}, [0.001], [653143.9209]]] 
     118# ADDED by: RKH  ON: 18Mar2016  converted from sasview previously, now renaming everything & sorting the docs 
  • sasmodels/models/lamellar_hg_stack_caille.py

    raa2edb2 r6ab4ed8  
    99.. math:: 
    1010 
    11     I(q) = 2 \pi \frac{P(q)S(q)}{\delta q^2} 
     11    I(q) = 2 \pi \frac{P(q)S(q)}{q^2\delta } 
    1212 
    1313 
     
    5656results for the next lower and higher values. 
    5757 
     58Be aware that the computations may be very slow. 
     59 
    5860The 2D scattering intensity is calculated in the same way as 1D, where 
    5961the $q$ vector is defined as 
     
    7375from numpy import inf 
    7476 
    75 name = "lamellarCailleHG" 
    76 title = "Random lamellar sheet with Caille structure factor" 
     77name = "lamellar_hg_stack_caille" 
     78title = "Random lamellar head/tail/tail/head sheet with Caille structure factor" 
    7779description = """\ 
    7880    [Random lamellar phase with Caille  structure factor] 
     
    104106    ["sld", "1e-6/Ang^2", 0.4, [-inf, inf], "", 
    105107     "Tail scattering length density"], 
    106     ["head_sld", "1e-6/Ang^2", 2.0, [-inf, inf], "", 
     108    ["sld_head", "1e-6/Ang^2", 2.0, [-inf, inf], "", 
    107109     "Head scattering length density"], 
    108     ["solvent_sld", "1e-6/Ang^2", 6, [-inf, inf], "", 
     110    ["sld_solvent", "1e-6/Ang^2", 6, [-inf, inf], "", 
    109111     "Solvent scattering length density"], 
    110112    ] 
    111113 
    112 source = ["lamellarCailleHG_kernel.c"] 
     114source = ["lamellar_hg_stack_caille_kernel.c"] 
    113115 
    114116# No volume normalization despite having a volume parameter 
     
    129131    Nlayers=20, spacing=200., Caille_parameter=0.05, 
    130132    tail_length=15, head_length=10, 
    131     #sld=-1, head_sld=4.0, solvent_sld=6.0, 
    132     sld=-1, head_sld=4.1, solvent_sld=6.0, 
     133    #sld=-1, sld_head=4.0, sld_solvent=6.0, 
     134    sld=-1, sld_head=4.1, sld_solvent=6.0, 
    133135    tail_length_pd=0.1, tail_length_pd_n=20, 
    134136    head_length_pd=0.05, head_length_pd_n=30, 
     
    140142oldpars = dict( 
    141143    tail_length='deltaT', head_length='deltaH', Nlayers='n_plates', 
    142     Caille_parameter='caille', sld='sld_tail', head_sld='sld_head', 
    143     solvent_sld='sld_solvent') 
     144    Caille_parameter='caille', sld='sld_tail', sld_head='sld_head', 
     145    sld_solvent='sld_solvent') 
    144146# 
    145147tests = [[{'scale': 1.0, 'background': 0.0, 'tail_length': 10.0, 'head_length': 2.0, 
    146148           'Nlayers': 30.0, 'spacing': 40., 'Caille_parameter': 0.001, 'sld': 0.4, 
    147            'head_sld': 2.0, 'solvent_sld': 6.0, 'tail_length_pd': 0.0, 
     149           'sld_head': 2.0, 'sld_solvent': 6.0, 'tail_length_pd': 0.0, 
    148150           'head_length_pd': 0.0, 'spacing_pd': 0.0}, [0.001], [6838238.571488]]] 
     151# ADDED by: RKH  ON: 18Mar2016  converted from sasview previously, now renaming everything & sorting the docs 
  • sasmodels/models/lamellar_stack_caille.py

    raa2edb2 r6ab4ed8  
    1111.. math:: 
    1212 
    13     I(q) = 2\pi \frac{P(q)S(q)}{\delta q^2} 
     13    I(q) = 2\pi \frac{P(q)S(q)}{q^2\delta } 
    1414 
    1515The form factor is 
     
    7070from numpy import inf 
    7171 
    72 name = "lamellarPS" 
     72name = "lamellar_stack_caille" 
    7373title = "Random lamellar sheet with Caille structure factor" 
    7474description = """\ 
     
    9292    ["Caille_parameter", "1/Ang^2",    0.1, [0.0,0.8],  "",       "Caille parameter"], 
    9393    ["sld",              "1e-6/Ang^2", 6.3, [-inf,inf], "",       "layer scattering length density"], 
    94     ["solvent_sld",      "1e-6/Ang^2", 1.0, [-inf,inf], "",       "Solvent scattering length density"], 
     94    ["sld_solvent",      "1e-6/Ang^2", 1.0, [-inf,inf], "",       "Solvent scattering length density"], 
    9595    ] 
    9696# pylint: enable=bad-whitespace, line-too-long 
    9797 
    98 source = ["lamellarCaille_kernel.c"] 
     98source = ["lamellar_stack_caille_kernel.c"] 
    9999 
    100100# No volume normalization despite having a volume parameter 
     
    113113demo = dict(scale=1, background=0, 
    114114            thickness=67., Nlayers=3.75, spacing=200., 
    115             Caille_parameter=0.268, sld=1.0, solvent_sld=6.34, 
     115            Caille_parameter=0.268, sld=1.0, sld_solvent=6.34, 
    116116            thickness_pd=0.1, thickness_pd_n=100, 
    117117            spacing_pd=0.05, spacing_pd_n=40) 
     
    120120oldpars = dict(thickness='delta', Nlayers='N_plates', 
    121121               Caille_parameter='caille', 
    122                sld='sld_bi', solvent_sld='sld_sol') 
     122               sld='sld_bi', sld_solvent='sld_sol') 
    123123# 
    124124tests = [ 
    125125    [{'scale': 1.0, 'background': 0.0, 'thickness': 30., 'Nlayers': 20.0, 
    126126      'spacing': 400., 'Caille_parameter': 0.1, 'sld': 6.3, 
    127       'solvent_sld': 1.0, 'thickness_pd': 0.0, 'spacing_pd': 0.0}, 
     127      'sld_solvent': 1.0, 'thickness_pd': 0.0, 'spacing_pd': 0.0}, 
    128128     [0.001], [28895.13397]] 
    129129    ] 
     130# ADDED by: RKH  ON: 18Mar2016  converted from sasview previously, now renaming everything & sorting the docs 
  • sasmodels/models/lamellar_stack_paracrystal.py

    raa2edb2 r6ab4ed8  
    1616  *not* the total excluded volume of the paracrystal), 
    1717 
    18 - *sld* $-$ *solvent_sld* is the contrast $\Delta \rho$, 
     18- *sld* $-$ *sld_solvent* is the contrast $\Delta \rho$, 
    1919 
    2020- *thickness* is the layer thickness $t$, 
     
    3636 
    3737The form factor of the bilayer is approximated as the cross section of an 
    38 infinite, planar bilayer of thickness $t$ 
     38infinite, planar bilayer of thickness $t$ (compare the equations for the 
     39lamellar model). 
    3940 
    4041.. math:: 
     
    9495from numpy import inf 
    9596 
    96 name = "lamellarPC" 
     97name = "lamellar_stack_paracrystal" 
    9798title = "Random lamellar sheet with paracrystal structure factor" 
    9899description = """\ 
     
    120121              ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", 
    121122               "layer scattering length density"], 
    122               ["solvent_sld", "1e-6/Ang^2", 6.34, [-inf, inf], "", 
     123              ["sld_solvent", "1e-6/Ang^2", 6.34, [-inf, inf], "", 
    123124               "Solvent scattering length density"], 
    124125             ] 
    125126 
    126127 
    127 source = ["lamellarPC_kernel.c"] 
     128source = ["lamellar_stack_paracrystal_kernel.c"] 
    128129 
    129130form_volume = """ 
     
    140141demo = dict(scale=1, background=0, 
    141142            thickness=33, Nlayers=20, spacing=250, spacing_polydisp=0.2, 
    142             sld=1.0, solvent_sld=6.34, 
     143            sld=1.0, sld_solvent=6.34, 
    143144            thickness_pd=0.2, thickness_pd_n=40) 
    144145 
    145146oldname = 'LamellarPCrystalModel' 
    146147oldpars = dict(spacing_polydisp='pd_spacing', sld='sld_layer', 
    147                solvent_sld='sld_solvent') 
     148               sld_solvent='sld_solvent') 
    148149# 
    149150tests = [ 
    150151        [ {'scale': 1.0, 'background' : 0.0, 'thickness' : 33.,'Nlayers' : 20.0, 'spacing' : 250., 'spacing_polydisp' : 0.2, 
    151             'sld' : 1.0, 'solvent_sld' : 6.34, 
     152            'sld' : 1.0, 'sld_solvent' : 6.34, 
    152153            'thickness_pd' : 0.0, 'thickness_pd_n' : 40 }, [0.001, 0.215268], [21829.3, 0.00487686]] 
    153154        ] 
     155# ADDED by: RKH  ON: 18Mar2016  converted from sasview previously, now renaming everything & sorting the docs 
Note: See TracChangeset for help on using the changeset viewer.