Changeset 2d81cfe in sasmodels for sasmodels/models/cylinder.py
- Timestamp:
- Nov 29, 2017 11:13:23 AM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 237b800f
- Parents:
- a839b22
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/cylinder.py
reda8b30 r2d81cfe 64 64 65 65 Angles $\theta$ and $\phi$ orient the cylinder relative 66 to the beam line coordinates, where the beam is along the $z$ axis. Rotation $\theta$, initially 66 to the beam line coordinates, where the beam is along the $z$ axis. Rotation $\theta$, initially 67 67 in the $xz$ plane, is carried out first, then rotation $\phi$ about the $z$ axis. Orientation distributions 68 68 are described as rotations about two perpendicular axes $\delta_1$ and $\delta_2$ … … 133 133 ["theta", "degrees", 60, [-360, 360], "orientation", 134 134 "cylinder axis to beam angle"], 135 ["phi", "degrees", 135 ["phi", "degrees", 60, [-360, 360], "orientation", 136 136 "rotation about beam"], 137 137 ] 138 138 139 source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", 139 source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "cylinder.c"] 140 140 141 141 def ER(radius, length): … … 147 147 148 148 def random(): 149 import numpy as np 150 V = 10**np.random.uniform(5, 12) 151 length = 10**np.random.uniform(-2, 2)*V**0.333 152 radius = np.sqrt(V/length/np.pi) 149 volume = 10**np.random.uniform(5, 12) 150 length = 10**np.random.uniform(-2, 2)*volume**0.333 151 radius = np.sqrt(volume/length/np.pi) 153 152 pars = dict( 154 153 #scale=1, … … 172 171 qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 173 172 # After redefinition of angles, find new tests values. Was 10 10 in old coords 174 tests = [[{}, 0.2, 0.042761386790780453], 175 [{}, [0.2], [0.042761386790780453]], 176 # new coords 177 [{'theta':80.1534480601659, 'phi':10.1510817110481}, (qx, qy), 0.03514647218513852], 178 [{'theta':80.1534480601659, 'phi':10.1510817110481}, [(qx, qy)], [0.03514647218513852]], 179 # old coords [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03514647218513852], 180 # [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03514647218513852]], 181 ] 173 tests = [ 174 [{}, 0.2, 0.042761386790780453], 175 [{}, [0.2], [0.042761386790780453]], 176 # new coords 177 [{'theta':80.1534480601659, 'phi':10.1510817110481}, (qx, qy), 0.03514647218513852], 178 [{'theta':80.1534480601659, 'phi':10.1510817110481}, [(qx, qy)], [0.03514647218513852]], 179 # old coords 180 #[{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03514647218513852], 181 #[{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03514647218513852]], 182 ] 182 183 del qx, qy # not necessary to delete, but cleaner 183 184 # ADDED by: RKH ON: 18Mar2016 renamed sld's etc
Note: See TracChangeset
for help on using the changeset viewer.