Changeset 251b40b in sasmodels
- Timestamp:
- Mar 18, 2016 5:30:51 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:
- 76d78c2
- Parents:
- 5bb9c79
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sesans.py
r02e70ff r251b40b 63 63 64 64 def Cosine2D(data, q_calc, Iq_calc, qx, qy, Iq_mono): 65 return hankel(data.x, data.y data.lam * 1e-9,65 return hankel(data.x, data.y, data.lam * 1e-9, 66 66 data.sample.thickness / 10, 67 67 q_calc, Iq_calc) … … 70 70 # Calls a model with existing model parameters already in place, then integrate the product of q and I(q) from 0 to (4*pi/lambda) 71 71 allq = np.linspace(0,4*pi/wavelength,1000) 72 allIq = 72 allIq = 1 73 73 integral = allq*allIq 74 74 … … 86 86 Gprime = np.zeros_like(wavelength, 'd') 87 87 f = np.zeros_like(wavelength, 'd') 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 P[i] = (1-sd[i]/f[i])+1/f[i]*Gprime[i]88 for i, wavelength_i in enumerate(wavelength): 89 z = magfield*wavelength_i 90 allq=np.linspace() #for calculating the Q-range of the scattering power integral 91 allIq=np.linspace() # This is the model applied to the allq q-space. Needs to refference the model somehow 92 alldq = (allq[1]-allq[0])*1e10 93 sigma[i]=wavelength[i]^2*thickness/2/pi*np.sum(allIq*allq*alldq) 94 s[i]=1-exp(-sigma) 95 for j, Iqy_j, qy_j in enumerate(qy): 96 for k, Iqz_k, qz_k in enumerate(qz): 97 Iq = np.sqrt(Iqy_j^2+Iqz_k^2) 98 q = np.sqrt(qy_j^2 + qz_k^2) 99 Gintegral = Iq*cos(z*Qz_k) 100 Gprime[i] += Gintegral 101 # sigma = wavelength^2*thickness/2/pi* allq[i]*allIq[i] 102 # s[i] += 1-exp(Totalscatter(modelname)*thickness) 103 # For now, work with standard 2-phase scatter 104 105 106 sd[i] += Iq 107 f[i] = 1-s[i]+sd[i] 108 P[i] = (1-sd[i]/f[i])+1/f[i]*Gprime[i] 109 109 110 110 … … 119 119 G = np.zeros_like(SElength, 'd') 120 120 threshold=2*pi*theta/wavelength 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 121 for i, SElength_i in enumerate(SElength): 122 allq=np.linspace() #for calculating the Q-range of the scattering power integral 123 allIq=np.linspace() # This is the model applied to the allq q-space. Needs to refference the model somehow 124 alldq = (allq[1]-allq[0])*1e10 125 sigma[i]=wavelength[i]^2*thickness/2/pi*np.sum(allIq*allq*alldq) 126 s[i]=1-exp(-sigma) 127 128 dq = (q[1]-q[0])*1e10 129 a = (x<threshold) 130 acceptq = a*q 131 acceptIq = a*Iq 132 133 G[i] = np.sum(besselj(0, acceptq*SElength_i)*acceptIq*acceptq*dq) 134 135 # G[i]=np.sum(integral) 136 137 G *= dq*1e10*2*pi 138 139 P = exp(thickness*wavelength**2/(4*pi**2)*(G-G[0])) 140 140 141 141 def hankel(SElength, wavelength, thickness, q, Iq):
Note: See TracChangeset
for help on using the changeset viewer.