Changeset 6dd90c1 in sasmodels for sasmodels/models/poly_gauss_coil.py
- Timestamp:
- Mar 16, 2016 9:25:21 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:
- 63776d3
- Parents:
- 5111921
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/poly_gauss_coil.py
r4c05f49 r6dd90c1 67 67 68 68 # NB: Scale and Background are implicit parameters on every model 69 def Iq(q, radius_gyration, polydispersity):69 def Iq(q, i_zero, radius_gyration, polydispersity): 70 70 # pylint: disable = missing-docstring 71 71 u = polydispersity - 1.0 72 72 # TO DO 73 74 75 z = ((x * radius_gyration) * (x * radius_gyration))/ (1.0 + 2.0 * u)76 if x== 0:77 78 79 80 81 Iq.vectorized = True# Iq accepts an array of q values73 # should trap the case of polydispersity = 1 by switching to a taylor expansion 74 minusoneonu = -1.0 / u 75 z = (q * radius_gyration) ** 2 / (1.0 + 2.0 * u) 76 if q == 0: 77 inten = i_zero * 1.0 78 else: 79 inten = i_zero * 2.0 * (power((1.0 + u * z),minusoneonu) + z - 1.0 ) / ((1.0 + u) * (z * z)) 80 return inten 81 #Iq.vectorized = True # Iq accepts an array of q values 82 82 83 83 def Iqxy(qx, qy, *args): 84 84 # pylint: disable = missing-docstring 85 85 return Iq(sqrt(qx ** 2 + qy ** 2), *args) 86 Iqxy.vectorized =True # Iqxy accepts an array of qx, qy values86 #Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 87 87 88 88 demo = dict(scale = 1.0,
Note: See TracChangeset
for help on using the changeset viewer.