Changeset 384d114 in sasmodels
- Timestamp:
- Jan 27, 2016 6:06:30 PM (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:
- 3a45c2c
- Parents:
- 09ebe8c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sesans.py
r09ebe8c r384d114 15 15 16 16 def make_q(q_max, Rmax): 17 """17 r""" 18 18 Return a $q$ vector suitable for SESANS covering from $2\pi/ (10 R_{\max})$ 19 19 to $q_max$. … … 23 23 24 24 def hankel(SElength, wavelength, thickness, q, Iq): 25 """25 r""" 26 26 Compute the expected SESANS polarization for a given SANS pattern. 27 27 28 Uses the hankel transform followed by the exponential. The values 29 for zz (or spin echo length, or delta), wavelength and sample thickness30 information should come from the dataset. *q* should be chosen such31 that the oscillations in *I(q)* are well sampled (e.g., 5*2*pi/d_max).28 Uses the hankel transform followed by the exponential. The values for *zz* 29 (or spin echo length, or delta), wavelength and sample thickness should 30 come from the dataset. $q$ should be chosen such that the oscillations 31 in $I(q)$ are well sampled (e.g., $5 \cdot 2 \pi/d_{\max}$). 32 32 33 *SElength* [A] is the set of z points at which to compute the hankel transform 33 *SElength* [A] is the set of $z$ points at which to compute the 34 Hankel transform 34 35 35 36 *wavelength* [m] is the wavelength of each individual point *zz* … … 37 38 *thickness* [cm] is the sample thickness. 38 39 39 *q* [A ^{-1}] is the set of q points at which the model has been computed.40 These should be equally spaced.40 *q* [A$^{-1}$] is the set of $q$ points at which the model has been 41 computed. These should be equally spaced. 41 42 42 *I* [cm ^{-1}] is the value of the SANS model at *q*43 *I* [cm$^{-1}$] is the value of the SANS model at *q* 43 44 """ 44 45 G = np.zeros(len(SElength), 'd') … … 46 47 integr = besselj(0, q*SElength[i])*Iq*q 47 48 G[i] = np.sum(integr) 48 dq=(q[1]-q[0])*1e10 # [m^-1] step size in q, needed for integration 49 G *= dq*1e10*2*pi # integr step, conver q into [m**-1] and 2 pi circle integr 49 50 # [m^-1] step size in q, needed for integration 51 dq=(q[1]-q[0])*1e10 52 53 # integration step, convert q into [m**-1] and 2 pi circle integration 54 G *= dq*1e10*2*pi 55 50 56 P = exp(thickness*wavelength**2/(4*pi**2)*(G-G[0])) 51 57
Note: See TracChangeset
for help on using the changeset viewer.