Changeset 64eecf7 in sasmodels for sasmodels/models/core_shell_ellipsoid.py
- Timestamp:
- Sep 5, 2017 11:40:09 AM (7 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 30b60d2
- Parents:
- a53bf6b (diff), 142a8e2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_ellipsoid.py
r17fb550 r64eecf7 25 25 ellipsoid. This may have some undesirable effects if the aspect ratio of the 26 26 ellipsoid is large (ie, if $X << 1$ or $X >> 1$ ), when the $S(q)$ 27 - which assumes spheres - will not in any case be valid. Generating a 28 custom product model will enable separate effective volume fraction and effective 27 - which assumes spheres - will not in any case be valid. Generating a 28 custom product model will enable separate effective volume fraction and effective 29 29 radius in the $S(q)$. 30 30 … … 46 46 :nowrap: 47 47 48 \begin{align} 48 \begin{align} 49 49 F(q,\alpha) = &f(q,radius\_equat\_core,radius\_equat\_core.x\_core,\alpha) \\ 50 50 &+ f(q,radius\_equat\_core + thick\_shell,radius\_equat\_core.x\_core + thick\_shell.x\_polar\_shell,\alpha) 51 \end{align} 51 \end{align} 52 52 53 53 where 54 54 55 55 .. math:: 56 56 … … 79 79 F^2(q)=\int_{0}^{\pi/2}{F^2(q,\alpha)\sin(\alpha)d\alpha} 80 80 81 For oriented ellipsoids the *theta*, *phi* and *psi* orientation parameters will appear when fitting 2D data, 82 see the :ref:`elliptical-cylinder` model for further information. 81 83 82 84 References … … 134 136 ["sld_shell", "1e-6/Ang^2", 1, [-inf, inf], "sld", "Shell scattering length density"], 135 137 ["sld_solvent", "1e-6/Ang^2", 6.3, [-inf, inf], "sld", "Solvent scattering length density"], 136 ["theta", "degrees", 0, [- inf, inf], "orientation", "Oblate orientation wrt incoming beam"],137 ["phi", "degrees", 0, [- inf, inf], "orientation", "Oblate orientation in the plane of the detector"],138 ["theta", "degrees", 0, [-360, 360], "orientation", "elipsoid axis to beam angle"], 139 ["phi", "degrees", 0, [-360, 360], "orientation", "rotation about beam"], 138 140 ] 139 141 # pylint: enable=bad-whitespace, line-too-long … … 151 153 return ellipsoid_ER(polar_outer, equat_outer) 152 154 153 154 demo = dict(scale=0.05, background=0.001, 155 radius_equat_core=20.0, 156 x_core=3.0, 157 thick_shell=30.0, 158 x_polar_shell=1.0, 159 sld_core=2.0, 160 sld_shell=1.0, 161 sld_solvent=6.3, 162 theta=0, 163 phi=0) 155 def random(): 156 import numpy as np 157 V = 10**np.random.uniform(5, 12) 158 outer_polar = 10**np.random.uniform(1.3, 4) 159 outer_equatorial = np.sqrt(V/outer_polar) # ignore 4/3 pi 160 # Use a distribution with a preference for thin shell or thin core 161 # Avoid core,shell radii < 1 162 thickness_polar = np.random.beta(0.5, 0.5)*(outer_polar-2) + 1 163 thickness_equatorial = np.random.beta(0.5, 0.5)*(outer_equatorial-2) + 1 164 radius_polar = outer_polar - thickness_polar 165 radius_equatorial = outer_equatorial - thickness_equatorial 166 x_core = radius_polar/radius_equatorial 167 x_polar_shell = thickness_polar/thickness_equatorial 168 pars = dict( 169 #background=0, sld=0, sld_solvent=1, 170 radius_equat_core=radius_equatorial, 171 x_core=x_core, 172 thick_shell=thickness_equatorial, 173 x_polar_shell=x_polar_shell, 174 ) 175 return pars 164 176 165 177 q = 0.1
Note: See TracChangeset
for help on using the changeset viewer.