Changeset 2c74c11 in sasmodels for sasmodels/models/correlation_length.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/correlation_length.py
rec45c4f r2c74c11 34 34 """ 35 35 36 from numpy import inf, sqrt36 from numpy import inf, errstate 37 37 38 38 name = "correlation_length" … … 57 57 1D calculation of the Correlation length model 58 58 """ 59 porod = porod_scale / pow(q, exponent_p) 60 lorentz = lorentz_scale / (1.0 + pow(q * cor_length, exponent_l)) 59 with errstate(divide='ignore'): 60 porod = porod_scale / q**exponent_p 61 lorentz = lorentz_scale / (1.0 + (q * cor_length)**exponent_l) 61 62 inten = porod + lorentz 62 63 return inten 63 64 def Iqxy(qx, qy, lorentz_scale, porod_scale, cor_length, exponent_p, exponent_l): 65 """ 66 2D calculation of the Correlation length model 67 There is no orientation contribution. 68 """ 69 q = sqrt(qx ** 2 + qy ** 2) 70 return Iq(q, lorentz_scale, porod_scale, cor_length, exponent_p, exponent_l) 64 Iq.vectorized = True 71 65 72 66 # parameters for demo
Note: See TracChangeset
for help on using the changeset viewer.