Changeset 3f3df6c in sasmodels
- Timestamp:
- Mar 28, 2019 10:34:42 AM (6 years ago)
- Branches:
- master
- Children:
- ccbbc3b
- Parents:
- 0c7b8d8
- git-author:
- Adam Washington <rprospero@…> (03/28/19 10:16:34)
- git-committer:
- Adam Washington <rprospero@…> (03/28/19 10:34:42)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sesans.py
r0c7b8d8 r3f3df6c 14 14 import numpy as np # type: ignore 15 15 from numpy import pi # type: ignore 16 from scipy.special import j 116 from scipy.special import j0 17 17 18 18 … … 59 59 def _set_hankel(self, SElength, lam, zaccept, Rmax): 60 60 # type: (np.ndarray, float, float) -> None 61 SElength = np.asarray(SElength, dtype='float64') 62 63 # Rmax = #value in text box somewhere in FitPage? 61 SElength = np.asarray(SElength) 64 62 q_max = 2*pi / (SElength[1] - SElength[0]) 65 63 q_min = 0.1 * 2*pi / (np.size(SElength) * SElength[-1]) 66 # q = np.arange(q_min, q_max, q_min, dtype='float32') 67 # q = np.exp(np.arange(np.log(q_min), np.log(q_max), np.log(2), 68 # dtype=np.float32)) 69 q = np.exp(np.linspace(np.log(q_min), np.log(q_max), 10*SElength.size, 70 dtype=np.float64)) 71 q = np.hstack([[0], q]) 64 q = np.exp(np.arange(np.log(q_min), np.log(q_max), np.log(1.0003))) 72 65 73 H0 = (q[1:]**2 - q[:-1]**2) / (2 * np.pi) / 2 66 dq = q[1:]-q[:-1] 67 dq = np.hstack([[dq[0]], dq]) 74 68 75 # repq = np.tile(q, (SElength.size, 1)).T 69 H0 = dq/(2*pi) * q 70 76 71 H = np.outer(q, SElength) 77 j1(H, out=H) 78 H *= q.reshape((-1, 1)) 79 H = H[1:] - H[:-1] 80 H /= 2 * np.pi * SElength 72 j0(H, out=H) 73 H *= (dq * q).reshape((-1, 1)) 74 H /= 2*pi 81 75 82 lam = np.asarray(lam, dtype=np.float64) 83 reptheta = np.outer(q[1:], lam) 84 reptheta /= np.float64(2*np.pi) 76 reptheta = np.outer(q, lam) 77 reptheta /= 2*np.pi 85 78 np.arcsin(reptheta, out=reptheta) 86 # reptheta = np.arcsin(repq*replam/2*np.pi)87 79 mask = reptheta > zaccept 88 #H[mask] = 080 H[mask] = 0 89 81 90 # H = np.zeros((q.size, SElength.size), dtype=np.float32) 91 # H0 = q * 0 92 assert(H.shape == (q.size-1, SElength.size)) 93 94 self.q_calc = q[1:] 82 self.q_calc = q 95 83 self._H, self._H0 = H, H0
Note: See TracChangeset
for help on using the changeset viewer.