Changeset 10576d1 in sasmodels
- Timestamp:
- Feb 16, 2015 4:25:36 PM (10 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:
- d547f16
- Parents:
- 250fa25
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/spherepy.py
rb3f6bc3 r10576d1 58 58 """ 59 59 60 from numpy import pi, inf, sin, cos, sqrt 60 import numpy as np 61 from numpy import pi, inf, sin, cos, sqrt, exp, log 61 62 62 63 name = "sphere" … … 105 106 Iqxy.vectorized = True 106 107 108 def sesans(z, sld, solvent_sld, radius): 109 """ 110 Calculate SESANS-correlation function for a solid sphere. 111 112 Wim Bouwman after formulae Timofei Kruglov J.Appl.Cryst. 2003 article 113 """ 114 d = z/radius 115 g = np.zeros_like(z) 116 g[d==0] = 1. 117 low = ((d > 0) & (d < 2)) 118 dlow = d[low] 119 dlow2 = dlow**2 120 g[low] = sqrt(1-dlow2/4.)*(1+dlow2/8.) + dlow2/2.*(1-dlow2/16.)*log(dlow/(2.+sqrt(4.-dlow2))) 121 return g 122 sesans.vectorized = True 123 107 124 def ER(radius): 108 125 return radius
Note: See TracChangeset
for help on using the changeset viewer.