Changeset 9d9fcbd in sasmodels for explore/guyou.py
- Timestamp:
- Nov 2, 2017 4:27:34 PM (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:
- 6aee3ab
- Parents:
- ff10479
- git-author:
- Paul Kienzle <pkienzle@…> (11/02/17 12:20:15)
- git-committer:
- Paul Kienzle <pkienzle@…> (11/02/17 16:27:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
explore/guyou.py
rebd2ba6 r9d9fcbd 125 125 # cos_u = 0.171572875253809902396622551580603842860656249246103853646... 126 126 # sinsq_u = 0.970562748477140585620264690516376942836062504523376878120... 127 # K = 5.415790687177373152821133989303623814510776592635531270636...127 # K = 3.165103454447431823666270142140819753058976299237578486994... 128 128 def guyou(lam, phi): 129 129 # [PAK] wrap into [-pi/2, pi/2] radians … … 163 163 164 164 # [PAK] simplify expressions, using the fact that f = -1 165 # Note: exp(0.5/f log(x)) => 1/sqrt(x), a x.real^2 + a x.imag^2 => a|x|^2 166 j = ellipticJi(0.5 * K - y, -x, sinsq_u) 165 j = ellipticJi(K/2 - y, -x, sinsq_u) 167 166 tn = j[0]/j[1] # j[0], j[1] are complex 168 lam = -atan2(tn.imag, tn.real) 169 phi = 2*atan(1/sqrt(cos_u*abs(tn)**2)) - pi/2 167 # Note: -atan2(im(x)/re(x)) => angle(x) 168 lam = -np.angle(tn) 169 # Note: exp(0.5/f log(a re(x)^2 + a im(x)^2)) => 1/(sqrt(a) |x|) 170 phi = 2*atan(1/sqrt(cos_u)/abs(tn)) - pi/2 170 171 171 172 # [PAK] convert to degrees, and return to original tile
Note: See TracChangeset
for help on using the changeset viewer.