Changeset a151caa in sasmodels for sasmodels/models/core_multi_shell.py
- Timestamp:
- Jul 28, 2017 10:49:09 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:
- 404ebbd
- Parents:
- 0bdddc2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_multi_shell.py
r5a0b3d7 ra151caa 70 70 sld_shell: the SLD of the shell# 71 71 A_shell#: the coefficient in the exponential function 72 73 72 73 74 74 scale: 1.0 if data is on absolute scale 75 75 volfraction: volume fraction of spheres … … 102 102 103 103 source = ["lib/sas_3j1x_x.c", "core_multi_shell.c"] 104 105 def random(): 106 import numpy as np 107 num_shells = np.minimum(np.random.poisson(3)+1, 10) 108 total_radius = 10**np.random.uniform(1.7, 4) 109 thickness = np.random.exponential(size=num_shells+1) 110 thickness *= total_radius/np.sum(thickness) 111 volume_fraction = 10**np.random.uniform(-4, -1) 112 pars = dict( 113 #background=0, 114 scale=volume_fraction/total_radius**3*1e10, 115 n=num_shells, 116 radius=thickness[0], 117 ) 118 for k, v in enumerate(thickness[1:]): 119 pars['thickness%d'%(k+1)] = v 120 return pars 104 121 105 122 def profile(sld_core, radius, sld_solvent, n, sld, thickness):
Note: See TracChangeset
for help on using the changeset viewer.