Changeset 49da079 in sasmodels


Ignore:
Timestamp:
Mar 21, 2016 5:53:21 AM (9 years ago)
Author:
richardh
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:
5430333
Parents:
1e9a108
Message:

sld name changes, hide experimental spherepy.py from docs by rename to _spherepy.py

Location:
sasmodels/models
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • sasmodels/models/_spherepy.py

    raa2edb2 r49da079  
    1717where *scale* is a volume fraction, $V$ is the volume of the scatterer, 
    1818$r$ is the radius of the sphere, *background* is the background level and 
    19 *sld* and *solvent_sld* are the scattering length densities (SLDs) of the 
     19*sld* and *sld_solvent* are the scattering length densities (SLDs) of the 
    2020scatterer and the solvent respectively. 
    2121 
     
    4747from numpy import pi, inf, sin, cos, sqrt, log 
    4848 
    49 name = "sphere (python)" 
    50 title = "Spheres with uniform scattering length density" 
     49name = " _sphere (python)" 
     50title = "PAK testing ideas for Spheres with uniform scattering length density" 
    5151description = """\ 
    52 P(q)=(scale/V)*[3V(sld-solvent_sld)*(sin(qr)-qr cos(qr)) 
     52P(q)=(scale/V)*[3V(sld-sld_solvent)*(sin(qr)-qr cos(qr)) 
    5353                /(qr)^3]^2 + background 
    5454    r: radius of sphere 
    5555    V: The volume of the scatter 
    5656    sld: the SLD of the sphere 
    57     solvent_sld: the SLD of the solvent 
     57    sld_solvent: the SLD of the solvent 
    5858""" 
    5959category = "shape:sphere" 
     
    6262parameters = [["sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
    6363               "Layer scattering length density"], 
    64               ["solvent_sld", "1e-6/Ang^2", 6, [-inf, inf], "", 
     64              ["sld_solvent", "1e-6/Ang^2", 6, [-inf, inf], "", 
    6565               "Solvent scattering length density"], 
    6666              ["radius", "Ang", 50, [0, inf], "volume", 
     
    7272    return 1.333333333333333 * pi * radius ** 3 
    7373 
    74 def Iq(q, sld, solvent_sld, radius): 
     74def Iq(q, sld, sld_solvent, radius): 
    7575    #print "q",q 
    76     #print "sld,r",sld,solvent_sld,radius 
     76    #print "sld,r",sld,sld_solvent,radius 
    7777    qr = q * radius 
    7878    sn, cn = sin(qr), cos(qr) 
     
    8585    bes = 3 * (sn - qr * cn) / qr ** 3 # may be 0/0 but we fix that next line 
    8686    bes[qr == 0] = 1 
    87     fq = bes * (sld - solvent_sld) * form_volume(radius) 
     87    fq = bes * (sld - sld_solvent) * form_volume(radius) 
    8888    return 1.0e-4 * fq ** 2 
    8989Iq.vectorized = True  # Iq accepts an array of q values 
    9090 
    91 def Iqxy(qx, qy, sld, solvent_sld, radius): 
    92     return Iq(sqrt(qx ** 2 + qy ** 2), sld, solvent_sld, radius) 
     91def Iqxy(qx, qy, sld, sld_solvent, radius): 
     92    return Iq(sqrt(qx ** 2 + qy ** 2), sld, sld_solvent, radius) 
    9393Iqxy.vectorized = True  # Iqxy accepts arrays of qx, qy values 
    9494 
    95 def sesans(z, sld, solvent_sld, radius): 
     95def sesans(z, sld, sld_solvent, radius): 
    9696    """ 
    9797    Calculate SESANS-correlation function for a solid sphere. 
     
    115115 
    116116demo = dict(scale=1, background=0, 
    117             sld=6, solvent_sld=1, 
     117            sld=6, sld_solvent=1, 
    118118            radius=120, 
    119119            radius_pd=.2, radius_pd_n=45) 
    120120oldname = "SphereModel" 
    121 oldpars = dict(sld='sldSph', solvent_sld='sldSolv', radius='radius') 
     121oldpars = dict(sld='sldSph', sld_solvent='sldSolv', radius='radius') 
  • sasmodels/models/sphere.py

    raa2edb2 r49da079  
    1717where *scale* is a volume fraction, $V$ is the volume of the scatterer, 
    1818$r$ is the radius of the sphere, *background* is the background level and 
    19 *sld* and *solvent_sld* are the scattering length densities (SLDs) of the 
     19*sld* and *sld_solvent* are the scattering length densities (SLDs) of the 
    2020scatterer and the solvent respectively. 
    2121 
     
    4949title = "Spheres with uniform scattering length density" 
    5050description = """\ 
    51 P(q)=(scale/V)*[3V(sld-solvent_sld)*(sin(qr)-qr cos(qr)) 
     51P(q)=(scale/V)*[3V(sld-sld_solvent)*(sin(qr)-qr cos(qr)) 
    5252                /(qr)^3]^2 + background 
    5353    r: radius of sphere 
    5454    V: The volume of the scatter 
    5555    sld: the SLD of the sphere 
    56     solvent_sld: the SLD of the solvent 
     56    sld_solvent: the SLD of the solvent 
    5757""" 
    5858category = "shape:sphere" 
     
    6161parameters = [["sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
    6262               "Layer scattering length density"], 
    63               ["solvent_sld", "1e-6/Ang^2", 6, [-inf, inf], "", 
     63              ["sld_solvent", "1e-6/Ang^2", 6, [-inf, inf], "", 
    6464               "Solvent scattering length density"], 
    6565              ["radius", "Ang", 50, [0, inf], "volume", 
     
    7676 
    7777Iq = """ 
    78     return sphere_form(q, radius, sld, solvent_sld); 
     78    return sphere_form(q, radius, sld, sld_solvent); 
    7979    """ 
    8080 
     
    8282    // never called since no orientation or magnetic parameters. 
    8383    //return -1.0; 
    84     return Iq(sqrt(qx*qx + qy*qy), sld, solvent_sld, radius); 
     84    return Iq(sqrt(qx*qx + qy*qy), sld, sld_solvent, radius); 
    8585    """ 
    8686 
     
    9494 
    9595demo = dict(scale=1, background=0, 
    96             sld=6, solvent_sld=1, 
     96            sld=6, sld_solvent=1, 
    9797            radius=120, 
    9898            radius_pd=.2, radius_pd_n=45) 
    9999oldname = "SphereModel" 
    100 oldpars = dict(sld='sldSph', solvent_sld='sldSolv', radius='radius') 
     100oldpars = dict(sld='sldSph', sld_solvent='sldSolv', radius='radius') 
  • sasmodels/models/triaxial_ellipsoid.py

    r6ef4293 r49da079  
    9191               "Solvent scattering length density"], 
    9292              ["req_minor", "Ang", 20, [0, inf], "volume", 
    93                "Minor equitorial radius"], 
     93               "Minor equatorial radius"], 
    9494              ["req_major", "Ang", 400, [0, inf], "volume", 
    9595               "Major equatorial radius"], 
Note: See TracChangeset for help on using the changeset viewer.