Changeset 40a87fa in sasmodels for sasmodels/models/core_multi_shell.py


Ignore:
Timestamp:
Aug 8, 2016 9:24:11 AM (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:
2472141
Parents:
2d65d51
Message:

lint and latex cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_multi_shell.py

    re187b25 r40a87fa  
    44 
    55This model is a trivial extension of the CoreShell function to a larger number 
    6 of shells. The scattering length density profile for the default sld values  
     6of shells. The scattering length density profile for the default sld values 
    77(w/ 4 shells). 
    88 
     
    2525          effective radius for $S(Q)$ when $P(Q)*S(Q)$ is applied. 
    2626 
    27 For information about polarised and magnetic scattering, see  
     27For information about polarised and magnetic scattering, see 
    2828the :doc:`magnetic help <../sasgui/perspectives/fitting/mag_help>` documentation. 
    2929 
     
    3333References 
    3434---------- 
    35 See the :ref:`core_shell_sphere <core_shell_sphere>` model documentation. 
     35See the :ref:`core-shell-sphere` model documentation. 
    3636 
    3737L A Feigin and D I Svergun, 
     
    5151 
    5252import numpy as np 
    53 from numpy import inf, nan 
    54 from math import fabs, exp, expm1 
     53from numpy import inf 
    5554 
    5655name = "core_multi_shell" 
     
    9998              ["thickness[n]", "Ang", 40., [0, inf], "volume", 
    10099               "Thickness of shell k"], 
    101               ] 
     100             ] 
    102101 
    103102source = ["lib/sph_j1c.c", "core_multi_shell.c"] 
     
    107106    Returns the SLD profile *r* (Ang), and *rho* (1e-6/Ang^2). 
    108107    """ 
    109     r = [] 
     108    z = [] 
    110109    rho = [] 
    111110 
    112111    # add in the core 
    113     r.append(0) 
     112    z.append(0) 
    114113    rho.append(sld_core) 
    115     r.append(radius) 
     114    z.append(radius) 
    116115    rho.append(sld_core) 
    117116 
     
    119118    for k in range(n): 
    120119        # Left side of each shells 
    121         r.append(r[-1]) 
     120        z.append(z[-1]) 
    122121        rho.append(sld[k]) 
    123         r.append(r[-1] + thickness[k]) 
     122        z.append(z[-1] + thickness[k]) 
    124123        rho.append(sld[k]) 
    125124    # add in the solvent 
    126     r.append(r[-1]) 
     125    z.append(z[-1]) 
    127126    rho.append(sld_solvent) 
    128     r.append(r[-1]*1.25) 
     127    z.append(z[-1]*1.25) 
    129128    rho.append(sld_solvent) 
    130129 
    131     return np.asarray(r), np.asarray(rho) 
     130    return np.asarray(z), np.asarray(rho) 
    132131 
    133132def ER(radius, n, thickness): 
     133    """Effective radius""" 
    134134    n = n[0]  # n cannot be polydisperse 
    135135    return np.sum(thickness[:n], axis=0) + radius 
    136136 
    137 def VR(radius, n, thickness): 
    138     return 1.0, 1.0 
    139  
    140 demo = dict(sld_core = 6.4, 
    141             radius = 60, 
    142             sld_solvent = 6.4, 
    143             n = 2, 
    144             sld = [2.0, 3.0], 
    145             thickness = 20, 
    146             thickness1_pd = 0.3, 
    147             thickness2_pd = 0.3, 
    148             thickness1_pd_n = 10, 
    149             thickness2_pd_n = 10, 
     137demo = dict(sld_core=6.4, 
     138            radius=60, 
     139            sld_solvent=6.4, 
     140            n=2, 
     141            sld=[2.0, 3.0], 
     142            thickness=20, 
     143            thickness1_pd=0.3, 
     144            thickness2_pd=0.3, 
     145            thickness1_pd_n=10, 
     146            thickness2_pd_n=10, 
    150147            ) 
Note: See TracChangeset for help on using the changeset viewer.