Changeset 2d81cfe in sasmodels for sasmodels/models/capped_cylinder.py
- Timestamp:
- Nov 29, 2017 1:13:23 PM (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/capped_cylinder.py
r31df0c9 r2d81cfe 89 89 * **Last Modified by:** Paul Butler **Date:** September 30, 2016 90 90 * **Last Reviewed by:** Richard Heenan **Date:** January 4, 2017 91 """ 91 92 92 """ 93 import numpy as np 93 94 from numpy import inf, sin, cos, pi 94 95 … … 137 138 138 139 def random(): 139 import numpy as np140 140 # TODO: increase volume range once problem with bell radius is fixed 141 141 # The issue is that bell radii of more than about 200 fail at high q 142 V= 10**np.random.uniform(7, 9)143 bar_volume = 10**np.random.uniform(-4, -1)* V144 bell_volume = V- bar_volume142 volume = 10**np.random.uniform(7, 9) 143 bar_volume = 10**np.random.uniform(-4, -1)*volume 144 bell_volume = volume - bar_volume 145 145 bell_radius = (bell_volume/6)**0.3333 # approximate 146 146 min_bar = bar_volume/np.pi/bell_radius**2 … … 171 171 qx = q*cos(pi/6.0) 172 172 qy = q*sin(pi/6.0) 173 tests = [[{}, 0.075, 26.0698570695], 174 [{'theta':80., 'phi':10.}, (qx, qy), 0.561811990502], 175 ] 173 tests = [ 174 [{}, 0.075, 26.0698570695], 175 [{'theta':80., 'phi':10.}, (qx, qy), 0.561811990502], 176 ] 176 177 del qx, qy # not necessary to delete, but cleaner
Note: See TracChangeset
for help on using the changeset viewer.