Changeset a6ebff8 in sasmodels


Ignore:
Timestamp:
Mar 21, 2016 3:06:36 AM (9 years ago)
Author:
awashington
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:
ca3abe6
Parents:
2684d45 (diff), 3703fde (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' into sesans_units

Files:
3 added
3 edited
2 moved

Legend:

Unmodified
Added
Removed
  • sasmodels/models/polymer_micelle.py

    rdb74c47 r1e9a108  
    2727from numpy import inf 
    2828 
    29 name = "micelle_spherical_core" 
    30 title = "Micelle Spherical Core model" 
     29name = "polymer_micelle" 
     30title = "Polymer micelle model" 
    3131description = """ 
    32     This model provides the form factor, $P(q)$, for a micelle with 
    33     a spherical core and Gaussian polymer chains attached to the surface. 
     32    This model provides an approximate form factor, P(q), for a micelle with 
     33    a spherical core with Gaussian polymer chains attached to the surface. 
    3434    """ 
    35 category = "shape-independent" 
     35category = "shape:sphere" 
    3636 
    3737# pylint: disable=bad-whitespace, line-too-long 
     
    5151# pylint: enable=bad-whitespace, line-too-long 
    5252 
    53 source = ["lib/sph_j1c.c", "micelle_spherical_core.c"] 
     53source = ["lib/sph_j1c.c", "polymer_micelle_kernel.c"] 
    5454 
    5555demo = dict(scale=1, background=0, 
     
    7575    ] 
    7676# RKH 20Mar2016 - need to check whether the core & corona volumes are per monomer ??? and how aggregation number works! 
     77# renamed from micelle_spherical_core to polymer_micelle, moved from shape-independent to spheres section. 
     78# Ought to be able to add polydisp to core? And add ability to x by S(Q) ? 
  • example/sesans_parameters_css-hs.py

    r3415f4f r2684d45  
    2222# Initial parameter values (if other than defaults) 
    2323initial_vals = { 
    24     "sld_core" : 1.0592, 
    25     "sld_solvent" : 2.88, 
    26     "radius" : 890, 
    27     "thickness" : 130 
     24    "sld_core" : 1.83, 
     25    "sld_shell" : 1.83, 
     26    "sld_solvent" : 0, 
     27    "radius" : 730, 
     28    "thickness" : 20, 
     29    "volfraction" : phi, 
     30    "scale" : (1-phi) 
    2831} 
    2932 
  • sasmodels/models/core_shell_sphere.py

    r3556ad7 r3f167d9  
    9191        @param thickness: shell thickness 
    9292    """ 
     93    return (1,1) 
    9394    whole = 4.0 * pi / 3.0 * pow((radius + thickness), 3) 
    9495    core = 4.0 * pi / 3.0 * radius * radius * radius 
  • sasmodels/sesans.py

    rc94577f r2684d45  
    2929 
    3030    q_min = dq = 0.1 * 2*pi / Rmax 
    31     return np.arange(q_min, Converter("1/A")(q_max[0], units=q_max[1]), dq) 
     31    return np.arange(q_min, 
     32                     Converter(q_max[1])(q_max[0], 
     33                                         units="1/A"), 
     34                     dq) 
    3235     
    3336def make_all_q(data): 
     
    7578 
    7679def call_hankel(data, q_calc, Iq_calc): 
    77     return hankel(data.x, data.lam * 1e-9, 
    78                   data.sample.thickness / 10, 
     80    return hankel((data.x, data.x_unit), 
     81                  (data.lam, data.lam_unit), 
     82                  (data.sample.thickness, 
     83                   data.sample.thickness_unit), 
    7984                  q_calc, Iq_calc) 
    8085   
     
    182187    *I* [cm$^{-1}$] is the value of the SANS model at *q* 
    183188    """ 
     189 
     190    from sas.sascalc.data_util.nxsunit import Converter 
     191    wavelength = Converter(wavelength[1])(wavelength[0],"A") 
     192    thickness = Converter(thickness[1])(thickness[0],"A") 
     193    Iq = Converter("1/cm")(Iq,"1/A") # All models default to inverse centimeters 
     194    SElength = Converter(SElength[1])(SElength[0],"A") 
     195 
    184196    G = np.zeros_like(SElength, 'd') 
    185197#============================================================================== 
     
    192204 
    193205    # [m^-1] step size in q, needed for integration 
    194     dq = (q[1]-q[0])*1e10 
     206    dq = (q[1]-q[0]) 
    195207 
    196208    # integration step, convert q into [m**-1] and 2 pi circle integration 
    197     G *= dq*1e10*2*pi 
    198     G0 *= dq*1e10*2*pi 
     209    G *= dq*2*pi 
     210    G0 = np.sum(Iq*q)*dq*2*np.pi 
    199211 
    200212    P = exp(thickness*wavelength**2/(4*pi**2)*(G-G0)) 
Note: See TracChangeset for help on using the changeset viewer.