Changeset 325e89a in sasmodels


Ignore:
Timestamp:
Mar 18, 2016 6:26:11 AM (8 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:
3a45c2c
Parents:
29172aa (diff), a146eaa (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

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • example/sesansfit.py

    r5bb9c79 ra06430c  
    11from bumps.names import * 
    2 from sas import core, bumps_model, sesans 
     2from sasmodels import core, bumps_model, sesans 
    33 
    44HAS_CONVERTER = True 
     
    3030        data = loader.load(file) 
    3131        if data is None: raise IOError("Could not load file %r"%(file)) 
     32        data.needs_all_q = acceptance_angle is not None 
    3233        if HAS_CONVERTER == True: 
    3334            default_unit = "A" 
  • sasmodels/convert.py

    r78d3341 r74f7238  
    1515    'be_polyelectrolyte', 
    1616    'correlation_length', 
    17     'fractal_core_shell' 
     17    'fractal_core_shell', 
    1818    'binary_hard_sphere', 
    1919] 
  • sasmodels/resolution.py

    r17bbadd ra146eaa  
    197197 
    198198 
    199     **Algorithm** 
     199    Definition 
     200    ---------- 
    200201 
    201202    We are using the mid-point integration rule to assign weights to each 
     
    441442    .. math:: 
    442443 
    443         n_\text{extend} = (n-1) (\log q_\text{max} - \log q_n) 
     444         n_\text{extend} = (n-1) (\log q_\text{max} - \log q_n) 
    444445            / (\log q_n - log q_1) 
    445446    """ 
  • sasmodels/sesans.py

    r251b40b ra06430c  
    2323    return np.arange(q_min, q_max, dq) 
    2424     
    25 def make_allq(data): 
     25def make_all_q(data): 
    2626    if not data.needs_all_q: 
    2727        return [] 
  • setup.py

    r3eb3312 rf903f0a  
    33packages = find_packages(exclude=['contrib', 'docs', 'tests*']) 
    44package_data = { 
    5     'sasmodels.models': ['*.c'], 
     5    'sasmodels.models': ['*.c','lib/*.c'], 
     6    'sasmodels': ['*.c'], 
    67} 
    78required = [] 
  • sasmodels/models/core_shell_ellipsoid.c

    re7678b2 r29172aa  
    88          double equat_shell, 
    99          double polar_shell, 
    10           double core_sld, 
    11           double shell_sld, 
    12           double solvent_sld); 
     10          double sld_core, 
     11          double sld_shell, 
     12          double sld_solvent); 
    1313 
    1414 
     
    1818          double equat_shell, 
    1919          double polar_shell, 
    20           double core_sld, 
    21           double shell_sld, 
    22           double solvent_sld, 
     20          double sld_core, 
     21          double sld_shell, 
     22          double sld_solvent, 
    2323          double theta, 
    2424          double phi); 
     
    4040          double equat_shell, 
    4141          double polar_shell, 
    42           double core_sld, 
    43           double shell_sld, 
    44           double solvent_sld) 
     42          double sld_core, 
     43          double sld_shell, 
     44          double sld_solvent) 
    4545{ 
    4646 
     
    5151    double summ = 0.0;   //initialize intergral 
    5252 
    53     const double delpc = core_sld - shell_sld;    //core - shell 
    54     const double delps = shell_sld - solvent_sld; //shell - solvent 
     53    const double delpc = sld_core - sld_shell;    //core - shell 
     54    const double delps = sld_shell - sld_solvent; //shell - solvent 
    5555 
    5656    for(int i=0;i<N_POINTS_76;i++) { 
     
    8181          double equat_shell, 
    8282          double polar_shell, 
    83           double core_sld, 
    84           double shell_sld, 
    85           double solvent_sld, 
     83          double sld_core, 
     84          double sld_shell, 
     85          double sld_solvent, 
    8686          double theta, 
    8787          double phi) 
     
    9696    const double cyl_y = sin(theta); 
    9797 
    98     const double sldcs = core_sld - shell_sld; 
    99     const double sldss = shell_sld- solvent_sld; 
     98    const double sldcs = sld_core - sld_shell; 
     99    const double sldss = sld_shell- sld_solvent; 
    100100 
    101101    // Compute the angle btw vector q and the 
     
    124124          double equat_shell, 
    125125          double polar_shell, 
    126           double core_sld, 
    127           double shell_sld, 
    128           double solvent_sld) 
     126          double sld_core, 
     127          double sld_shell, 
     128          double sld_solvent) 
    129129{ 
    130130    double intensity = core_shell_ellipsoid_kernel(q, 
     
    133133           equat_shell, 
    134134           polar_shell, 
    135            core_sld, 
    136            shell_sld, 
    137            solvent_sld); 
     135           sld_core, 
     136           sld_shell, 
     137           sld_solvent); 
    138138 
    139139    return intensity; 
     
    146146          double equat_shell, 
    147147          double polar_shell, 
    148           double core_sld, 
    149           double shell_sld, 
    150           double solvent_sld, 
     148          double sld_core, 
     149          double sld_shell, 
     150          double sld_solvent, 
    151151          double theta, 
    152152          double phi) 
     
    159159                       equat_shell, 
    160160                       polar_shell, 
    161                        core_sld, 
    162                        shell_sld, 
    163                        solvent_sld, 
     161                       sld_core, 
     162                       sld_shell, 
     163                       sld_solvent, 
    164164                       theta, 
    165165                       phi); 
  • sasmodels/models/core_shell_ellipsoid.py

    r5111921 r29172aa  
    11r""" 
    22This model provides the form factor, $P(q)$, for a core shell ellipsoid (below) 
    3 where the form factor is normalized by the volume of the cylinder. 
     3where the form factor is normalized by the volume of the outer [CHECK]. 
    44 
    55.. math:: 
     
    77    P(q) = scale * \left<f^2\right>/V + background 
    88 
    9 where the volume $V = (4/3)\pi(r_{maj}r_{min}^2)$ and the averaging $< >$ is 
     9where the volume $V = (4/3)\pi(R_{major\_outer}R_{minor\_outer}^2)$ and the averaging $< >$ is 
    1010applied over all orientations for 1D. 
    1111 
     
    2222 
    2323    P(q) = \frac{scale}{V}\int_0^1 
    24         \left|F(q,r_{min},r_{max},\alpha)\right|^2d\alpha + background 
     24        \left|F(q,r_{minor\_core},r_{major\_core},\alpha) + F(q,r_{major\_outer},r_{major\_outer},\alpha)\right|^2d\alpha + background 
    2525 
    26     \left|F(q,r_{min},r_{max},\alpha)\right|=V\Delta \rho \cdot (3j_1(u)/u) 
     26    \left|F(q,r_{minor},r_{major},\alpha)\right|=(4\pi/3)r_{major}r_{minor}^2 \Delta \rho \cdot (3j_1(u)/u) 
    2727 
    28     u = q\left[ r_{maj}^2\alpha ^2 + r_{min}^2(1-\alpha ^2)\right]^{1/2} 
     28    u = q\left[ r_{major}^2\alpha ^2 + r_{minor}^2(1-\alpha ^2)\right]^{1/2} 
    2929 
    3030where 
     
    4343polar core radius, *equat_shell* = $r_{min}$ (or equatorial outer radius), 
    4444and *polar_shell* = $r_{maj}$ (or polar outer radius). 
     45 
     46Note:It is the users' responsibility to ensure that shell radii are larger than  
     47the core radii, especially if both are polydisperse, in which case the 
     48core_shell_ellipsoid_xt model may be much better. 
     49 
    4550 
    4651.. note:: 
     
    7782    single particle scattering amplitude. 
    7883    [Parameters]: 
    79     equat_core = equatorial radius of core, 
    80     polar_core = polar radius of core, 
    81     equat_shell = equatorial radius of shell, 
    82     polar_shell = polar radius (revolution axis) of shell, 
    83     core_sld = SLD_core 
    84     shell_sld = SLD_shell 
    85     solvent_sld = SLD_solvent 
     84    equat_core = equatorial radius of core, Rminor_core, 
     85    polar_core = polar radius of core, Rmajor_core, 
     86    equat_shell = equatorial radius of shell, Rminor_outer, 
     87    polar_shell = polar radius of shell, Rmajor_outer, 
     88    sld_core = scattering length density of core, 
     89    sld_shell = scattering length density of shell, 
     90    sld_solvent = scattering length density of solvent, 
    8691    background = Incoherent bkg 
    8792    scale =scale 
    8893    Note:It is the users' responsibility to ensure 
    89     that shell radii are larger than core radii. 
     94    that shell radii are larger than core radii, 
     95    especially if both are polydisperse. 
    9096    oblate: polar radius < equatorial radius 
    9197    prolate :  polar radius > equatorial radius 
     
    97103#             ["name", "units", default, [lower, upper], "type", "description"], 
    98104parameters = [ 
    99     ["equat_core",  "Ang",      200,   [0, inf],    "volume",      "Equatorial radius of core"], 
    100     ["polar_core",  "Ang",       10,   [0, inf],    "volume",      "Polar radius of core"], 
    101     ["equat_shell", "Ang",      250,   [0, inf],    "volume",      "Equatorial radius of shell"], 
    102     ["polar_shell", "Ang",       30,   [0, inf],    "volume",      "Polar radius of shell"], 
    103     ["core_sld",    "1e-6/Ang^2", 2,   [-inf, inf], "",            "Core scattering length density"], 
    104     ["shell_sld",   "1e-6/Ang^2", 1,   [-inf, inf], "",            "Shell scattering length density"], 
    105     ["solvent_sld", "1e-6/Ang^2", 6.3, [-inf, inf], "",            "Solvent scattering length density"], 
     105    ["equat_core",  "Ang",      200,   [0, inf],    "volume",      "Equatorial radius of core, Rminor_core "], 
     106    ["polar_core",  "Ang",       10,   [0, inf],    "volume",      "Polar radius of core, Rmajor_core"], 
     107    ["equat_shell", "Ang",      250,   [0, inf],    "volume",      "Equatorial radius of shell, Rminor_outer "], 
     108    ["polar_shell", "Ang",       30,   [0, inf],    "volume",      "Polar radius of shell, Rmajor_outer"], 
     109    ["sld_core",    "1e-6/Ang^2", 2,   [-inf, inf], "sld",            "Core scattering length density"], 
     110    ["sld_shell",   "1e-6/Ang^2", 1,   [-inf, inf], "sld",            "Shell scattering length density"], 
     111    ["sld_solvent", "1e-6/Ang^2", 6.3, [-inf, inf], "sld",            "Solvent scattering length density"], 
    106112    ["theta",       "degrees",    0,   [-inf, inf], "orientation", "Oblate orientation wrt incoming beam"], 
    107113    ["phi",         "degrees",    0,   [-inf, inf], "orientation", "Oblate orientation in the plane of the detector"], 
     
    116122            equat_shell=250.0, 
    117123            polar_shell=30.0, 
    118             core_sld=2.0, 
    119             shell_sld=1.0, 
    120             solvent_sld=6.3, 
     124            sld_core=2.0, 
     125            sld_shell=1.0, 
     126            sld_solvent=6.3, 
    121127            theta=0, 
    122128            phi=0) 
     
    124130oldname = 'CoreShellEllipsoidModel' 
    125131 
    126 oldpars = dict(core_sld='sld_core', 
    127                shell_sld='sld_shell', 
    128                solvent_sld='sld_solvent', 
     132oldpars = dict(equat_core='equat_core',polar_core='polar_core',equat_shell='equat_shell',polar_shell='polar_shell', 
     133               sld_core='sld_core', 
     134               sld_shell='sld_shell', 
     135               sld_solvent='sld_solvent', 
    129136               theta='axis_theta', 
    130137               phi='axis_phi') 
     
    141148      'equat_shell': 250.0, 
    142149      'polar_shell': 30.0, 
    143       'core_sld': 2.0, 
    144       'shell_sld': 1.0, 
    145       'solvent_sld': 6.3, 
     150      'sld_core': 2.0, 
     151      'sld_shell': 1.0, 
     152      'sld_solvent': 6.3, 
    146153      'background': 0.001, 
    147154      'scale': 1.0, 
     
    155162      'equat_shell': 54.0, 
    156163      'polar_shell': 3.0, 
    157       'core_sld': 20.0, 
    158       'shell_sld': 10.0, 
    159       'solvent_sld': 6.0, 
     164      'sld_core': 20.0, 
     165      'sld_shell': 10.0, 
     166      'sld_solvent': 6.0, 
    160167      'background': 0.0, 
    161168      'scale': 1.0, 
     
    168175      'equat_shell': 54.0, 
    169176      'polar_shell': 3.0, 
    170       'core_sld': 20.0, 
    171       'shell_sld': 10.0, 
    172       'solvent_sld': 6.0, 
     177      'sld_core': 20.0, 
     178      'sld_shell': 10.0, 
     179      'sld_solvent': 6.0, 
    173180      'background': 0.01, 
    174181      'scale': 0.01, 
  • sasmodels/models/core_shell_ellipsoid_xt.py

    r5111921 r29172aa  
    11r""" 
    2 An alternative version of $P(q)$ for the core-shell ellipsoid 
    3 (see CoreShellEllipsoidModel), having as parameters the core axial ratio X 
    4 and a shell thickness, which are more often what we would like to determine. 
     2An alternative version of $P(q)$ for the core_shell_ellipsoid 
     3having as parameters the core axial ratio X and a shell thickness,  
     4which are more often what we would like to determine. 
    55 
    66This model is also better behaved when polydispersity is applied than the four 
    7 independent radii in CoreShellEllipsoidModel. 
     7independent radii in core_shell_ellipsoid model. 
    88 
    99Definition 
     
    5252---------- 
    5353 
    54 R K Heenan, *Private communication* 
     54R K Heenan, 2015, reparametrised the core_shell_ellipsoid model 
    5555 
    5656""" 
     
    6969        [Parameters]: 
    7070        equat_core = equatorial radius of core, 
    71         x_core = polar radius of core, 
     71        x_core = ratio of core polar/equatorial radii, 
    7272        t_shell = equatorial radius of outer surface, 
    73         x_polar_shell = polar radius (revolution axis) of outer surface 
    74         core_sld = SLD_core 
    75         shell_sld = SLD_shell 
    76         solvent_sld = SLD_solvent 
     73        x_polar_shell = ratio of polar shell thickness to equatorial shell thickness, 
     74        sld_core = SLD_core 
     75        sld_shell = SLD_shell 
     76        sld_solvent = SLD_solvent 
    7777        background = Incoherent bkg 
    7878        scale =scale 
     
    9292    ["t_shell",       "Ang",       30,   [0, inf],    "volume",      "Equatorial radius of shell"], 
    9393    ["x_polar_shell", "",           1,   [0, inf],    "volume",      "Polar radius of shell"], 
    94     ["core_sld",      "1e-6/Ang^2", 2,   [-inf, inf], "",            "Core scattering length density"], 
    95     ["shell_sld",     "1e-6/Ang^2", 1,   [-inf, inf], "",            "Shell scattering length density"], 
    96     ["solvent_sld",   "1e-6/Ang^2", 6.3, [-inf, inf], "",            "Solvent scattering length density"], 
     94    ["sld_core",      "1e-6/Ang^2", 2,   [-inf, inf], "",            "Core scattering length density"], 
     95    ["sld_shell",     "1e-6/Ang^2", 1,   [-inf, inf], "",            "Shell scattering length density"], 
     96    ["sld_solvent",   "1e-6/Ang^2", 6.3, [-inf, inf], "",            "Solvent scattering length density"], 
    9797    ["theta",         "degrees",    0,   [-inf, inf], "orientation", "Oblate orientation wrt incoming beam"], 
    9898    ["phi",           "degrees",    0,   [-inf, inf], "orientation", "Oblate orientation in the plane of the detector"], 
     
    108108            t_shell=30.0, 
    109109            x_polar_shell=1.0, 
    110             core_sld=2.0, 
    111             shell_sld=1.0, 
    112             solvent_sld=6.3, 
     110            sld_core=2.0, 
     111            sld_shell=1.0, 
     112            sld_solvent=6.3, 
    113113            theta=0, 
    114114            phi=0) 
     
    119119               x_core='X_core', 
    120120               t_shell='T_shell', 
    121                core_sld='sld_core', 
    122                shell_sld='sld_shell', 
    123                solvent_sld='sld_solvent', 
     121               sld_core='sld_core', 
     122               sld_shell='sld_shell', 
     123               sld_solvent='sld_solvent', 
    124124               theta='axis_theta', 
    125125               phi='axis_phi') 
     
    136136      't_shell': 50.0, 
    137137      'x_polar_shell': 0.2, 
    138       'core_sld': 2.0, 
    139       'shell_sld': 1.0, 
    140       'solvent_sld': 6.3, 
     138      'sld_core': 2.0, 
     139      'sld_shell': 1.0, 
     140      'sld_solvent': 6.3, 
    141141      'background': 0.001, 
    142142      'scale': 1.0, 
     
    150150      't_shell': 54.0, 
    151151      'x_polar_shell': 3.0, 
    152       'core_sld': 20.0, 
    153       'shell_sld': 10.0, 
    154       'solvent_sld': 6.0, 
     152      'sld_core': 20.0, 
     153      'sld_shell': 10.0, 
     154      'sld_solvent': 6.0, 
    155155      'background': 0.0, 
    156156      'scale': 1.0, 
     
    163163      't_shell': 54.0, 
    164164      'x_polar_shell': 3.0, 
    165       'core_sld': 20.0, 
    166       'shell_sld': 10.0, 
    167       'solvent_sld': 6.0, 
     165      'sld_core': 20.0, 
     166      'sld_shell': 10.0, 
     167      'sld_solvent': 6.0, 
    168168      'background': 0.01, 
    169169      'scale': 0.01, 
Note: See TracChangeset for help on using the changeset viewer.