Changeset fcd5e83 in sasmodels
- Timestamp:
- Feb 8, 2016 9:49:08 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:
- 43cb3b8
- Parents:
- a9d4d1f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/line.py
r0cb1c7a rfcd5e83 20 20 21 21 """ 22 23 from numpy import vectorize24 22 from numpy import inf 25 23 … … 40 38 ["slope", "Ang*cm^-1", 1.0, [-inf, inf], "", "slope in linear model"], 41 39 ] 40 # pylint: enable=bad-whitespace, line-too-long 42 41 43 42 def Iq(q, intercept, slope): … … 48 47 :return: Calculated Intensity 49 48 """ 50 51 49 inten = intercept + slope*q 52 50 return inten … … 63 61 #TODO: Instrcution tels 2D has different deffinition than oher models 64 62 #return Iq(sqrt(qx ** 2 + qy ** 2), *args) 65 return Iq(qx, *args)*Iq(qy,*args)63 return Iq(qx, *args)*Iq(qy, *args) 66 64 67 65 Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 68 66 69 demo = dict(scale=1, background=0.1, 70 intercept=1.0, slope=1.0) 67 demo = dict(intercept=1.0, slope=1.0) 71 68 72 69 oldname = "LineModel" 73 oldpars = dict(intercept='A', slope='B', scale=None) 70 oldpars = dict(intercept='A', slope='B', scale=None, background=None) 71 72 tests = [ 73 # Accuracy tests based on content in test/utest_other_models.py 74 [{'intercept': 1.0, 75 'slope': 1.0, 76 }, 0.4, 0.4], 77 78 [{'intercept': 1.0, 79 'slope': 1.0, 80 }, 1.3, 1.3], 81 82 [{'intercept': 1.0, 83 'slope': 1.0, 84 },0.5, 0.5], 85 86 [{'intercept': 1.0, 87 'slope': 1.0, 88 }, 1.57, 1.57], 89 ]
Note: See TracChangeset
for help on using the changeset viewer.