Changeset 2c74c11 in sasmodels for sasmodels/models/broad_peak.py
- Timestamp:
- Jul 24, 2016 8:56:45 PM (8 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:
- a4280bd
- Parents:
- f1765a2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/broad_peak.py
r65279d8 r2c74c11 41 41 """ 42 42 43 from numpy import inf, sqrt43 from numpy import inf, errstate 44 44 45 45 name = "broad_peak" … … 87 87 :return: Calculated intensity 88 88 """ 89 90 inten = (porod_scale / q ** porod_exp + lorentz_scale 91 / (1.0 + (abs(q - peak_pos) * lorentz_length) ** lorentz_exp)) 89 z = abs(q - peak_pos) * lorentz_length 90 with errstate(divide='ignore'): 91 inten = (porod_scale / q ** porod_exp 92 + lorentz_scale / (1 + z ** lorentz_exp)) 92 93 return inten 93 94 Iq.vectorized = True # Iq accepts an array of q values 94 95 def Iqxy(qx, qy, *args):96 """97 :param qx: Input q_x-value98 :param qy: Input q_y-value99 :param args: Remaining arguments100 :return: 2D-Intensity101 """102 return Iq(sqrt(qx ** 2 + qy ** 2), *args)103 Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values104 95 105 96 demo = dict(scale=1, background=0,
Note: See TracChangeset
for help on using the changeset viewer.