Changeset 416609b in sasmodels
- Timestamp:
- Apr 8, 2016 12:14:58 PM (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:
- 3a45c2c, a936688, 1ca1fd9
- Parents:
- 65279d8
- Location:
- sasmodels/models
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/elliptical_cylinder.py
rec45c4f r416609b 81 81 """ 82 82 83 import math 84 from numpy import pi, inf 83 from numpy import pi, inf, sqrt 85 84 86 85 name = "elliptical_cylinder" … … 117 116 @param length: Length of the cylinder 118 117 """ 119 radius = math.sqrt(r_minor * r_minor * axis_ratio)118 radius = sqrt(r_minor * r_minor * axis_ratio) 120 119 ddd = 0.75 * radius * (2 * radius * length + (length + radius) * (length + pi * radius)) 121 120 return 0.5 * (ddd) ** (1. / 3.) -
sasmodels/models/line.py
rec45c4f r416609b 9 9 .. math:: 10 10 11 I(q) = A + B \cdot q11 I(q) = \text{scale} (A + B \cdot q) + \text{background} 12 12 13 13 .. note:: … … 15 15 16 16 .. math:: 17 I(q) = I(qx) \cdot I(qy)17 I(q) = \text{scale} (I(qx) \cdot I(qy)) + \text{background} 18 18 19 19 References … … 51 51 """ 52 52 inten = intercept + slope*q 53 # TODO: In SasView code additional formula for list has been specified.54 # if inten(x) = intercept + slope*x:55 # then if q is a list, Iq=inten(x[0]*math.cos(x[1]))*inten(x[0]*math.sin(x[1]))56 53 return inten 57 54 … … 65 62 :return: 2D-Intensity 66 63 """ 67 # TODO: SasView document ion lists 2D intensity as Iq(qx)*Iq(qy) but code says:68 # return self._line(x[1])64 # TODO: SasView documents 2D intensity as Iq(qx)*Iq(qy), but returns Iq(qy) 65 # Note: SasView.run([r, theta]) does return Iq(qx)*Iq(qy) 69 66 return Iq(qx, *args)*Iq(qy, *args) 70 67 71 68 Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 72 69 73 demo = dict(scale=1.0, background=0, intercept=1.0, slope=1.0)74 75 70 tests = [ 76 77 [{'intercept': 1.0, 78 'slope': 1.0, 79 }, 1.0, 2.001], 80 81 [{'intercept': 1.0, 82 'slope': 1.0, 83 }, 0.0, 1.001], 84 85 [{'intercept': 1.0, 86 'slope': 1.0, 87 }, 0.4, 1.401], 88 89 [{'intercept': 1.0, 90 'slope': 1.0, 91 }, 1.3, 2.301], 92 93 [{'intercept': 1.0, 94 'slope': 1.0, 95 }, 0.5, 1.501], 96 97 [{'intercept': 1.0, 98 'slope': 1.0, 99 }, [0.4, 0.5], [1.401, 1.501]], 100 101 [{'intercept': 1.0, 102 'slope': 1.0, 103 'background': 0.0, 104 }, (1.3, 1.57), 5.911], 71 [{'intercept': 1.0, 'slope': 1.0, }, 1.0, 2.001], 72 [{'intercept': 1.0, 'slope': 1.0, }, 0.0, 1.001], 73 [{'intercept': 1.0, 'slope': 1.0, }, 0.4, 1.401], 74 [{'intercept': 1.0, 'slope': 1.0, }, 1.3, 2.301], 75 [{'intercept': 1.0, 'slope': 1.0, }, 0.5, 1.501], 76 [{'intercept': 1.0, 'slope': 1.0, }, [0.4, 0.5], [1.401, 1.501]], 77 [{'intercept': 1.0, 'slope': 1.0, 'background': 0.0, }, (1.3, 1.57), 5.911], 105 78 ] -
sasmodels/models/onion.py
rec45c4f r416609b 385 385 # "A[1]": 0, "A[2]": -1, "A[3]": 1e-4, "A[4]": 1, 386 386 } 387 -
sasmodels/models/polymer_excl_volume.py
rec45c4f r416609b 93 93 """ 94 94 95 from math import sqrt 96 from numpy import inf, power 95 from numpy import inf, power, sqrt 97 96 from scipy.special import gammainc, gamma 98 97 … … 114 113 115 114 116 def Iq(q, 117 rg=60.0, 118 porod_exp=3.0): 115 def Iq(q, rg=60.0, porod_exp=3.0): 119 116 """ 120 117 :param q: Input q-value (float or [float, float]) … … 144 141 :return: 2D-Intensity 145 142 """ 146 147 143 return Iq(sqrt(qx**2 + qy**2), *args) 148 144 149 145 Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 150 146 151 152 demo = dict(scale=1, background=0.0,153 rg=60.0,154 porod_exp=3.0)155 147 156 148 tests = [ -
sasmodels/models/two_lorentzian.py
rec45c4f r416609b 34 34 """ 35 35 36 from math import sqrt 37 from numpy import inf, power 36 from numpy import inf, power, sqrt 38 37 39 38 name = "two_lorentzian"
Note: See TracChangeset
for help on using the changeset viewer.