Changes in / [bb02a35:3a66cf7] in sasmodels
- Location:
- sasmodels
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/convert.py
rbad8b12 r062db5a 154 154 elif name == 'fractal': 155 155 del oldpars['volfraction'] 156 elif name == 'vesicle': 157 del oldpars['volfraction'] 156 158 157 159 return oldpars … … 191 193 elif name == 'fractal': 192 194 pars['volfraction'] = 1 195 elif name == 'vesicle': 196 pars['volfraction'] = 1 193 197 -
sasmodels/models/binary_hard_sphere.py
re481a39 rd189429 67 67 S R Kline, *J Appl. Cryst.*, 39 (2006) 895 68 68 69 **Author:** N /A **on:**69 **Author:** NIST IGOR/DANSE **on:** pre 2010 70 70 71 71 **Last Modified by:** Paul Butler **on:** March 20, 2016 -
sasmodels/models/correlation_length.py
raa2edb2 r326281f 15 15 and therefore the thermodynamics. The two multiplicative factors A and C, the 16 16 incoherent background B and the two exponents n and m are used as fitting 17 parameters. The final parameter ξ is a correlation length for the polymer 18 chains. Note that when m=2 this functional form becomes the familiar Lorentzian 19 function. 17 parameters. (Respectively $porod\_scale$, $lorentz\_scale$, $background$, $exponent\_p$ and 18 $exponent\_l$ in the parameter list.) The remaining parameter \xi is a correlation 19 length for the polymer chains. Note that when m=2 this functional form becomes the 20 familiar Lorentzian function. Some interpretation of the values of A and C may be 21 possible depending on the values of m and n. 20 22 21 23 For 2D data: The 2D scattering intensity is calculated in the same way as 1D, … … 45 47 ["lorentz_scale", "", 10.0, [0, inf], "", "Lorentzian Scaling Factor"], 46 48 ["porod_scale", "", 1e-06, [0, inf], "", "Porod Scaling Factor"], 47 ["cor_length", "Ang", 50.0, [0, inf], "", "Correlation length "],48 ["exponent_p", "", 3.0, [0, inf], "", "Porod Exponent "],49 ["exponent_l", "1/Ang^2", 2.0, [0, inf], "", "Lorentzian Exponent "],49 ["cor_length", "Ang", 50.0, [0, inf], "", "Correlation length, xi, in Lorentzian"], 50 ["exponent_p", "", 3.0, [0, inf], "", "Porod Exponent, n, in q^-n"], 51 ["exponent_l", "1/Ang^2", 2.0, [0, inf], "", "Lorentzian Exponent, m, in 1/( 1 + (q.xi)^m)"], 50 52 ] 51 53 # pylint: enable=bad-continuation, line-too-long -
sasmodels/models/fractal.py
rdff1088 r5e29b9d 46 46 J Teixeira, *J. Appl. Cryst.*, 21 (1988) 781-785 47 47 48 **Author:** N /A **on:**48 **Author:** NIST IGOR/DANSE **on:** pre 2010 49 49 50 50 **Last Modified by:** Paul Butler **on:** March 20, 2016 -
sasmodels/models/vesicle.c
r321736f r062db5a 2 2 3 3 double Iq(double q, 4 double sld, double s olvent_sld,4 double sld, double sld_solvent, double volfraction, 5 5 double radius, double thickness); 6 6 7 7 double Iqxy(double qx, double qy, 8 double sld, double s olvent_sld,8 double sld, double sld_solvent, double volfraction, 9 9 double radius, double thickness); 10 10 … … 20 20 double Iq(double q, 21 21 double sld, 22 double solvent_sld, 22 double sld_solvent, 23 double volfraction, 23 24 double radius, 24 25 double thickness) … … 30 31 */ 31 32 32 /*33 note that the sph_j1c we are using has been optimized for precision over34 SasView's original implementation. HOWEVER at q==0 that implementation35 set bes=1.0 rather than 0.0 (correct value) on the grounds I believe that36 bes=0.00 causes Iq to have a divide by 0 error (mostly encountered when37 doing a theory curve in 2D? We should verify this and if necessary fix38 -PDB Feb 7, 201639 */40 33 { 41 double bes,vol,contrast,f,f2;34 double vol,contrast,f,f2; 42 35 43 36 // core first, then add in shell 44 contrast = solvent_sld-sld; 45 bes = sph_j1c(q*radius); 37 contrast = sld_solvent-sld; 46 38 vol = 4.0*M_PI/3.0*radius*radius*radius; 47 f = vol* bes*contrast;39 f = vol*sph_j1c(q*radius)*contrast; 48 40 49 //now the shell 50 contrast = sld-solvent_sld; 51 bes = sph_j1c(q*(radius+thickness)); 41 //now the shell. No volume normalization as this is done by the caller 42 contrast = sld-sld_solvent; 52 43 vol = 4.0*M_PI/3.0*(radius+thickness)*(radius+thickness)*(radius+thickness); 53 f += vol* bes*contrast;44 f += vol*sph_j1c(q*(radius+thickness))*contrast; 54 45 55 //rescale to [cm-1]. No volume normalization as this is done by the caller56 f2 = f*f*1.0e-4;46 //rescale to [cm-1]. 47 f2 = volfraction*f*f*1.0e-4; 57 48 58 49 return(f2); … … 61 52 62 53 double Iqxy(double qx, double qy, 63 double sld, double s olvent_sld,54 double sld, double sld_solvent, double volfraction, 64 55 double radius, double thickness) 65 56 … … 67 58 double q = sqrt(qx*qx + qy*qy); 68 59 return Iq(q, 69 sld, s olvent_sld,60 sld, sld_solvent, volfraction, 70 61 radius,thickness); 71 62 -
sasmodels/models/vesicle.py
raa2edb2 r062db5a 7 7 .. math:: 8 8 9 P(q) = \frac{\ text{scale}}{V_\text{shell}} \left[9 P(q) = \frac{\phi}{V_\text{shell}} \left[ 10 10 \frac{3V_{\text{core}}({\rho_{\text{solvent}} 11 11 - \rho_{\text{shell}})j_1(qR_{\text{core}})}}{qR_{\text{core}}} … … 15 15 16 16 17 where scale is a scale factor equivalent to the volume fraction of shell 18 material if the data is on an absolute scale, $V_{shell}$ is the volume of the 19 shell, $V_{\text{cor}}$ is the volume of the core, $V_{\text{tot}}$ is the 20 total volume, $R_{\text{core}}$ is the radius of the core, $R_{\text{tot}}$ is 21 the outer radius of the shell, $\rho_{\text{solvent}}$ is the scattering length 22 density of the solvent (which is the same as for the core in this case), 17 where $\phi$ is the volume fraction of shell material, $V_{shell}$ is the volume 18 of the shell, $V_{\text{cor}}$ is the volume of the core, $V_{\text{tot}}$ is 19 the total volume, $R_{\text{core}}$ is the radius of the core, $R_{\text{tot}}$ 20 is the outer radius of the shell, $\rho_{\text{solvent}}$ is the scattering 21 length density of the solvent (which is the same as for the core in this case), 23 22 $\rho_{\text{scale}}$ is the scattering length density of the shell, background 24 23 is a flat background level (due for example to incoherent scattering in the … … 56 55 A Guinier and G. Fournet, *Small-Angle Scattering of X-Rays*, John Wiley and 57 56 Sons, New York, (1955) 57 58 **Author:** NIST IGOR/DANSE **on:** pre 2010 59 60 **Last Modified by:** Paul Butler **on:** March 20, 2016 61 62 **Last Reviewed by:** Paul Butler **on:** March 20, 2016 58 63 """ 59 64 … … 70 75 thickness: the shell thickness 71 76 sld: the shell SLD 72 s olvent_sld: the solvent (and core) SLD77 sld_slovent: the solvent (and core) SLD 73 78 background: incoherent background 74 scale : scale factor = shell volume fraction if on absolute scale""" 79 volfraction: shell volume fraction 80 scale : scale factor = 1 if on absolute scale""" 75 81 category = "shape:sphere" 76 82 … … 78 84 parameters = [["sld", "1e-6/Ang^2", 0.5, [-inf, inf], "", 79 85 "vesicle shell scattering length density"], 80 ["s olvent_sld", "1e-6/Ang^2", 6.36, [-inf, inf], "",86 ["sld_solvent", "1e-6/Ang^2", 6.36, [-inf, inf], "", 81 87 "solvent scattering length density"], 88 ["volfraction", "", 0.05, [0, 1.0], "", 89 "volume fraction of shell"], 82 90 ["radius", "Ang", 100, [0, inf], "volume", 83 91 "vesicle core radius"], … … 114 122 115 123 # parameters for demo 116 demo = dict(s cale=1, background=0,117 sld=0.5, solvent_sld=6.36,124 demo = dict(sld=0.5, sld_solvent=6.36, 125 volfraction=0.05, 118 126 radius=100, thickness=30, 119 127 radius_pd=.2, radius_pd_n=10, … … 123 131 # names and the target sasview model name. 124 132 oldname = 'VesicleModel' 125 oldpars = dict(sld='shell_sld', s olvent_sld='solv_sld')133 oldpars = dict(sld='shell_sld', sld_solvent='solv_sld') 126 134 127 135 128 136 # NOTE: test results taken from values returned by SasView 3.1.2, with 129 137 # 0.001 added for a non-zero default background. 130 tests = [[{}, 0.0010005303255, 17139.8278799], 131 [{}, 0.200027832249, 0.131387268704], 138 tests = [[{}, 0.0005, 859.916526646], 139 [{}, 0.100600200401, 1.77063682331], 140 [{}, 0.5, 0.00355351388906], 132 141 [{}, 'ER', 130.], 133 142 [{}, 'VR', 0.54483386436], -
sasmodels/resolution.py
r2f63032 r8b935d1 689 689 self.pars = TEST_PARS_PINHOLE_SPHERE 690 690 from sasmodels import core 691 from sasmodels.models import sphere 692 self.model = core.load_model(sphere, dtype='double') 691 self.model = core.load_model("sphere", dtype='double') 693 692 694 693 def _eval_sphere(self, pars, resolution):
Note: See TracChangeset
for help on using the changeset viewer.