Changeset 68532f3 in sasmodels for _sources/model/sphere.txt
- Timestamp:
- Nov 1, 2015 2:10:22 PM (8 years ago)
- Branches:
- gh-pages
- Children:
- 4a9a316
- Parents:
- d1fe925
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
_sources/model/sphere.txt
rd1fe925 r68532f3 1 r""" 1 .. _sphere: 2 3 Sphere 4 ======================================================= 5 6 Spheres with uniform scattering length density 7 8 =========== ================================= ============ ============= 9 Parameter Description Units Default value 10 =========== ================================= ============ ============= 11 scale Source intensity None 1 12 background Source background |cm^-1| 0 13 sld Layer scattering length density |1e-6Ang^-2| 1 14 solvent_sld Solvent scattering length density |1e-6Ang^-2| 6 15 radius Sphere radius |Ang| 50 16 =========== ================================= ============ ============= 17 18 The returned value is scaled to units of |cm^-1|. 19 20 2 21 For information about polarised and magnetic scattering, click here_. 3 22 … … 56 75 57 76 *2013/09/09 and 2014/01/06 - Description reviewed by S King and P Parker.* 58 """59 77 60 from numpy import inf61 62 name = "sphere"63 title = "Spheres with uniform scattering length density"64 description = """\65 P(q)=(scale/V)*[3V(sld-solvent_sld)*(sin(qR)-qRcos(qR))66 /(qR)^3]^2 + background67 R: radius of sphere68 V: The volume of the scatter69 sld: the SLD of the sphere70 solvent_sld: the SLD of the solvent71 """72 category = "shape:sphere"73 74 # ["name", "units", default, [lower, upper], "type","description"],75 parameters = [["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 ]82 83 84 # No volume normalization despite having a volume parameter85 # This should perhaps be volume normalized?86 form_volume = """87 return 1.333333333333333*M_PI*radius*radius*radius;88 """89 90 Iq = """91 const double qr = q*radius;92 double sn, cn;93 SINCOS(qr, sn, cn);94 const double bes = qr==0.0 ? 1.0 : 3.0*(sn-qr*cn)/(qr*qr*qr);95 const double fq = bes * (sld - solvent_sld) * form_volume(radius);96 return 1.0e-4*fq*fq;97 """98 99 100 Iqxy = """101 // never called since no orientation or magnetic parameters.102 //return -1.0;103 return Iq(sqrt(qx*qx + qy*qy), sld, solvent_sld, radius);104 """105 106 def ER(radius):107 return radius108 109 # VR defaults to 1.0110 111 demo = dict(scale=1, background=0,112 sld=6, solvent_sld=1,113 radius=120,114 radius_pd=.2, radius_pd_n=45)115 oldname = "SphereModel"116 oldpars = dict(sld='sldSph', solvent_sld='sldSolv', radius='radius')
Note: See TracChangeset
for help on using the changeset viewer.