Changeset 304c775 in sasmodels for sasmodels/models


Ignore:
Timestamp:
Oct 25, 2018 5:35:06 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
39a06c9
Parents:
6d5601c
Message:

provide method for testing Fq results. Refs #1202.

Location:
sasmodels/models
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/_spherepy.py

    rca4444f r304c775  
    7171    return 1.333333333333333 * pi * radius ** 3 
    7272 
     73def effective_radius(mode, radius): 
     74    return radius 
     75 
    7376def Iq(q, sld, sld_solvent, radius): 
    7477    #print "q",q 
     
    105108sesans.vectorized = True  # sesans accepts an array of z values 
    106109 
    107 def ER(radius): 
    108     return radius 
    109  
    110 # VR defaults to 1.0 
    111  
    112110demo = dict(scale=1, background=0, 
    113111            sld=6, sld_solvent=1, 
  • sasmodels/models/core_shell_bicelle_elliptical.py

    ree60aa7 r304c775  
    184184 
    185185tests = [ 
    186     [{'radius': 30.0, 'x_core': 3.0, 
    187       'thick_rim': 8.0, 'thick_face': 14.0, 'length': 50.0}, 'ER', 1], 
    188     [{'radius': 30.0, 'x_core': 3.0, 
    189       'thick_rim': 8.0, 'thick_face': 14.0, 'length': 50.0}, 'VR', 1], 
     186    #[{'radius': 30.0, 'x_core': 3.0, 
     187    #  'thick_rim': 8.0, 'thick_face': 14.0, 'length': 50.0}, 'ER', 1], 
     188    #[{'radius': 30.0, 'x_core': 3.0, 
     189    #  'thick_rim': 8.0, 'thick_face': 14.0, 'length': 50.0}, 'VR', 1], 
    190190 
    191191    [{'radius': 30.0, 'x_core': 3.0, 
  • sasmodels/models/core_shell_bicelle_elliptical_belt_rough.py

    ree60aa7 r304c775  
    186186 
    187187tests = [ 
    188     [{'radius': 30.0, 'x_core': 3.0, 'thick_rim':8.0, 'thick_face':14.0, 'length':50.0}, 'ER', 1], 
    189     [{'radius': 30.0, 'x_core': 3.0, 'thick_rim':8.0, 'thick_face':14.0, 'length':50.0}, 'VR', 1], 
     188    #[{'radius': 30.0, 'x_core': 3.0, 'thick_rim':8.0, 'thick_face':14.0, 'length':50.0}, 'ER', 1], 
     189    #[{'radius': 30.0, 'x_core': 3.0, 'thick_rim':8.0, 'thick_face':14.0, 'length':50.0}, 'VR', 1], 
    190190 
    191191    [{'radius': 30.0, 'x_core': 3.0, 'thick_rim':8.0, 'thick_face':14.0, 'length':50.0, 
  • sasmodels/models/core_shell_sphere.py

    ree60aa7 r304c775  
    9696 
    9797tests = [ 
    98 #    [{'radius': 20.0, 'thickness': 10.0}, 'ER', 30.0], 
     98    [{'radius': 20.0, 'thickness': 10.0}, 0.1, None, None, 30.0, 4.*pi/3*30**3, 1.0], 
    9999 
    100100    # The SasView test result was 0.00169, with a background of 0.001 
  • sasmodels/models/cylinder.py

    ree60aa7 r304c775  
    167167            phi_pd=10, phi_pd_n=5) 
    168168 
     169# pylint: disable=bad-whitespace, line-too-long 
    169170qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
    170171# After redefinition of angles, find new tests values.  Was 10 10 in old coords 
     
    180181] 
    181182del qx, qy  # not necessary to delete, but cleaner 
     183 
     184# Default radius and length 
     185radius, length = parameters[2][2], parameters[3][2] 
     186tests.extend([ 
     187    ({'radius_effective_type': 0}, 0.1, None, None, 0., pi*radius**2*length, 1.0), 
     188    ({'radius_effective_type': 1}, 0.1, None, None, (0.75*radius**2*length)**(1./3.), None, None), 
     189    ({'radius_effective_type': 2}, 0.1, None, None, radius, None, None), 
     190    ({'radius_effective_type': 3}, 0.1, None, None, length/2., None, None), 
     191    ({'radius_effective_type': 4}, 0.1, None, None, min(radius, length/2.), None, None), 
     192    ({'radius_effective_type': 5}, 0.1, None, None, max(radius, length/2.), None, None), 
     193    ({'radius_effective_type': 6}, 0.1, None, None, np.sqrt(4*radius**2 + length**2)/2., None, None), 
     194]) 
     195del radius, length 
     196# pylint: enable=bad-whitespace, line-too-long 
     197 
    182198# ADDED by:  RKH  ON: 18Mar2016 renamed sld's etc 
  • sasmodels/models/dab.py

    r2d81cfe r304c775  
    7474    return pars 
    7575 
    76 # ER defaults to 1.0 
    77  
    78 # VR defaults to 1.0 
    79  
    8076demo = dict(scale=1, background=0, cor_length=50) 
  • sasmodels/models/gaussian_peak.py

    r2d81cfe r304c775  
    5050    """ 
    5151 
    52 # VR defaults to 1.0 
    53  
    5452def random(): 
    5553    peak_pos = 10**np.random.uniform(-3, -1) 
  • sasmodels/models/hardsphere.py

    r71b751d r304c775  
    162162    return pars 
    163163 
    164 # ER defaults to 0.0 
    165 # VR defaults to 1.0 
    166  
    167164demo = dict(radius_effective=200, volfraction=0.2, 
    168165            radius_effective_pd=0.1, radius_effective_pd_n=40) 
  • sasmodels/models/hayter_msa.py

    r2d81cfe r304c775  
    8989    return 1.0; 
    9090    """ 
    91 # ER defaults to 0.0 
    92 # VR defaults to 1.0 
    9391 
    9492def random(): 
  • sasmodels/models/hollow_cylinder.py

    ree60aa7 r304c775  
    6969* **Last Reviewed by:** Paul Butler **Date:** September 06, 2018 
    7070""" 
     71from __future__ import division 
    7172 
    7273import numpy as np 
     
    132133qx = q*cos(pi/6.0) 
    133134qy = q*sin(pi/6.0) 
     135radius = parameters[0][2] 
     136thickness = parameters[1][2] 
     137length = parameters[2][2] 
    134138# Parameters for unit tests 
    135139tests = [ 
    136140    [{}, 0.00005, 1764.926], 
    137 #    [{}, 'VR', 0.55555556], 
     141    [{}, 0.1, None, None, 
     142     (3./4*(radius+thickness)**2*length)**(1./3),  # R_eff from volume 
     143     pi*((radius+thickness)**2-radius**2)*length,  # shell volume 
     144     (radius+thickness)**2/((radius+thickness)**2 - radius**2), # form:shell ratio 
     145    ], 
    138146    [{}, 0.001, 1756.76], 
    139147    [{}, (qx, qy), 2.36885476192], 
  • sasmodels/models/lamellar.py

    r2d81cfe r304c775  
    9595    return pars 
    9696 
    97 # ER defaults to 0.0 
    98 # VR defaults to 1.0 
    99  
    10097demo = dict(scale=1, background=0, 
    10198            sld=6, sld_solvent=1, 
  • sasmodels/models/lamellar_hg.py

    r2d81cfe r304c775  
    109109    return pars 
    110110 
    111 # ER defaults to 0.0 
    112 # VR defaults to 1.0 
    113  
    114111demo = dict(scale=1, background=0, 
    115112            length_tail=15, length_head=10, 
  • sasmodels/models/lamellar_hg_stack_caille.py

    r2d81cfe r304c775  
    122122    """ 
    123123 
    124 # ER defaults to 0.0 
    125 # VR defaults to 1.0 
    126  
    127124def random(): 
    128125    total_thickness = 10**np.random.uniform(2, 4.7) 
  • sasmodels/models/lamellar_stack_caille.py

    r2d81cfe r304c775  
    120120    """ 
    121121 
    122 # ER defaults to 0.0 
    123 # VR defaults to 1.0 
    124  
    125122demo = dict(scale=1, background=0, 
    126123            thickness=67., Nlayers=3.75, d_spacing=200., 
  • sasmodels/models/lamellar_stack_paracrystal.py

    r2d81cfe r304c775  
    147147    return pars 
    148148 
    149 # ER defaults to 0.0 
    150 # VR defaults to 1.0 
    151  
    152149demo = dict(scale=1, background=0, 
    153150            thickness=33, Nlayers=20, d_spacing=250, sigma_d=0.2, 
  • sasmodels/models/sphere.py

    ree60aa7 r304c775  
    8383      "radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, 
    8484     0.2, 0.228843], 
    85 #    [{"radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, "ER", 120.], 
    86 #    [{"radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, "VR", 1.], 
     85    [{"radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, 
     86     0.1, None, None, 120., None, 1.0], 
    8787] 
  • sasmodels/models/squarewell.py

    r2d81cfe r304c775  
    130130""" 
    131131 
    132 # ER defaults to 0.0 
    133 # VR defaults to 1.0 
    134  
    135132def random(): 
    136133    pars = dict( 
  • sasmodels/models/stickyhardsphere.py

    r2d81cfe r304c775  
    182182""" 
    183183 
    184 # ER defaults to 0.0 
    185 # VR defaults to 1.0 
    186  
    187184demo = dict(radius_effective=200, volfraction=0.2, perturb=0.05, 
    188185            stickiness=0.2, radius_effective_pd=0.1, radius_effective_pd_n=40) 
  • sasmodels/models/vesicle.py

    ree60aa7 r304c775  
    128128         [{}, 0.100600200401, 1.77063682331], 
    129129         [{}, 0.5, 0.00355351388906], 
    130 #         [{}, 'ER', 130.], 
    131 #         [{}, 'VR', 0.54483386436], 
     130         [{}, 0.1, None, None, 130., None, 1./0.54483386436],  # R_eff, form:shell 
    132131        ] 
Note: See TracChangeset for help on using the changeset viewer.