Changeset 2d81cfe in sasmodels for sasmodels/models/barbell.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/barbell.py
r31df0c9 r2d81cfe 87 87 * **Last Reviewed by:** Richard Heenan **Date:** January 4, 2017 88 88 """ 89 90 import numpy as np 89 91 from numpy import inf, sin, cos, pi 90 92 … … 116 118 117 119 def random(): 118 import numpy as np119 120 # TODO: increase volume range once problem with bell radius is fixed 120 121 # The issue is that bell radii of more than about 200 fail at high q 121 V= 10**np.random.uniform(7, 9)122 bar_volume = 10**np.random.uniform(-4, -1)* V123 bell_volume = V- bar_volume122 volume = 10**np.random.uniform(7, 9) 123 bar_volume = 10**np.random.uniform(-4, -1)*volume 124 bell_volume = volume - bar_volume 124 125 bell_radius = (bell_volume/6)**0.3333 # approximate 125 126 min_bar = bar_volume/np.pi/bell_radius**2 … … 150 151 qx = q*cos(pi/6.0) 151 152 qy = q*sin(pi/6.0) 152 tests = [[{}, 0.075, 25.5691260532], 153 [{'theta':80., 'phi':10.}, (qx, qy), 3.04233067789], 154 ] 153 tests = [ 154 [{}, 0.075, 25.5691260532], 155 [{'theta':80., 'phi':10.}, (qx, qy), 3.04233067789], 156 ] 155 157 del qx, qy # not necessary to delete, but cleaner
Note: See TracChangeset
for help on using the changeset viewer.