Changes in / [98c045a:89dba62] in sasmodels
- Location:
- sasmodels
- Files:
-
- 1 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/conversion_table.py
rdb1d9d5 ref476e6 854 854 "TwoPowerLawModel", 855 855 ], 856 "unified_power_ rg": [856 "unified_power_Rg": [ 857 857 "UnifiedPowerRg", 858 858 dict(((field_new+str(index), field_old+str(index)) -
sasmodels/convert.py
rdb1d9d5 ref476e6 606 606 if pars['volfraction_a'] > 0.5: 607 607 pars['volfraction_a'] = 1.0 - pars['volfraction_a'] 608 elif name == 'unified_power_ rg':608 elif name == 'unified_power_Rg': 609 609 pars['level'] = int(pars['level']) 610 610 -
sasmodels/kernel_iq.c
ra34b811 r8973e0d 85 85 static void set_spin_weights(double in_spin, double out_spin, double weight[6]) 86 86 { 87 88 double norm; 87 89 in_spin = clip(in_spin, 0.0, 1.0); 88 90 out_spin = clip(out_spin, 0.0, 1.0); … … 94 96 // However, since the weights are applied to the final intensity and 95 97 // are not interned inside the I(q) function, we want the full 96 // weight and not the square root. Any function using 97 // set_spin_weights as part of calculating an amplitude will need to 98 // manually take that square root, but there is currently no such 99 // function. 100 weight[0] = (1.0-in_spin) * (1.0-out_spin); // dd 101 weight[1] = (1.0-in_spin) * out_spin; // du 102 weight[2] = in_spin * (1.0-out_spin); // ud 103 weight[3] = in_spin * out_spin; // uu 98 // weight and not the square root. Anyway no function will ever use 99 // set_spin_weights as part of calculating an amplitude, as the weights are 100 // related to polarisation efficiency of the instrument. The weights serve to 101 // construct various magnet scattering cross sections, which are linear combinations 102 // of the spin-resolved cross sections. The polarisation efficiency e_in and e_out 103 // are parameters ranging from 0.5 (unpolarised) beam to 1 (perfect optics). 104 // For in_spin or out_spin <0.5 one assumes a CS, where the spin is reversed/flipped 105 // with respect to the initial supermirror polariser. The actual polarisation efficiency 106 // in this case is however e_in/out = 1-in/out_spin. 107 108 if (out_spin < 0.5){norm=1-out_spin;} 109 else{norm=out_spin;} 110 111 112 // The norm is needed to make sure that the scattering cross sections are 113 //correctly weighted, such that the sum of spin-resolved measurements adds up to 114 // the unpolarised or half-polarised scattering cross section. No intensity weighting 115 // needed on the incoming polariser side (assuming that a user), has normalised 116 // to the incoming flux with polariser in for SANSPOl and unpolarised beam, respectively. 117 118 119 weight[0] = (1.0-in_spin) * (1.0-out_spin) / norm; // dd 120 weight[1] = (1.0-in_spin) * out_spin / norm; // du 121 weight[2] = in_spin * (1.0-out_spin) / norm; // ud 122 weight[3] = in_spin * out_spin / norm; // uu 104 123 weight[4] = weight[1]; // du.imag 105 124 weight[5] = weight[2]; // ud.imag … … 119 138 switch (xs) { 120 139 default: // keep compiler happy; condition ensures xs in [0,1,2,3] 121 case 0: // uu=> sld - D M_perpx140 case 0: // dd => sld - D M_perpx 122 141 return sld - px*perp; 123 case 1: // ud.real => -D M_perpy142 case 1: // du.real => -D M_perpy 124 143 return py*perp; 125 case 2: // du.real => -D M_perpy144 case 2: // ud.real => -D M_perpy 126 145 return py*perp; 127 case 3: // dd=> sld + D M_perpx146 case 3: // uu => sld + D M_perpx 128 147 return sld + px*perp; 129 148 } -
sasmodels/models/spherical_sld.py
ra34b811 r627b68b 18 18 sub-shell is described by a line function, with *n_steps* sub-shells per 19 19 interface. The form factor is normalized by the total volume of the sphere. 20 21 .. note:: 22 23 *n_shells* must be an integer. *n_steps* must be an ODD integer. 20 24 21 25 Interface shapes are as follows: … … 73 77 3 \rho_\text{solvent} V(r_N) 74 78 \Big[ \frac{\sin(qr_N) - qr_N \cos(qr_N)} {qr_N^3} \Big] 75 76 79 77 80 Here we assumed that the SLDs of the core and solvent are constant in $r$. … … 156 159 \end{align*} 157 160 158 159 161 We assume $\rho_{\text{inter}_j} (r)$ is approximately linear 160 162 within the sub-shell $j$. … … 179 181 when $P(Q) * S(Q)$ is applied. 180 182 181 182 183 References 183 184 ---------- … … 194 195 195 196 Authorship and Verification 196 --------------------------- -197 --------------------------- 197 198 198 199 * **Author:** Jae-Hie Cho **Date:** Nov 1, 2010 199 200 * **Last Modified by:** Paul Kienzle **Date:** Dec 20, 2016 200 * **Last Reviewed by:** Paul Butler **Date:** September 8, 2018201 * **Last Reviewed by:** Steve King **Date:** March 29, 2019 201 202 * **Source added by :** Steve King **Date:** March 25, 2019 202 203 """ … … 207 208 208 209 name = "spherical_sld" 209 title = "Sp erical SLD intensity calculation"210 title = "Spherical SLD intensity calculation" 210 211 description = """ 211 212 I(q) = … … 219 220 # pylint: disable=bad-whitespace, line-too-long 220 221 # ["name", "units", default, [lower, upper], "type", "description"], 221 parameters = [["n_shells", "", 1, [1, 10], "volume", "number of shells "],222 parameters = [["n_shells", "", 1, [1, 10], "volume", "number of shells (must be integer)"], 222 223 ["sld_solvent", "1e-6/Ang^2", 1.0, [-inf, inf], "sld", "solvent sld"], 223 224 ["sld[n_shells]", "1e-6/Ang^2", 4.06, [-inf, inf], "sld", "sld of the shell"],
Note: See TracChangeset
for help on using the changeset viewer.