Changeset 31df0c9 in sasmodels for sasmodels/models/capped_cylinder.py
- Timestamp:
- Aug 1, 2017 2:38:47 PM (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:
- 1511c37c
- Parents:
- d49ca5c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/capped_cylinder.py
r9802ab3 r31df0c9 80 80 81 81 .. [#] H Kaya, *J. Appl. Cryst.*, 37 (2004) 223-230 82 .. [#] H Kaya and N-R deSouza, *J. Appl. Cryst.*, 37 (2004) 508-509 (addenda 82 .. [#] H Kaya and N-R deSouza, *J. Appl. Cryst.*, 37 (2004) 508-509 (addenda 83 83 and errata) 84 84 … … 136 136 source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "capped_cylinder.c"] 137 137 138 def random(): 139 import numpy as np 140 # TODO: increase volume range once problem with bell radius is fixed 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)*V 144 bell_volume = V - bar_volume 145 bell_radius = (bell_volume/6)**0.3333 # approximate 146 min_bar = bar_volume/np.pi/bell_radius**2 147 bar_length = 10**np.random.uniform(0, 3)*min_bar 148 bar_radius = np.sqrt(bar_volume/bar_length/np.pi) 149 if bar_radius > bell_radius: 150 bell_radius, bar_radius = bar_radius, bell_radius 151 pars = dict( 152 #background=0, 153 radius_cap=bell_radius, 154 radius=bar_radius, 155 length=bar_length, 156 ) 157 return pars 158 159 138 160 demo = dict(scale=1, background=0, 139 161 sld=6, sld_solvent=1,
Note: See TracChangeset
for help on using the changeset viewer.