Changeset 3e428ec in sasmodels


Ignore:
Timestamp:
Mar 9, 2015 1:14:03 PM (9 years ago)
Author:
Doucet, Mathieu <doucetm@…>
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:
ddfe69c
Parents:
485aee2
Message:

Cleaning up

Location:
sasmodels/models
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/cylinder.py

    r9890053 r3e428ec  
    130130category = "shape:cylinder" 
    131131 
    132 parameters = [ 
    133 #   [ "name", "units", default, [lower, upper], "type", 
    134 #     "description" ], 
    135     [ "sld", "1e-6/Ang^2", 4, [-inf,inf], "", 
    136       "Cylinder scattering length density" ], 
    137     [ "solvent_sld", "1e-6/Ang^2", 1, [-inf,inf], "", 
    138       "Solvent scattering length density" ], 
    139     [ "radius", "Ang",  20, [0, inf], "volume", 
    140       "Cylinder radius" ], 
    141     [ "length", "Ang",  400, [0, inf], "volume", 
    142       "Cylinder length" ], 
    143     [ "theta", "degrees", 60, [-inf, inf], "orientation", 
    144       "In plane angle" ], 
    145     [ "phi", "degrees", 60, [-inf, inf], "orientation", 
    146       "Out of plane angle" ], 
    147     ] 
     132#             [ "name", "units", default, [lower, upper], "type", "description"], 
     133parameters = [["sld", "1e-6/Ang^2", 4, [-inf, inf], "", 
     134               "Cylinder scattering length density"], 
     135              ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
     136               "Solvent scattering length density"], 
     137              ["radius", "Ang", 20, [0, inf], "volume", 
     138               "Cylinder radius"], 
     139              ["length", "Ang", 400, [0, inf], "volume", 
     140               "Cylinder length"], 
     141              ["theta", "degrees", 60, [-inf, inf], "orientation", 
     142               "In plane angle"], 
     143              ["phi", "degrees", 60, [-inf, inf], "orientation", 
     144               "Out of plane angle"], 
     145             ] 
    148146 
    149 source = [ "lib/J1.c", "lib/gauss76.c", "cylinder.c" ] 
     147source = ["lib/J1.c", "lib/gauss76.c", "cylinder.c"] 
    150148 
    151149def ER(radius, length): 
    152     ddd = 0.75*radius*(2*radius*length + (length+radius)*(length+pi*radius)) 
    153     return 0.5 * (ddd)**(1./3.) 
     150    ddd = 0.75 * radius * (2 * radius * length + (length + radius) * (length + pi * radius)) 
     151    return 0.5 * (ddd) ** (1. / 3.) 
    154152 
    155153# parameters for demo 
    156 demo = dict( 
    157     scale=1, background=0, 
    158     sld=6, solvent_sld=1, 
    159     #radius=5, length=20, 
    160     radius=20, length=300, 
    161     theta=60, phi=60, 
    162     radius_pd=.2, radius_pd_n=9, 
    163     length_pd=.2,length_pd_n=10, 
    164     theta_pd=10, theta_pd_n=5, 
    165     phi_pd=10, phi_pd_n=5, 
    166     ) 
     154demo = dict(scale=1, background=0, 
     155            sld=6, solvent_sld=1, 
     156            radius=20, length=300, 
     157            theta=60, phi=60, 
     158            radius_pd=.2, radius_pd_n=9, 
     159            length_pd=.2, length_pd_n=10, 
     160            theta_pd=10, theta_pd_n=5, 
     161            phi_pd=10, phi_pd_n=5) 
    167162 
    168163# For testing against the old sasview models, include the converted parameter 
    169164# names and the target sasview model name. 
    170 oldname='CylinderModel' 
    171 oldpars=dict(theta='cyl_theta', phi='cyl_phi', sld='sldCyl', solvent_sld='sldSolv') 
     165oldname = 'CylinderModel' 
     166oldpars = dict(theta='cyl_theta', phi='cyl_phi', sld='sldCyl', solvent_sld='sldSolv') 
    172167 
    173168 
    174 qx,qy = 0.2*np.cos(2.5), 0.2*np.sin(2.5) 
    175 tests = [ 
    176     [{},  0.2, 0.041761386790780453], 
    177     [{}, [0.2], [0.041761386790780453]], 
    178     [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03414647218513852], 
    179     [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03414647218513852]], 
    180     ] 
    181 del qx,qy  # not necessary to delete, but cleaner 
     169qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
     170tests = [[{}, 0.2, 0.041761386790780453], 
     171         [{}, [0.2], [0.041761386790780453]], 
     172         [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03414647218513852], 
     173         [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03414647218513852]], 
     174        ] 
     175del qx, qy  # not necessary to delete, but cleaner 
  • sasmodels/models/dab.py

    ra5d0d00 r3e428ec  
    4646category = "shape-independent" 
    4747 
    48 parameters = [ 
    49 #   [ "name", "units", default, [lower, upper], "type", "description" ], 
    50     [ "length", "Ang", 50.0, [0, inf], "", "correlation length" ], 
    51     ] 
     48#             ["name", "units", default, [lower, upper], "type", "description"], 
     49parameters = [["length", "Ang", 50.0, [0, inf], "", "correlation length"], 
     50             ] 
    5251 
    5352Iq = """ 
     
    6867# VR defaults to 1.0 
    6968 
    70 demo = dict( 
    71         scale=1, background=0, 
    72         length=50, 
    73         ) 
     69demo = dict(scale=1, background=0, length=50) 
    7470oldname = "DABModel" 
    7571oldpars = dict(length='length') 
  • sasmodels/models/ellipsoid.py

    r3c56da87 r3e428ec  
    123123description = """\ 
    124124P(q.alpha)= scale*f(q)^2 + background, where f(q)= 3*(sld 
    125                 - solvent_sld)*V*[sin(q*r(Rp,Re,alpha)) 
    126                 -q*r*cos(qr(Rp,Re,alpha))] 
    127                 /[qr(Rp,Re,alpha)]^3" 
     125        - solvent_sld)*V*[sin(q*r(Rp,Re,alpha)) 
     126        -q*r*cos(qr(Rp,Re,alpha))] 
     127        /[qr(Rp,Re,alpha)]^3" 
    128128 
    129129     r(Rp,Re,alpha)= [Re^(2)*(sin(alpha))^2 
    130                 + Rp^(2)*(cos(alpha))^2]^(1/2) 
     130        + Rp^(2)*(cos(alpha))^2]^(1/2) 
    131131 
    132                 sld: SLD of the ellipsoid 
    133                 solvent_sld: SLD of the solvent 
    134                 V: volume of the ellipsoid 
    135                 Rp: polar radius of the ellipsoid 
    136                 Re: equatorial radius of the ellipsoid 
     132        sld: SLD of the ellipsoid 
     133        solvent_sld: SLD of the solvent 
     134        V: volume of the ellipsoid 
     135        Rp: polar radius of the ellipsoid 
     136        Re: equatorial radius of the ellipsoid 
    137137""" 
    138138category = "shape:ellipsoid" 
    139139 
    140 parameters = [ 
    141 #   [ "name", "units", default, [lower, upper], "type", 
    142 #     "description" ], 
    143     [ "sld", "1e-6/Ang^2", 4, [-inf,inf], "", 
    144       "Ellipsoid scattering length density" ], 
    145     [ "solvent_sld", "1e-6/Ang^2", 1, [-inf,inf], "", 
    146       "Solvent scattering length density" ], 
    147     [ "rpolar", "Ang",  20, [0, inf], "volume", 
    148       "Polar radius" ], 
    149     [ "requatorial", "Ang",  400, [0, inf], "volume", 
    150       "Equatorial radius" ], 
    151     [ "theta", "degrees", 60, [-inf, inf], "orientation", 
    152       "In plane angle" ], 
    153     [ "phi", "degrees", 60, [-inf, inf], "orientation", 
    154       "Out of plane angle" ], 
    155     ] 
     140#             ["name", "units", default, [lower, upper], "type","description"], 
     141parameters = [["sld", "1e-6/Ang^2", 4, [-inf, inf], "", 
     142               "Ellipsoid scattering length density"], 
     143              ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
     144               "Solvent scattering length density"], 
     145              ["rpolar", "Ang", 20, [0, inf], "volume", 
     146               "Polar radius"], 
     147              ["requatorial", "Ang", 400, [0, inf], "volume", 
     148               "Equatorial radius"], 
     149              ["theta", "degrees", 60, [-inf, inf], "orientation", 
     150               "In plane angle"], 
     151              ["phi", "degrees", 60, [-inf, inf], "orientation", 
     152               "Out of plane angle"], 
     153             ] 
    156154 
    157 source = [ "lib/J1.c", "lib/gauss76.c", "ellipsoid.c"] 
     155source = ["lib/J1.c", "lib/gauss76.c", "ellipsoid.c"] 
    158156 
    159157def ER(rpolar, requatorial): 
     
    162160    ee = np.empty_like(rpolar) 
    163161    idx = rpolar > requatorial 
    164     ee[idx] = (rpolar[idx]**2 - requatorial[idx]**2)/rpolar[idx]**2 
     162    ee[idx] = (rpolar[idx] ** 2 - requatorial[idx] ** 2) / rpolar[idx] ** 2 
    165163    idx = rpolar < requatorial 
    166     ee[idx] = (requatorial[idx]**2 - rpolar[idx]**2)/requatorial[idx]**2 
     164    ee[idx] = (requatorial[idx] ** 2 - rpolar[idx] ** 2) / requatorial[idx] ** 2 
    167165    idx = rpolar == requatorial 
    168     ee[idx] = 2*rpolar[idx] 
    169     valid = (rpolar*requatorial != 0) 
    170     bd = 1.0-ee[valid] 
     166    ee[idx] = 2 * rpolar[idx] 
     167    valid = (rpolar * requatorial != 0) 
     168    bd = 1.0 - ee[valid] 
    171169    e1 = np.sqrt(ee[valid]) 
    172     b1 = 1.0 + np.arcsin(e1)/(e1*np.sqrt(bd)) 
    173     bL = (1.0+e1)/(1.0-e1) 
    174     b2 = 1.0 + bd/2/e1*np.log(bL) 
    175     delta = 0.75*b1*b2 
     170    b1 = 1.0 + np.arcsin(e1) / (e1 * np.sqrt(bd)) 
     171    bL = (1.0 + e1) / (1.0 - e1) 
     172    b2 = 1.0 + bd / 2 / e1 * np.log(bL) 
     173    delta = 0.75 * b1 * b2 
    176174 
    177175    ddd = np.zeros_like(rpolar) 
    178     ddd[valid] = 2.0*(delta+1.0)*rpolar*requatorial**2 
    179     return 0.5*ddd**(1.0/3.0) 
     176    ddd[valid] = 2.0 * (delta + 1.0) * rpolar * requatorial ** 2 
     177    return 0.5 * ddd ** (1.0 / 3.0) 
    180178 
    181179 
    182 demo = dict( 
    183         scale=1, background=0, 
    184         sld=6, solvent_sld=1, 
    185         rpolar=50, requatorial=30, 
    186         theta=30, phi=15, 
    187         rpolar_pd=.2, rpolar_pd_n=15, 
    188         requatorial_pd=.2, requatorial_pd_n=15, 
    189         theta_pd=15, theta_pd_n=45, 
    190         phi_pd=15, phi_pd_n=1, 
    191         ) 
     180demo = dict(scale=1, background=0, 
     181            sld=6, solvent_sld=1, 
     182            rpolar=50, requatorial=30, 
     183            theta=30, phi=15, 
     184            rpolar_pd=.2, rpolar_pd_n=15, 
     185            requatorial_pd=.2, requatorial_pd_n=15, 
     186            theta_pd=15, theta_pd_n=45, 
     187            phi_pd=15, phi_pd_n=1) 
    192188oldname = 'EllipsoidModel' 
    193189oldpars = dict(theta='axis_theta', phi='axis_phi', 
  • sasmodels/models/fcc.py

    r3c56da87 r3e428ec  
    9898category = "shape:paracrystal" 
    9999 
    100 parameters = [ 
    101 #   [ "name", "units", default, [lower, upper], "type","description" ], 
    102     [ "dnn", "Ang", 220, [-inf,inf],"","Nearest neighbour distance"], 
    103     [ "d_factor", "", 0.06,[-inf,inf],"","Paracrystal distortion factor" ], 
    104     [ "radius", "Ang",  40, [0, inf], "volume","Particle radius" ], 
    105     [ "sld", "1e-6/Ang^2", 4, [-inf,inf], "", "Particle scattering length density" ], 
    106     [ "solvent_sld", "1e-6/Ang^2", 1, [-inf,inf], "","Solvent scattering length density" ], 
    107     [ "theta", "degrees", 60, [-inf, inf], "orientation","In plane angle" ], 
    108     [ "phi", "degrees", 60, [-inf, inf], "orientation","Out of plane angle" ], 
    109     [ "psi", "degrees", 60, [-inf,inf], "orientation","Out of plane angle"] 
    110     ] 
     100#             ["name", "units", default, [lower, upper], "type","description"], 
     101parameters = [["dnn", "Ang", 220, [-inf, inf], "", "Nearest neighbour distance"], 
     102              ["d_factor", "", 0.06, [-inf, inf], "", "Paracrystal distortion factor"], 
     103              ["radius", "Ang", 40, [0, inf], "volume", "Particle radius"], 
     104              ["sld", "1e-6/Ang^2", 4, [-inf, inf], "", "Particle scattering length density"], 
     105              ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", "Solvent scattering length density"], 
     106              ["theta", "degrees", 60, [-inf, inf], "orientation", "In plane angle"], 
     107              ["phi", "degrees", 60, [-inf, inf], "orientation", "Out of plane angle"], 
     108              ["psi", "degrees", 60, [-inf, inf], "orientation", "Out of plane angle"] 
     109             ] 
    111110 
    112 source = [ "lib/J1.c", "lib/gauss150.c", "fcc.c" ] 
     111source = ["lib/J1.c", "lib/gauss150.c", "fcc.c"] 
    113112 
    114113# parameters for demo 
    115 demo = dict( 
    116     scale=1, background=0, 
    117     dnn=220, d_factor=0.06, sld=4, solvent_sld=1, 
    118     radius=40, 
    119     theta=60, phi=60, psi=60, 
    120     radius_pd=.2, radius_pd_n=0.2, 
    121     theta_pd=15, theta_pd_n=0, 
    122     phi_pd=15, phi_pd_n=0, 
    123     psi_pd=15, psi_pd_n=0, 
    124     ) 
     114demo = dict(scale=1, background=0, 
     115            dnn=220, d_factor=0.06, sld=4, solvent_sld=1, 
     116            radius=40, 
     117            theta=60, phi=60, psi=60, 
     118            radius_pd=.2, radius_pd_n=0.2, 
     119            theta_pd=15, theta_pd_n=0, 
     120            phi_pd=15, phi_pd_n=0, 
     121            psi_pd=15, psi_pd_n=0, 
     122           ) 
    125123 
    126124# For testing against the old sasview models, include the converted parameter 
    127125# names and the target sasview model name. 
    128 oldname='FCCrystalModel' 
    129 oldpars=dict(sld='sldSph', solvent_sld='sldSolv') 
     126oldname = 'FCCrystalModel' 
     127oldpars = dict(sld='sldSph', solvent_sld='sldSolv') 
  • sasmodels/models/gaussian_peak.py

    r3c56da87 r3e428ec  
    3131category = "shape-independent" 
    3232 
    33 parameters = [ 
    34 #   [ "name", "units", default, [lower, upper], "type", 
    35 #     "description" ], 
    36     [ "q0", "1/Ang", 0.05, [-inf,inf], "", 
    37       "Peak position" ], 
    38     [ "sigma", "1/Ang", 0.005, [-inf,inf], "", 
    39       "Peak width (standard deviation)" ], 
    40     ] 
    41  
     33#             ["name", "units", default, [lower, upper], "type","description"], 
     34parameters = [["q0", "1/Ang", 0.05, [-inf, inf], "", "Peak position"], 
     35              ["sigma", "1/Ang", 0.005, [-inf, inf], "", 
     36               "Peak width (standard deviation)"], 
     37             ] 
    4238 
    4339# No volume normalization despite having a volume parameter 
     
    6157# VR defaults to 1.0 
    6258 
    63 demo = dict( 
    64         scale=1, background=0, 
    65         q0 = 0.05, sigma = 0.005, 
    66         ) 
     59demo = dict(scale=1, background=0, q0=0.05, sigma=0.005) 
    6760oldname = "PeakGaussModel" 
    6861oldpars = dict(sigma='B') 
  • sasmodels/models/hardsphere.py

    r3c56da87 r3e428ec  
    3737title = "Hard sphere structure factor, with Percus-Yevick closure" 
    3838description = """\ 
    39         [Hard sphere structure factor, with Percus-Yevick closure] 
     39    [Hard sphere structure factor, with Percus-Yevick closure] 
    4040        Interparticle S(Q) for random, non-interacting spheres. 
    41         May be a reasonable approximation for other shapes of 
    42         particles that freely rotate, and for moderately polydisperse 
    43         systems. Though strictly the maths needs to be modified -  
    44         which sasview does not do yet. 
    45         effect_radius is the hard sphere radius 
    46         volfraction is the volume fraction occupied by the spheres. 
     41    May be a reasonable approximation for other shapes of 
     42    particles that freely rotate, and for moderately polydisperse 
     43        systems. Though strictly the maths needs to be modified - 
     44    which sasview does not do yet. 
     45    effect_radius is the hard sphere radius 
     46    volfraction is the volume fraction occupied by the spheres. 
    4747""" 
    4848category = "structure-factor" 
    4949 
    50 parameters = [ 
    51 #   [ "name", "units", default, [lower, upper], "type", 
    52 #     "description" ], 
    53     [ "effect_radius", "Ang",  50.0, [0, inf], "volume", 
    54       "effective radius of hard sphere" ], 
    55     [ "volfraction", "",  0.2, [0, 0.74], "", 
    56       "volume fraction of hard spheres" ], 
    57      ] 
     50#             ["name", "units", default, [lower, upper], "type","description"], 
     51parameters = [["effect_radius", "Ang", 50.0, [0, inf], "volume", 
     52               "effective radius of hard sphere"], 
     53              ["volfraction", "", 0.2, [0, 0.74], "", 
     54               "volume fraction of hard spheres"], 
     55             ] 
    5856 
    5957# No volume normalization despite having a volume parameter 
     
    6462 
    6563Iq = """ 
    66         double denom,dnum,alpha,beta,gamm,a,asq,ath,afor,rca,rsa; 
    67         double calp,cbeta,cgam,prefac,c,vstruc; 
    68         double struc; 
    69          
    70         //  compute constants 
    71         denom = pow((1.0-volfraction),4); 
    72         dnum = pow((1.0 + 2.0*volfraction),2); 
    73         alpha = dnum/denom; 
    74         beta = -6.0*volfraction*pow((1.0 + volfraction/2.0),2)/denom; 
    75         gamm = 0.50*volfraction*dnum/denom; 
    76         // 
    77         //  calculate the structure factor 
    78         //      
    79         a = 2.0*q*effect_radius; 
    80         asq = a*a; 
    81         ath = asq*a; 
    82         afor = ath*a; 
    83         SINCOS(a,rsa,rca); 
    84         //rca = cos(a); 
    85         //rsa = sin(a); 
    86         calp = alpha*(rsa/asq - rca/a); 
    87         cbeta = beta*(2.0*rsa/asq - (asq - 2.0)*rca/ath - 2.0/ath); 
    88         cgam = gamm*(-rca/a + (4.0/a)*((3.0*asq - 6.0)*rca/afor + (asq - 6.0)*rsa/ath + 6.0/afor)); 
    89         prefac = -24.0*volfraction/a; 
    90         c = prefac*(calp + cbeta + cgam); 
    91         vstruc = 1.0/(1.0-c); 
    92         struc = vstruc; 
    93          
    94         return(struc); 
     64    double denom,dnum,alpha,beta,gamm,a,asq,ath,afor,rca,rsa; 
     65    double calp,cbeta,cgam,prefac,c,vstruc; 
     66    double struc; 
     67 
     68    //  compute constants 
     69    denom = pow((1.0-volfraction),4); 
     70    dnum = pow((1.0 + 2.0*volfraction),2); 
     71    alpha = dnum/denom; 
     72    beta = -6.0*volfraction*pow((1.0 + volfraction/2.0),2)/denom; 
     73    gamm = 0.50*volfraction*dnum/denom; 
     74    // 
     75    //  calculate the structure factor 
     76    // 
     77    a = 2.0*q*effect_radius; 
     78    asq = a*a; 
     79    ath = asq*a; 
     80    afor = ath*a; 
     81    SINCOS(a,rsa,rca); 
     82    //rca = cos(a); 
     83    //rsa = sin(a); 
     84    calp = alpha*(rsa/asq - rca/a); 
     85    cbeta = beta*(2.0*rsa/asq - (asq - 2.0)*rca/ath - 2.0/ath); 
     86    cgam = gamm*(-rca/a + (4.0/a)*((3.0*asq - 6.0)*rca/afor + (asq - 6.0)*rsa/ath + 6.0/afor)); 
     87    prefac = -24.0*volfraction/a; 
     88    c = prefac*(calp + cbeta + cgam); 
     89    vstruc = 1.0/(1.0-c); 
     90    struc = vstruc; 
     91 
     92    return(struc); 
    9593   """ 
    9694 
     
    103101# VR defaults to 1.0 
    104102 
    105 demo = dict(effect_radius = 200,volfraction = 0.2,effect_radius_pd = 0.1,effect_radius_pd_n = 40) 
     103demo = dict(effect_radius=200, volfraction=0.2, effect_radius_pd=0.1, effect_radius_pd_n=40) 
    106104oldname = 'HardsphereStructure' 
    107105oldpars = dict() 
  • sasmodels/models/lamellar.py

    r3c56da87 r3e428ec  
    5252title = "Lyotropic lamellar phase with uniform SLD and random distribution" 
    5353description = """\ 
    54         [Dilute Lamellar Form Factor](from a lyotropic lamellar phase) 
    55                 I(q)= 2*pi*P(q)/(delta *q^(2)), where 
    56                 P(q)=2*(contrast/q)^(2)*(1-cos(q*delta))^(2)) 
    57                 thickness = layer thickness 
    58                 sld = layer scattering length density 
    59                 sld_solvent = solvent scattering length density 
    60                 background = incoherent background 
    61                 scale = scale factor 
     54    [Dilute Lamellar Form Factor](from a lyotropic lamellar phase) 
     55        I(q)= 2*pi*P(q)/(delta *q^(2)), where 
     56        P(q)=2*(contrast/q)^(2)*(1-cos(q*delta))^(2)) 
     57        thickness = layer thickness 
     58        sld = layer scattering length density 
     59        sld_solvent = solvent scattering length density 
     60        background = incoherent background 
     61        scale = scale factor 
    6262""" 
    6363category = "shape:lamellae" 
    6464 
    65 parameters = [ 
    66 #   [ "name", "units", default, [lower, upper], "type", 
    67 #     "description" ], 
    68     [ "sld", "1e-6/Ang^2", 1, [-inf,inf], "", 
    69       "Layer scattering length density" ], 
    70     [ "solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "", 
    71       "Solvent scattering length density" ], 
    72     [ "thickness", "Ang",  50, [0, inf], "volume", 
    73       "Bilayer thickness" ], 
    74     ] 
     65#             ["name", "units", default, [lower, upper], "type","description"], 
     66parameters = [["sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
     67               "Layer scattering length density" ], 
     68              ["solvent_sld", "1e-6/Ang^2", 6, [-inf, inf], "", 
     69               "Solvent scattering length density" ], 
     70              ["thickness", "Ang", 50, [0, inf], "volume","Bilayer thickness" ], 
     71             ] 
    7572 
    7673 
     
    9592# VR defaults to 1.0 
    9693 
    97 demo = dict( 
    98         scale=1, background=0, 
    99         sld=6, solvent_sld=1, 
    100         thickness=40, 
    101         thickness_pd= 0.2, thickness_pd_n=40, 
    102         ) 
     94demo = dict(scale=1, background=0, 
     95            sld=6, solvent_sld=1, 
     96            thickness=40, 
     97            thickness_pd=0.2, thickness_pd_n=40) 
    10398oldname = 'LamellarModel' 
    10499oldpars = dict(sld='sld_bi', solvent_sld='sld_sol', thickness='bi_thick') 
  • sasmodels/models/lamellarCaille.py

    r3c56da87 r3e428ec  
    8585category = "shape:lamellae" 
    8686 
    87 parameters = [ 
    88 #   [ "name", "units", default, [lower, upper], "type", 
    89 #     "description" ], 
    90     [ "thickness", "Ang",  30.0, [0, inf], "volume", 
    91       "sheet thickness" ], 
    92     [ "Nlayers", "",  20, [0, inf], "", 
    93       "Number of layers" ], 
    94     [ "spacing", "Ang", 400., [0.0,inf], "volume", 
    95       "d-spacing of Caille S(Q)" ], 
    96     [ "Caille_parameter", "1/Ang^2", 0.1, [0.0,0.8], "", 
    97       "Caille parameter" ], 
    98     [ "sld", "1e-6/Ang^2", 6.3, [-inf,inf], "", 
    99       "layer scattering length density" ], 
    100     [ "solvent_sld", "1e-6/Ang^2", 1.0, [-inf,inf], "", 
    101       "Solvent scattering length density" ], 
    102     ] 
     87#             ["name", "units", default, [lower, upper], "type","description"], 
     88parameters = [["thickness", "Ang",  30.0, [0, inf], "volume", "sheet thickness"], 
     89              ["Nlayers", "",  20, [0, inf], "", "Number of layers"], 
     90              ["spacing", "Ang", 400., [0.0,inf], "volume", "d-spacing of Caille S(Q)"], 
     91              ["Caille_parameter", "1/Ang^2", 0.1, [0.0,0.8], "", "Caille parameter"], 
     92              ["sld", "1e-6/Ang^2", 6.3, [-inf,inf], "", 
     93               "layer scattering length density"], 
     94              ["solvent_sld", "1e-6/Ang^2", 1.0, [-inf,inf], "", 
     95               "Solvent scattering length density"], 
     96             ] 
    10397 
    104 source = [ "lamellarCaille_kernel.c"] 
     98source = ["lamellarCaille_kernel.c"] 
    10599 
    106100# No volume normalization despite having a volume parameter 
     
    117111# VR defaults to 1.0 
    118112 
    119 demo = dict( 
    120         scale=1, background=0, 
    121                 thickness=67.,Nlayers=3.75,spacing=200., 
    122         Caille_parameter=0.268,sld=1.0, solvent_sld=6.34, 
    123                 thickness_pd= 0.1, thickness_pd_n=100, 
    124                 spacing_pd= 0.05, spacing_pd_n=40 
    125          ) 
     113demo = dict(scale=1, background=0, 
     114            thickness=67.,Nlayers=3.75,spacing=200., 
     115            Caille_parameter=0.268,sld=1.0, solvent_sld=6.34, 
     116            thickness_pd= 0.1, thickness_pd_n=100, 
     117            spacing_pd= 0.05, spacing_pd_n=40) 
    126118 
    127119oldname = 'LamellarPSModel' 
    128 oldpars = dict(thickness='delta',Nlayers='N_plates',Caille_parameter='caille', sld='sld_bi',solvent_sld='sld_sol') 
     120oldpars = dict(thickness='delta', Nlayers='N_plates', Caille_parameter='caille', 
     121               sld='sld_bi',solvent_sld='sld_sol') 
  • sasmodels/models/lamellarCailleHG.py

    r3c56da87 r3e428ec  
    7979title = "Random lamellar sheet with Caille structure factor" 
    8080description = """\ 
    81         [Random lamellar phase with Caille  structure factor] 
     81    [Random lamellar phase with Caille  structure factor] 
    8282        randomly oriented stacks of infinite sheets 
    83                 with Caille S(Q), having polydisperse spacing. 
    84                 layer thickness =(H+T+T+H) = 2(Head+Tail) 
    85                 sld = Tail scattering length density 
    86                 sld_head = Head scattering length density 
    87                 sld_solvent = solvent scattering length density 
    88                 background = incoherent background 
    89                 scale = scale factor 
     83        with Caille S(Q), having polydisperse spacing. 
     84        layer thickness =(H+T+T+H) = 2(Head+Tail) 
     85        sld = Tail scattering length density 
     86        sld_head = Head scattering length density 
     87        sld_solvent = solvent scattering length density 
     88        background = incoherent background 
     89        scale = scale factor 
    9090""" 
    9191category = "shape:lamellae" 
    9292 
    9393parameters = [ 
    94 #   [ "name", "units", default, [lower, upper], "type", 
    95 #     "description" ], 
    96     [ "tail_length", "Ang",  10, [0, inf], "volume", 
    97       "Tail thickness" ], 
    98     [ "head_length", "Ang",  2, [0, inf], "volume", 
    99       "head thickness" ], 
    100     [ "Nlayers", "",  30, [0, inf], "", 
    101       "Number of layers" ], 
    102     [ "spacing", "Ang", 40., [0.0,inf], "volume", 
    103       "d-spacing of Caille S(Q)" ], 
    104     [ "Caille_parameter", "", 0.001, [0.0,0.8], "", 
    105       "Caille parameter" ], 
    106     [ "sld", "1e-6/Ang^2", 0.4, [-inf,inf], "", 
    107       "Tail scattering length density" ], 
    108     [ "head_sld", "1e-6/Ang^2", 2.0, [-inf,inf], "", 
    109       "Head scattering length density" ], 
    110     [ "solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "", 
    111       "Solvent scattering length density" ], 
     94              #   [ "name", "units", default, [lower, upper], "type", 
     95              #     "description" ], 
     96              [ "tail_length", "Ang",  10, [0, inf], "volume", 
     97                "Tail thickness" ], 
     98              [ "head_length", "Ang",  2, [0, inf], "volume", 
     99                "head thickness" ], 
     100              [ "Nlayers", "",  30, [0, inf], "", 
     101                "Number of layers" ], 
     102              [ "spacing", "Ang", 40., [0.0,inf], "volume", 
     103                "d-spacing of Caille S(Q)" ], 
     104              [ "Caille_parameter", "", 0.001, [0.0,0.8], "", 
     105                "Caille parameter" ], 
     106              [ "sld", "1e-6/Ang^2", 0.4, [-inf,inf], "", 
     107                "Tail scattering length density" ], 
     108              [ "head_sld", "1e-6/Ang^2", 2.0, [-inf,inf], "", 
     109                "Head scattering length density" ], 
     110              [ "solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "", 
     111                "Solvent scattering length density" ], 
    112112    ] 
    113113 
     
    128128 
    129129demo = dict( 
    130         scale=1, background=0, 
    131         Nlayers=20, 
    132         spacing=200., Caille_parameter=0.05, 
    133         tail_length=15,head_length=10, 
    134         #sld=-1, head_sld=4.0, solvent_sld=6.0, 
    135         sld=-1, head_sld=4.1, solvent_sld=6.0, 
    136         tail_length_pd= 0.1, tail_length_pd_n=20, 
    137         head_length_pd= 0.05, head_length_pd_n=30, 
    138         spacing_pd= 0.2, spacing_pd_n=40 
    139    ) 
     130            scale=1, background=0, 
     131            Nlayers=20, 
     132            spacing=200., Caille_parameter=0.05, 
     133            tail_length=15,head_length=10, 
     134            #sld=-1, head_sld=4.0, solvent_sld=6.0, 
     135            sld=-1, head_sld=4.1, solvent_sld=6.0, 
     136            tail_length_pd= 0.1, tail_length_pd_n=20, 
     137            head_length_pd= 0.05, head_length_pd_n=30, 
     138            spacing_pd= 0.2, spacing_pd_n=40 
     139           ) 
    140140 
    141141oldname = 'LamellarPSHGModel' 
  • sasmodels/models/lamellarFFHG.py

    r3c56da87 r3e428ec  
    5353title = "Random lamellar phase with Head Groups " 
    5454description = """\ 
    55         [Random lamellar phase with Head Groups] 
    56                 I(q)= 2*pi*P(q)/(2(H+T)*q^(2)), where 
    57                 P(q)= see manual 
    58                 layer thickness =(H+T+T+H) = 2(Head+Tail) 
    59                 sld = Tail scattering length density 
    60                 sld_head = Head scattering length density 
    61                 sld_solvent = solvent scattering length density 
    62                 background = incoherent background 
    63                 scale = scale factor 
     55    [Random lamellar phase with Head Groups] 
     56        I(q)= 2*pi*P(q)/(2(H+T)*q^(2)), where 
     57        P(q)= see manual 
     58        layer thickness =(H+T+T+H) = 2(Head+Tail) 
     59        sld = Tail scattering length density 
     60        sld_head = Head scattering length density 
     61        sld_solvent = solvent scattering length density 
     62        background = incoherent background 
     63        scale = scale factor 
    6464""" 
    6565category = "shape:lamellae" 
    6666 
    67 parameters = [ 
    68 #   [ "name", "units", default, [lower, upper], "type", 
    69 #     "description" ], 
    70     [ "tail_length", "Ang",  15, [0, inf], "volume", 
    71       "Tail thickness" ], 
    72     [ "head_length", "Ang",  10, [0, inf], "volume", 
    73       "head thickness" ], 
    74     [ "sld", "1e-6/Ang^2", 0.4, [-inf,inf], "", 
    75       "Tail scattering length density" ], 
    76     [ "head_sld", "1e-6/Ang^2", 3.0, [-inf,inf], "", 
    77       "Head scattering length density" ], 
    78     [ "solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "", 
    79       "Solvent scattering length density" ], 
    80     ] 
     67#             ["name", "units", default, [lower, upper], "type","description"], 
     68parameters = [["tail_length", "Ang",  15, [0, inf], "volume", 
     69               "Tail thickness"], 
     70              ["head_length", "Ang",  10, [0, inf], "volume", 
     71               "head thickness"], 
     72              ["sld", "1e-6/Ang^2", 0.4, [-inf,inf], "", 
     73               "Tail scattering length density"], 
     74              ["head_sld", "1e-6/Ang^2", 3.0, [-inf,inf], "", 
     75               "Head scattering length density"], 
     76              ["solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "", 
     77               "Solvent scattering length density"], 
     78             ] 
    8179 
    8280# No volume normalization despite having a volume parameter 
     
    111109# VR defaults to 1.0 
    112110 
    113 demo = dict( 
    114     scale=1, background=0, 
    115     tail_length=15,head_length=10, 
    116     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, 
    119     ) 
     111demo = dict(scale=1, background=0, 
     112            tail_length=15,head_length=10, 
     113            sld=0.4, head_sld=3.0, solvent_sld=6.0, 
     114            tail_length_pd= 0.2, tail_length_pd_n=40, 
     115            head_length_pd= 0.01, head_length_pd_n=40) 
    120116 
    121117oldname = 'LamellarFFHGModel' 
  • sasmodels/models/lamellarPC.py

    r3c56da87 r3e428ec  
    7272title = "Random lamellar sheet with paracrystal structure factor" 
    7373description = """\ 
    74         [Random lamellar phase with paracrystal structure factor] 
     74    [Random lamellar phase with paracrystal structure factor] 
    7575        randomly oriented stacks of infinite sheets 
    76                 with paracrytal S(Q), having polydisperse spacing. 
    77         sld = sheet scattering length density 
    78                 sld_solvent = solvent scattering length density 
    79                 background = incoherent background 
    80                 scale = scale factor 
     76        with paracrytal S(Q), having polydisperse spacing. 
     77        sld = sheet scattering length density 
     78        sld_solvent = solvent scattering length density 
     79        background = incoherent background 
     80        scale = scale factor 
    8181""" 
    8282category = "shape:lamellae" 
    8383 
    84 parameters = [ 
    85 #   [ "name", "units", default, [lower, upper], "type", 
    86 #     "description" ], 
    87     [ "thickness", "Ang",  33.0, [0, inf], "volume", 
    88       "sheet thickness" ], 
    89     [ "Nlayers", "",  20, [0, inf], "", 
    90       "Number of layers" ], 
    91     [ "spacing", "Ang", 250., [0.0,inf], "", 
    92       "d-spacing of paracrystal stack" ], 
    93     [ "spacing_polydisp", "Ang", 0.0, [0.0,inf], "", 
    94       "d-spacing of paracrystal stack" ], 
    95     [ "sld", "1e-6/Ang^2", 1.0, [-inf,inf], "", 
    96       "layer scattering length density" ], 
    97     [ "solvent_sld", "1e-6/Ang^2", 6.34, [-inf,inf], "", 
    98       "Solvent scattering length density" ], 
    99     ] 
     84#             ["name", "units", default, [lower, upper], "type","description"], 
     85parameters = [["thickness", "Ang", 33.0, [0, inf], "volume", 
     86               "sheet thickness"], 
     87              ["Nlayers", "", 20, [0, inf], "", 
     88               "Number of layers"], 
     89              ["spacing", "Ang", 250., [0.0, inf], "", 
     90               "d-spacing of paracrystal stack"], 
     91              ["spacing_polydisp", "Ang", 0.0, [0.0, inf], "", 
     92               "d-spacing of paracrystal stack"], 
     93              ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", 
     94               "layer scattering length density"], 
     95              ["solvent_sld", "1e-6/Ang^2", 6.34, [-inf, inf], "", 
     96               "Solvent scattering length density"], 
     97             ] 
    10098 
    10199 
    102 source = [ "lamellarPC_kernel.c"] 
     100source = ["lamellarPC_kernel.c"] 
    103101 
    104102form_volume = """ 
     
    113111# VR defaults to 1.0 
    114112 
    115 demo = dict( 
    116     scale=1, background=0, 
    117     thickness=33, Nlayers=20, spacing=250, spacing_polydisp=0.2, 
    118     sld=1.0, solvent_sld=6.34, 
    119     thickness_pd= 0.2, thickness_pd_n=40 
    120     ) 
     113demo = dict(scale=1, background=0, 
     114            thickness=33, Nlayers=20, spacing=250, spacing_polydisp=0.2, 
     115            sld=1.0, solvent_sld=6.34, 
     116            thickness_pd=0.2, thickness_pd_n=40) 
    121117 
    122118oldname = 'LamellarPCrystalModel' 
    123 oldpars = dict( 
    124     spacing_polydisp='pd_spacing', sld='sld_layer', 
    125     solvent_sld='sld_solvent' 
    126     ) 
    127  
    128  
     119oldpars = dict(spacing_polydisp='pd_spacing', sld='sld_layer', 
     120               solvent_sld='sld_solvent') 
  • sasmodels/models/parallelepiped.py

    r33e91b1 r3e428ec  
    116116category = "shape:parallelpiped" 
    117117 
    118 parameters = [ 
    119     #   [ "name", "units", default, [lower, upper], "type", 
    120     #     "description" ], 
    121     ["sld", "1e-6/Ang^2", 4, [-inf, inf], "", 
    122      "Parallelepiped scattering length density"], 
    123     ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
    124      "Solvent scattering length density"], 
    125     ["a_side", "Ang", 35, [0, inf], "volume", 
    126      "Shorter side of the parallelepiped"], 
    127     ["b_side", "Ang", 75, [0, inf], "volume", 
    128      "Second side of the parallelepiped"], 
    129     ["c_side", "Ang", 400, [0, inf], "volume", 
    130      "Larger side of the parallelepiped"], 
    131     ["theta", "degrees", 60, [-inf, inf], "orientation", 
    132      "In plane angle"], 
    133     ["phi", "degrees", 60, [-inf, inf], "orientation", 
    134      "Out of plane angle"], 
    135     ["psi", "degrees", 60, [-inf, inf], "orientation", 
    136      "Rotation angle around its own c axis against q plane"], 
    137     ] 
     118#             ["name", "units", default, [lower, upper], "type","description"], 
     119parameters = [["sld", "1e-6/Ang^2", 4, [-inf, inf], "", 
     120               "Parallelepiped scattering length density"], 
     121              ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
     122               "Solvent scattering length density"], 
     123              ["a_side", "Ang", 35, [0, inf], "volume", 
     124               "Shorter side of the parallelepiped"], 
     125              ["b_side", "Ang", 75, [0, inf], "volume", 
     126               "Second side of the parallelepiped"], 
     127              ["c_side", "Ang", 400, [0, inf], "volume", 
     128               "Larger side of the parallelepiped"], 
     129              ["theta", "degrees", 60, [-inf, inf], "orientation", 
     130               "In plane angle"], 
     131              ["phi", "degrees", 60, [-inf, inf], "orientation", 
     132               "Out of plane angle"], 
     133              ["psi", "degrees", 60, [-inf, inf], "orientation", 
     134               "Rotation angle around its own c axis against q plane"], 
     135             ] 
    138136 
    139137source = ["lib/J1.c", "lib/gauss76.c", "parallelepiped.c"] 
     
    154152 
    155153# parameters for demo 
    156 demo = dict( 
    157     scale=1, background=0, 
    158     sld=6.3e-6, solvent_sld=1.0e-6, 
    159     a_side=35, b_side=75, c_side=400, 
    160     theta=45, phi=30, psi=15, 
    161     a_side_pd=0.1, a_side_pd_n=10, 
    162     b_side_pd=0.1, b_side_pd_n=1, 
    163     c_side_pd=0.1, c_side_pd_n=10, 
    164     theta_pd=10, theta_pd_n=1, 
    165     phi_pd=10, phi_pd_n=1, 
    166     psi_pd=10, psi_pd_n=10, 
    167     ) 
     154demo = dict(scale=1, background=0, 
     155            sld=6.3e-6, solvent_sld=1.0e-6, 
     156            a_side=35, b_side=75, c_side=400, 
     157            theta=45, phi=30, psi=15, 
     158            a_side_pd=0.1, a_side_pd_n=10, 
     159            b_side_pd=0.1, b_side_pd_n=1, 
     160            c_side_pd=0.1, c_side_pd_n=10, 
     161            theta_pd=10, theta_pd_n=1, 
     162            phi_pd=10, phi_pd_n=1, 
     163            psi_pd=10, psi_pd_n=10) 
    168164 
    169165# For testing against the old sasview models, include the converted parameter 
  • sasmodels/models/sphere.py

    r3c56da87 r3e428ec  
    7272category = "shape:sphere" 
    7373 
    74 parameters = [ 
    75 #   [ "name", "units", default, [lower, upper], "type", 
    76 #     "description" ], 
    77     [ "sld", "1e-6/Ang^2", 1, [-inf,inf], "", 
    78       "Layer scattering length density" ], 
    79     [ "solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "", 
    80       "Solvent scattering length density" ], 
    81     [ "radius", "Ang",  50, [0, inf], "volume", 
    82       "Sphere radius" ], 
    83     ] 
     74#             ["name", "units", default, [lower, upper], "type","description"], 
     75parameters = [["sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
     76               "Layer scattering length density"], 
     77              ["solvent_sld", "1e-6/Ang^2", 6, [-inf, inf], "", 
     78               "Solvent scattering length density"], 
     79              ["radius", "Ang", 50, [0, inf], "volume", 
     80               "Sphere radius"], 
     81             ] 
    8482 
    8583 
     
    111109# VR defaults to 1.0 
    112110 
    113 demo = dict( 
    114         scale=1, background=0, 
    115         sld=6, solvent_sld=1, 
    116         radius=120, 
    117         radius_pd=.2, radius_pd_n=45, 
    118         ) 
     111demo = dict(scale=1, background=0, 
     112            sld=6, solvent_sld=1, 
     113            radius=120, 
     114            radius_pd=.2, radius_pd_n=45) 
    119115oldname = "SphereModel" 
    120116oldpars = dict(sld='sldSph', solvent_sld='sldSolv', radius='radius') 
  • sasmodels/models/spherepy.py

    r3c56da87 r3e428ec  
    7373category = "shape:sphere" 
    7474 
    75 parameters = [ 
    76 #   [ "name", "units", default, [lower, upper], "type", 
    77 #     "description" ], 
    78     [ "sld", "1e-6/Ang^2", 1, [-inf,inf], "", 
    79       "Layer scattering length density" ], 
    80     [ "solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "", 
    81       "Solvent scattering length density" ], 
    82     [ "radius", "Ang",  50, [0, inf], "volume", 
    83       "Sphere radius" ], 
    84     ] 
     75#             ["name", "units", default, [lower, upper], "type","description"], 
     76parameters = [["sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
     77               "Layer scattering length density"], 
     78              ["solvent_sld", "1e-6/Ang^2", 6, [-inf, inf], "", 
     79               "Solvent scattering length density"], 
     80              ["radius", "Ang", 50, [0, inf], "volume", 
     81               "Sphere radius"], 
     82             ] 
    8583 
    8684 
    8785def form_volume(radius): 
    88     return 1.333333333333333*pi*radius**3 
     86    return 1.333333333333333 * pi * radius ** 3 
    8987 
    9088def Iq(q, sld, solvent_sld, radius): 
    9189    #print "q",q 
    9290    #print "sld,r",sld,solvent_sld,radius 
    93     qr = q*radius 
     91    qr = q * radius 
    9492    sn, cn = sin(qr), cos(qr) 
    9593    # FOR VECTORIZED VERSION, UNCOMMENT THE NEXT TWO LINES 
    96     bes = 3 * (sn-qr*cn)/qr**3 # may be 0/0 but we fix that next line 
    97     bes[qr==0] = 1 
     94    bes = 3 * (sn - qr * cn) / qr ** 3 # may be 0/0 but we fix that next line 
     95    bes[qr == 0] = 1 
    9896    # FOR NON VECTORIZED VERSION, UNCOMMENT THE NEXT LINE 
    9997    #bes = 3 * (sn-qr*cn)/qr**3 if qr>0 else 1 
    10098    fq = bes * (sld - solvent_sld) * form_volume(radius) 
    101     return 1.0e-4*fq**2 
     99    return 1.0e-4 * fq ** 2 
    102100# FOR VECTORIZED VERSION, UNCOMMENT THE NEXT LINE 
    103101Iq.vectorized = True 
    104102 
    105103def Iqxy(qx, qy, sld, solvent_sld, radius): 
    106     return Iq(sqrt(qx**2 + qy**2), sld, solvent_sld, radius) 
     104    return Iq(sqrt(qx ** 2 + qy ** 2), sld, solvent_sld, radius) 
    107105Iqxy.vectorized = True 
    108106 
     
    113111    Wim Bouwman after formulae Timofei Kruglov J.Appl.Cryst. 2003 article 
    114112    """ 
    115     d = z/radius 
     113    d = z / radius 
    116114    g = np.zeros_like(z) 
    117     g[d==0] = 1. 
     115    g[d == 0] = 1. 
    118116    low = ((d > 0) & (d < 2)) 
    119117    dlow = d[low] 
    120     dlow2 = dlow**2 
    121     g[low] = sqrt(1-dlow2/4.)*(1+dlow2/8.) + dlow2/2.*(1-dlow2/16.)*log(dlow/(2.+sqrt(4.-dlow2))) 
     118    dlow2 = dlow ** 2 
     119    g[low] = sqrt(1 - dlow2 / 4.) * (1 + dlow2 / 8.) + dlow2 / 2.*(1 - dlow2 / 16.) * log(dlow / (2. + sqrt(4. - dlow2))) 
    122120    return g 
    123121sesans.vectorized = True 
     
    128126# VR defaults to 1.0 
    129127 
    130 demo = dict( 
    131     scale=1, background=0, 
    132     sld=6, solvent_sld=1, 
    133     radius=120, 
    134     radius_pd=.2, radius_pd_n=45, 
    135     ) 
     128demo = dict(scale=1, background=0, 
     129            sld=6, solvent_sld=1, 
     130            radius=120, 
     131            radius_pd=.2, radius_pd_n=45) 
    136132oldname = "SphereModel" 
    137133oldpars = dict(sld='sldSph', solvent_sld='sldSolv', radius='radius') 
  • sasmodels/models/stickyhardsphere.py

    r3c56da87 r3e428ec  
    7676title = "Sticky hard sphere structure factor, with Percus-Yevick closure" 
    7777description = """\ 
    78         [Sticky hard sphere structure factor, with Percus-Yevick closure] 
     78    [Sticky hard sphere structure factor, with Percus-Yevick closure] 
    7979        Interparticle structure factor S(Q)for a hard sphere fluid with 
    80                 a narrow attractive well. Fits are prone to deliver non-physical 
    81                 parameters, use with care and read the references in the full manual. 
    82                 In sasview the effective radius will be calculated from the 
    83                 parameters used in P(Q). 
     80        a narrow attractive well. Fits are prone to deliver non-physical 
     81        parameters, use with care and read the references in the full manual. 
     82        In sasview the effective radius will be calculated from the 
     83        parameters used in P(Q). 
    8484""" 
    8585category = "structure-factor" 
    8686 
     87#             ["name", "units", default, [lower, upper], "type","description"], 
    8788parameters = [ 
    8889    #   [ "name", "units", default, [lower, upper], "type", 
     
    126127    if(radic<0) { 
    127128        //if(x>0.01 && x<0.015) 
    128         //      Print "Lambda unphysical - both roots imaginary" 
     129        //    Print "Lambda unphysical - both roots imaginary" 
    129130        //endif 
    130131        return(-1.0); 
  • sasmodels/models/triaxial_ellipsoid.py

    r3c56da87 r3e428ec  
    102102category = "shape:ellipsoid" 
    103103 
    104 parameters = [ 
    105 #   [ "name", "units", default, [lower, upper], "type", 
    106 #     "description" ], 
    107     [ "sld", "1e-6/Ang^2", 4, [-inf,inf], "", 
    108       "Ellipsoid scattering length density" ], 
    109     [ "solvent_sld", "1e-6/Ang^2", 1, [-inf,inf], "", 
    110       "Solvent scattering length density" ], 
    111     [ "req_minor", "Ang",  20, [0, inf], "volume", 
    112       "Minor equitorial radius" ], 
    113     [ "req_major", "Ang",  400, [0, inf], "volume", 
    114       "Major equatorial radius" ], 
    115     [ "rpolar", "Ang",  10, [0, inf], "volume", 
    116       "Polar radius" ], 
    117     [ "theta", "degrees", 60, [-inf, inf], "orientation", 
    118       "In plane angle" ], 
    119     [ "phi", "degrees", 60, [-inf, inf], "orientation", 
    120       "Out of plane angle" ], 
    121     [ "psi", "degrees", 60, [-inf, inf], "orientation", 
    122       "Out of plane angle" ], 
    123     ] 
     104#             ["name", "units", default, [lower, upper], "type","description"], 
     105parameters = [["sld", "1e-6/Ang^2", 4, [-inf, inf], "", 
     106               "Ellipsoid scattering length density"], 
     107              ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
     108               "Solvent scattering length density"], 
     109              ["req_minor", "Ang", 20, [0, inf], "volume", 
     110               "Minor equitorial radius"], 
     111              ["req_major", "Ang", 400, [0, inf], "volume", 
     112               "Major equatorial radius"], 
     113              ["rpolar", "Ang", 10, [0, inf], "volume", 
     114               "Polar radius"], 
     115              ["theta", "degrees", 60, [-inf, inf], "orientation", 
     116               "In plane angle"], 
     117              ["phi", "degrees", 60, [-inf, inf], "orientation", 
     118               "Out of plane angle"], 
     119              ["psi", "degrees", 60, [-inf, inf], "orientation", 
     120               "Out of plane angle"], 
     121             ] 
    124122 
    125 source = [ "lib/J1.c", "lib/gauss76.c", "triaxial_ellipsoid.c"] 
     123source = ["lib/J1.c", "lib/gauss76.c", "triaxial_ellipsoid.c"] 
    126124 
    127125def ER(req_minor, req_major, rpolar): 
    128126    import numpy as np 
    129127    from .ellipsoid import ER as ellipsoid_ER 
    130     return ellipsoid_ER(rpolar, np.sqrt(req_minor*req_major)) 
     128    return ellipsoid_ER(rpolar, np.sqrt(req_minor * req_major)) 
    131129 
    132 demo = dict( 
    133         scale=1, background=0, 
    134         sld=6, solvent_sld=1, 
    135         theta=30, phi=15, psi=5, 
    136         req_minor=25, req_major=36, rpolar=50, 
    137         req_minor_pd=0, req_minor_pd_n=1, 
    138         req_major_pd=0, req_major_pd_n=1, 
    139         rpolar_pd=.2, rpolar_pd_n=30, 
    140         theta_pd=15, theta_pd_n=45, 
    141         phi_pd=15, phi_pd_n=1, 
    142         psi_pd=15, psi_pd_n=1, 
    143         ) 
     130demo = dict(scale=1, background=0, 
     131            sld=6, solvent_sld=1, 
     132            theta=30, phi=15, psi=5, 
     133            req_minor=25, req_major=36, rpolar=50, 
     134            req_minor_pd=0, req_minor_pd_n=1, 
     135            req_major_pd=0, req_major_pd_n=1, 
     136            rpolar_pd=.2, rpolar_pd_n=30, 
     137            theta_pd=15, theta_pd_n=45, 
     138            phi_pd=15, phi_pd_n=1, 
     139            psi_pd=15, psi_pd_n=1) 
    144140oldname = 'TriaxialEllipsoidModel' 
    145141oldpars = dict(theta='axis_theta', phi='axis_phi', psi='axis_psi', 
    146                sld='sldEll',  solvent_sld='sldSolv', 
     142               sld='sldEll', solvent_sld='sldSolv', 
    147143               req_minor='semi_axisA', req_major='semi_axisB', 
    148144               rpolar='semi_axisC') 
Note: See TracChangeset for help on using the changeset viewer.