Changeset 2556095 in sasmodels
- Timestamp:
- Feb 18, 2016 4:54:20 AM (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:
- e66075f
- Parents:
- 4a82d4d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/line.py
r2fb1d88 r2556095 1 1 r""" 2 2 This model calculates intensity using simple linear function 3 3 4 Definition 4 5 ---------- … … 24 25 """ 25 26 from numpy import inf 26 from numpy import cos27 from numpy import sin28 27 29 28 name = "line" … … 40 39 # pylint: disable=bad-whitespace, line-too-long 41 40 # ["name", "units", default, [lower, upper], "type", "description"], 42 parameters = [["intercept", "1/cm",1.0, [-inf, inf], "", "intercept in linear model"],43 ["slope", "Ang/cm", 44 41 parameters = [["intercept", "1/cm", 1.0, [-inf, inf], "", "intercept in linear model"], 42 ["slope", "Ang/cm", 1.0, [-inf, inf], "", "slope in linear model"], 43 ] 45 44 # pylint: enable=bad-whitespace, line-too-long 46 45 … … 53 52 """ 54 53 inten = intercept + slope*q 54 # TODO: In SasView code additional formula for list has been specifded. 55 # if inten(x) = intercept + slope*x: 56 # then if q is a list, Iq=inten(x[0]*math.cos(x[1]))*inten(x[0]*math.sin(x[1])) 55 57 return inten 56 58 … … 64 66 :return: 2D-Intensity 65 67 """ 66 # TODO: Instrcution tels 2D has different deffinition than oher models67 # return Iq(qy,*args)*Iq(qy,*args)68 return 68 # TODO: SasView documention lists 2D intensity as Iq(qx)*Iq(qy) but in code is: 69 # return self._line(x[1]) 70 return Iq(qx, *args)*Iq(qy, *args) 69 71 70 Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values72 Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 71 73 72 74 demo = dict(scale=1.0, background=0, intercept=1.0, slope=1.0) … … 76 78 77 79 tests = [ 80 81 [{'intercept': 1.0, 82 'slope': 1.0, 83 }, 1.0, 2.0], 84 85 [{'intercept': 1.0, 86 'slope': 1.0, 87 }, 0.0, 1.0], 78 88 79 89 [{'intercept': 1.0, … … 95 105 [{'intercept': 1.0, 96 106 'slope': 1.0, 97 }, (1.3, 1.57), 2.30238060425],107 }, (1.3, 1.57), 5.911], 98 108 ]
Note: See TracChangeset
for help on using the changeset viewer.