Changeset 2684d45 in sasmodels
- Timestamp:
- Mar 21, 2016 5:05:46 AM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- a6ebff8
- Parents:
- 3f167d9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
example/sesans_parameters_css-hs.py
r3415f4f r2684d45 22 22 # Initial parameter values (if other than defaults) 23 23 initial_vals = { 24 "sld_core" : 1.0592, 25 "sld_solvent" : 2.88, 26 "radius" : 890, 27 "thickness" : 130 24 "sld_core" : 1.83, 25 "sld_shell" : 1.83, 26 "sld_solvent" : 0, 27 "radius" : 730, 28 "thickness" : 20, 29 "volfraction" : phi, 30 "scale" : (1-phi) 28 31 } 29 32 -
sasmodels/sesans.py
rc94577f r2684d45 29 29 30 30 q_min = dq = 0.1 * 2*pi / Rmax 31 return np.arange(q_min, Converter("1/A")(q_max[0], units=q_max[1]), dq) 31 return np.arange(q_min, 32 Converter(q_max[1])(q_max[0], 33 units="1/A"), 34 dq) 32 35 33 36 def make_all_q(data): … … 75 78 76 79 def call_hankel(data, q_calc, Iq_calc): 77 return hankel(data.x, data.lam * 1e-9, 78 data.sample.thickness / 10, 80 return hankel((data.x, data.x_unit), 81 (data.lam, data.lam_unit), 82 (data.sample.thickness, 83 data.sample.thickness_unit), 79 84 q_calc, Iq_calc) 80 85 … … 182 187 *I* [cm$^{-1}$] is the value of the SANS model at *q* 183 188 """ 189 190 from sas.sascalc.data_util.nxsunit import Converter 191 wavelength = Converter(wavelength[1])(wavelength[0],"A") 192 thickness = Converter(thickness[1])(thickness[0],"A") 193 Iq = Converter("1/cm")(Iq,"1/A") # All models default to inverse centimeters 194 SElength = Converter(SElength[1])(SElength[0],"A") 195 184 196 G = np.zeros_like(SElength, 'd') 185 197 #============================================================================== … … 192 204 193 205 # [m^-1] step size in q, needed for integration 194 dq = (q[1]-q[0]) *1e10206 dq = (q[1]-q[0]) 195 207 196 208 # integration step, convert q into [m**-1] and 2 pi circle integration 197 G *= dq* 1e10*2*pi198 G0 *= dq*1e10*2*pi209 G *= dq*2*pi 210 G0 = np.sum(Iq*q)*dq*2*np.pi 199 211 200 212 P = exp(thickness*wavelength**2/(4*pi**2)*(G-G0))
Note: See TracChangeset
for help on using the changeset viewer.