Changeset 7420664 in sasmodels
 Timestamp:
 Sep 4, 2018 8:25:11 AM (5 months ago)
 Branches:
 F1F2models_grethe
 Parents:
 755bc53
 Location:
 sasmodels/models
 Files:

 10 added
 1 edited
Legend:
 Unmodified
 Added
 Removed

sasmodels/models/ellipsoidF2.py
r755bc53 r7420664 151 151 ["sld_solvent", "1e6/Ang^2", 1, [inf, inf], "sld", 152 152 "Solvent scattering length density"], 153 ["radius_polar ", "Ang", 20, [0, inf], "volume",153 ["radius_polarF2", "Ang", 20, [0, inf], "volume", 154 154 "Polar radius"], 155 ["radius_equatorial ", "Ang", 400, [0, inf], "volume",155 ["radius_equatorialF2", "Ang", 400, [0, inf], "volume", 156 156 "Equatorial radius"], 157 157 ["theta", "degrees", 60, [360, 360], "orientation", … … 162 162 163 163 164 source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "ellipsoid .c"]164 source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "ellipsoidF2.c"] 165 165 have_Fq = True 166 166 167 def ER(radius_polar , radius_equatorial):167 def ER(radius_polarF2, radius_equatorialF2): 168 168 # see equation (26) in A.Isihara, J.Chem.Phys. 18(1950)14461449 169 ee = np.empty_like(radius_polar )170 idx = radius_polar > radius_equatorial171 ee[idx] = (radius_polar [idx] ** 2  radius_equatorial[idx] ** 2) / radius_polar[idx] ** 2172 idx = radius_polar < radius_equatorial173 ee[idx] = (radius_equatorial [idx] ** 2  radius_polar[idx] ** 2) / radius_equatorial[idx] ** 2174 idx = radius_polar == radius_equatorial175 ee[idx] = 2 * radius_polar [idx]176 valid = (radius_polar * radius_equatorial!= 0)169 ee = np.empty_like(radius_polarF2) 170 idx = radius_polarF2 > radius_equatorialF2 171 ee[idx] = (radius_polarF2[idx] ** 2  radius_equatorialF2[idx] ** 2) / radius_polarF2[idx] ** 2 172 idx = radius_polarF2 < radius_equatorialF2 173 ee[idx] = (radius_equatorialF2[idx] ** 2  radius_polarF2[idx] ** 2) / radius_equatorialF2[idx] ** 2 174 idx = radius_polarF2 == radius_equatorialF2 175 ee[idx] = 2 * radius_polarF2[idx] 176 valid = (radius_polarF2 * radius_equatorialF2 != 0) 177 177 bd = 1.0  ee[valid] 178 178 e1 = np.sqrt(ee[valid]) … … 183 183 184 184 ddd = np.zeros_like(radius_polar) 185 ddd[valid] = 2.0 * (delta + 1.0) * radius_polar * radius_equatorial** 2185 ddd[valid] = 2.0 * (delta + 1.0) * radius_polarF2 * radius_equatorialF2 ** 2 186 186 return 0.5 * ddd ** (1.0 / 3.0) 187 187 … … 199 199 demo = dict(scale=1, background=0, 200 200 sld=6, sld_solvent=1, 201 radius_polar =50, radius_equatorial=30,201 radius_polarF2=50, radius_equatorialF2=30, 202 202 theta=30, phi=15, 203 radius_polar _pd=.2, radius_polar_pd_n=15,204 radius_equatorial _pd=.2, radius_equatorial_pd_n=15,203 radius_polarF2_pd=.2, radius_polarF2_pd_n=15, 204 radius_equatorialF2_pd=.2, radius_equatorialF2_pd_n=15, 205 205 theta_pd=15, theta_pd_n=45, 206 206 phi_pd=15, phi_pd_n=1) … … 210 210 qy = q*sin(pi/6.0) 211 211 tests = [ 212 [{}, 0.05, 54.8525847025],212 [{}, 0.05, 0.23291238], 213 213 [{'theta':80., 'phi':10.}, (qx, qy), 1.74134670026], 214 214 ]
Note: See TracChangeset
for help on using the changeset viewer.