Changeset 8bd379a in sasmodels
- Timestamp:
- Feb 2, 2018 9:19:14 AM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 032646d
- Parents:
- 049e02d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
explore/realspace.py
r7d0afa3 r8bd379a 274 274 from numba import njit 275 275 @njit("f8[:](f8[:],f8[:],f8[:],f8[:],f8[:],f8[:],f8[:])") 276 def _Iqxy _jit(values, x, y, z, qa, qb, qc):276 def _Iqxy(values, x, y, z, qa, qb, qc): 277 277 Iq = np.zeros_like(qa) 278 278 for j in range(len(Iq)): 279 279 total = 0. + 0j 280 for k in range(len( Iq)):280 for k in range(len(values)): 281 281 total += values[k]*np.exp(1j*(qa[j]*x[k] + qb[j]*y[k] + qc[j]*z[k])) 282 282 Iq[j] = abs(total)**2 … … 289 289 values = rho*volume 290 290 x, y, z = points.T 291 values, x, y, z, qa, qb, qc = [np.asarray(v, 'd') 292 for v in (values, x, y, z, qa, qb, qc)] 291 293 292 294 # I(q) = |sum V(r) rho(r) e^(1j q.r)|^2 / sum V(r) … … 385 387 # P(r) with uniform steps in r is 3x faster; check if we are uniform 386 388 # before continuing 389 r, rho, points = [np.asarray(v, 'd') for v in (r, rho, points)] 387 390 if np.max(np.abs(np.diff(r) - r[0])) > r[0]*0.01: 388 391 Pr = _calc_Pr_nonuniform(r, rho, points)
Note: See TracChangeset
for help on using the changeset viewer.