Changes in / [c9f885e:8b9adb5] in sasmodels


Ignore:
Location:
sasmodels/models
Files:
2 added
17 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/be_polyelectrolyte.py

    r168052c r0e86967  
    127127    :return:     2D-Intensity 
    128128    """ 
    129     iq = Iq(sqrt(qx**2 + qy**2), *args) 
    130     return iq 
     129    intensity = Iq(sqrt(qx**2 + qy**2), *args) 
     130    return intensity 
    131131 
    132132Iqxy.vectorized = True  # Iqxy accepts an array of qx, qy values 
  • sasmodels/models/core_shell_cylinder.py

    reb69cce rf0aa7f8  
    155155 
    156156def ER(radius, thickness, length): 
     157    """ 
     158        Returns the effective radius used in the S*P calculation 
     159    """ 
    157160    radius = radius + thickness 
    158161    length = length + 2 * thickness 
     
    161164 
    162165def VR(radius, thickness, length): 
     166    """ 
     167        Returns volume ratio 
     168    """ 
    163169    whole = pi * (radius + thickness) ** 2 * (length + 2 * thickness) 
    164170    core = pi * radius ** 2 * length 
  • sasmodels/models/correlation_length.py

    r5054e80 r3e6c5c1  
    7878# names and the target sasview model name. 
    7979oldname = 'CorrLengthModel' 
    80 # pylint: disable=bad-continuation 
    81 oldpars = dict( 
    82                lorentz_scale='scale_l', porod_scale='scale_p', 
     80 
     81oldpars = dict(lorentz_scale='scale_l', porod_scale='scale_p', 
    8382               cor_length='length_l', exponent_p='exponent_p', 
    84                exponent_l='exponent_l' 
    85                ) 
     83               exponent_l='exponent_l') 
    8684 
    87 tests = [ 
    88          [{}, 0.001, 1009.98], 
     85tests = [[{}, 0.001, 1009.98], 
    8986         [{}, 0.150141, 0.174645], 
    90          [{}, 0.442528, 0.0203957] 
    91          ] 
    92 # pylint: enable=bad-continuation 
     87         [{}, 0.442528, 0.0203957]] 
  • sasmodels/models/cylinder.py

    reb69cce r0c3a226  
    144144 
    145145def ER(radius, length): 
     146    """ 
     147        Return equivalent radius (ER) 
     148    """ 
    146149    ddd = 0.75 * radius * (2 * radius * length + (length + radius) * (length + pi * radius)) 
    147150    return 0.5 * (ddd) ** (1. / 3.) 
  • sasmodels/models/dab.py

    reb69cce r94bd809  
    11r""" 
    2  
    32Calculates the scattering from a randomly distributed, two-phase system based on 
    43the Debye-Anderson-Brumberger (DAB) model for such systems. The two-phase system 
  • sasmodels/models/fcc.py

    r9aac25d rc0ccea8  
    114114single = False 
    115115 
     116# pylint: disable=bad-whitespace, line-too-long 
    116117#             ["name", "units", default, [lower, upper], "type","description"], 
    117118parameters = [["dnn", "Ang", 220, [-inf, inf], "", "Nearest neighbour distance"], 
     
    124125              ["psi", "degrees", 60, [-inf, inf], "orientation", "Out of plane angle"] 
    125126             ] 
     127# pylint: enable=bad-whitespace, line-too-long 
    126128 
    127129source = ["lib/J1.c", "lib/gauss150.c", "lib/sphere_form.c", "fcc.c"] 
  • sasmodels/models/guinier.py

    reb69cce r723cebe  
    3636 
    3737#             ["name", "units", default, [lower, upper], "type","description"], 
    38 parameters = [ 
    39               ["rg", "Ang", 60.0, [0, inf], "", "Radius of Gyration"], 
    40               ] 
     38parameters = [["rg", "Ang", 60.0, [0, inf], "", "Radius of Gyration"]] 
    4139 
    4240Iq = """ 
     
    5149 
    5250# parameters for demo 
    53 demo = dict(scale=1.0,rg=60.0) 
     51demo = dict(scale=1.0, rg=60.0) 
    5452 
    5553# For testing against the old sasview models, include the converted parameter 
     
    5957 
    6058# parameters for unit tests 
    61 tests = [ 
    62          [{'rg' : 31.5}, 0.005, 0.991756] 
    63          ] 
     59tests = [[{'rg' : 31.5}, 0.005, 0.991756]] 
  • sasmodels/models/hollow_cylinder.py

    rec2ca99 re0fd913  
    9393source = ["lib/J1.c", "lib/gauss76.c", "hollow_cylinder.c"] 
    9494 
     95# pylint: disable=W0613 
    9596def ER(radius, core_radius, length): 
    9697    """ 
  • sasmodels/models/lamellarCailleHG.py

    r13ed84c r652a78a  
    146146    solvent_sld='sld_solvent') 
    147147# 
    148 tests = [ 
    149         [ {'scale': 1.0, 'background' : 0.0, 'tail_length' : 10.0, 'head_length' : 2.0,'Nlayers' : 30.0, 'spacing' : 40., 
    150             'Caille_parameter' : 0.001, 'sld' : 0.4, 'head_sld' : 2.0, 'solvent_sld' : 6.0, 
    151             'tail_length_pd' : 0.0, 'head_length_pd' : 0.0, 'spacing_pd' : 0.0 }, [0.001], [6838238.571488]] 
    152         ] 
     148tests = [[{'scale': 1.0, 'background': 0.0, 'tail_length': 10.0, 'head_length': 2.0, 
     149           'Nlayers': 30.0, 'spacing': 40., 'Caille_parameter': 0.001, 'sld': 0.4, 
     150           'head_sld': 2.0, 'solvent_sld': 6.0, 'tail_length_pd': 0.0, 
     151           'head_length_pd': 0.0, 'spacing_pd': 0.0}, [0.001], [6838238.571488]]] 
  • sasmodels/models/lamellarFFHG.py

    r7f47777 r3eb6b90  
    6868category = "shape:lamellae" 
    6969 
     70# pylint: disable=bad-whitespace, line-too-long 
    7071#             ["name", "units", default, [lower, upper], "type","description"], 
    71 parameters = [["tail_length", "Ang",  15, [0, inf], "volume", 
    72                "Tail thickness"], 
    73               ["head_length", "Ang",  10, [0, inf], "volume", 
    74                "head thickness"], 
    75               ["sld", "1e-6/Ang^2", 0.4, [-inf,inf], "", 
    76                "Tail scattering length density"], 
    77               ["head_sld", "1e-6/Ang^2", 3.0, [-inf,inf], "", 
    78                "Head scattering length density"], 
    79               ["solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "", 
    80                "Solvent scattering length density"], 
    81              ] 
     72parameters = [["tail_length", "Ang",       15,   [0, inf],  "volume",  "Tail thickness"], 
     73              ["head_length", "Ang",       10,   [0, inf],  "volume",  "head thickness"], 
     74              ["sld",         "1e-6/Ang^2", 0.4, [-inf,inf], "",       "Tail scattering length density"], 
     75              ["head_sld",    "1e-6/Ang^2", 3.0, [-inf,inf], "",       "Head scattering length density"], 
     76              ["solvent_sld", "1e-6/Ang^2", 6,   [-inf,inf], "",       "Solvent scattering length density"]] 
     77# pylint: enable=bad-whitespace, line-too-long 
    8278 
    8379# No volume normalization despite having a volume parameter 
     
    113109 
    114110demo = dict(scale=1, background=0, 
    115             tail_length=15,head_length=10, 
     111            tail_length=15, head_length=10, 
    116112            sld=0.4, head_sld=3.0, solvent_sld=6.0, 
    117             tail_length_pd= 0.2, tail_length_pd_n=40, 
    118             head_length_pd= 0.01, head_length_pd_n=40) 
     113            tail_length_pd=0.2, tail_length_pd_n=40, 
     114            head_length_pd=0.01, head_length_pd_n=40) 
    119115 
    120116oldname = 'LamellarFFHGModel' 
     
    122118               sld='sld_tail', head_sld='sld_head', solvent_sld='sld_solvent') 
    123119# 
    124 tests = [ 
    125         [ {'scale': 1.0, 'background' : 0.0, 'tail_length' : 15.0, 'head_length' : 10.0,'sld' : 0.4, 
    126          'head_sld' : 3.0, 'solvent_sld' : 6.0, }, [0.001], [653143.9209]] 
    127         ] 
    128  
    129  
     120tests = [[{'scale': 1.0, 'background': 0.0, 'tail_length': 15.0, 'head_length': 10.0, 
     121           'sld': 0.4, 'head_sld': 3.0, 'solvent_sld': 6.0}, [0.001], [653143.9209]]] 
  • sasmodels/models/lorentz.py

    reb69cce reb5901b  
    5656 
    5757# parameters for demo 
    58 demo = dict(scale=1.0,background=0.0,cor_length=50.0) 
     58demo = dict(scale=1.0, background=0.0, cor_length=50.0) 
    5959 
    6060# For testing against the old sasview models, include the converted parameter 
     
    6464 
    6565# parameters for unit tests 
    66 tests = [ 
    67          [{'cor_length' : 250},0.01,0.137931] 
    68          ] 
     66tests = [[{'cor_length': 250}, 0.01, 0.137931]] 
  • sasmodels/models/peak_lorentz.py

    r14ba6f6 r04b0b30  
    1111    I(q) = \frac{scale}{\bigl(1+\bigl(\frac{q-q_0}{B}\bigr)^2\bigr)} + background 
    1212 
    13 with the peak having height of $I_0$ centered at $q_0$ and having a HWHM (half-width half-maximum) of B. 
     13with the peak having height of $I_0$ centered at $q_0$ and having 
     14a HWHM (half-width half-maximum) of B. 
    1415 
    1516For 2D data the scattering intensity is calculated in the same way as 1D, 
     
    5556 
    5657def Iq(q, peak_pos, peak_hwhm): 
     58    """ 
     59        Return I(q) 
     60    """ 
    5761    inten = (1/(1+((q-peak_pos)/peak_hwhm)**2)) 
    5862    return inten 
     
    6064 
    6165def Iqxy(qx, qy, *args): 
     66    """ 
     67        Return I(qx, qy) 
     68    """ 
    6269    return Iq(sqrt(qx ** 2 + qy ** 2), *args) 
    6370Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 
  • sasmodels/models/porod.py

    r16bb433 r1ce6e82  
    1313of the sample, and $\Delta\rho$ is the contrast factor. 
    1414 
    15 For 2D data: The 2D scattering intensity is calculated in the same way as 1D,  
     15For 2D data: The 2D scattering intensity is calculated in the same way as 1D, 
    1616where the q vector is defined as 
    1717 
  • sasmodels/models/rpa.py

    r82c299f r8dd6914  
    8989#   ["name", "units", default, [lower, upper], "type","description"], 
    9090parameters = [ 
    91     ["case_num", CASES, 0, [0, 10], "", "Component organization" ], 
     91    ["case_num", CASES, 0, [0, 10], "", "Component organization"], 
    9292 
    9393    ["Na", "", 1000.0, [1, inf], "", "Degree of polymerization"], 
  • sasmodels/models/sphere.py

    r9c461c7 rc691551  
    100100 
    101101def ER(radius): 
     102    """ 
     103        Return equivalent radius (ER) 
     104    """ 
    102105    return radius 
    103106 
  • sasmodels/models/triaxial_ellipsoid.py

    r9c461c7 r469e763  
    8282---------- 
    8383 
    84 L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray and Neutron Scattering*, Plenum, 
    85 New York, 1987. 
     84L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray 
     85and Neutron Scattering*, Plenum, New York, 1987. 
    8686""" 
    8787 
     
    120120 
    121121def ER(req_minor, req_major, rpolar): 
     122    """ 
     123        Returns the effective radius used in the S*P calculation 
     124    """ 
    122125    import numpy as np 
    123126    from .ellipsoid import ER as ellipsoid_ER 
  • sasmodels/models/vesicle.py

    r216fa6d r068cebd  
    6060""" 
    6161 
    62 import numpy as np 
    6362from numpy import pi, inf 
    6463 
     
    131130# NOTE: test results taken from values returned by SasView 3.1.2 
    132131tests = [[{}, 0.0010005303255, 17139.8268799], 
    133          [{}, 0.200027832249, 0.130387268704 ], 
     132         [{}, 0.200027832249, 0.130387268704], 
    134133         [{}, 'ER', 130.], 
    135134         [{}, 'VR', 0.54483386436], 
Note: See TracChangeset for help on using the changeset viewer.