Changeset 65279d8 in sasmodels
- Timestamp:
- Apr 7, 2016 2:05:21 PM (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:
- 3a45c2c, 416609b
- Parents:
- e6408d0
- Location:
- sasmodels/models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/broad_peak.py
rec45c4f r65279d8 101 101 """ 102 102 return Iq(sqrt(qx ** 2 + qy ** 2), *args) 103 104 103 Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 105 104 -
sasmodels/models/poly_gauss_coil.py
rec45c4f r65279d8 50 50 """ 51 51 52 from numpy import inf, sqrt, exp, power 52 import numpy as np 53 from numpy import inf, exp, power, sqrt 53 54 54 55 name = "poly_gauss_coil" … … 70 71 # pylint: disable = missing-docstring 71 72 u = polydispersity - 1.0 72 z = ((q * radius_gyration) * (q * radius_gyration)) / (1.0 + 2.0 * u) 73 if (q == 0).any(): 74 inten = i_zero 73 z = (q*radius_gyration)**2 / (1.0 + 2.0*u) 74 # need to trap the case of the polydispersity being 1 (ie, monodispersity!) 75 if polydispersity == 1.0: 76 inten = i_zero * 2.0 * (exp(-z) + z - 1.0) 75 77 else: 76 # need to trap the case of the polydispersity being 1 (ie, monodispersity!) 77 if polydispersity == 1: 78 inten = i_zero * 2.0 * (exp(-z) + z - 1.0 ) / (z * z) 79 else: 80 minusoneonu = -1.0 / u 81 inten = i_zero * 2.0 * (power((1.0 + u * z),minusoneonu) + z - 1.0 ) / ((1.0 + u) * (z * z)) 78 inten = i_zero * 2.0 * (power(1.0 + u*z, -1.0/u) + z - 1.0) / (1.0 + u) 79 index = q != 0. 80 inten[~index] = i_zero 81 inten[index] /= z[index]**2 82 82 return inten 83 #Iq.vectorized = True # Iq accepts an array of q values83 Iq.vectorized = True # Iq accepts an array of q values 84 84 85 85 def Iqxy(qx, qy, *args): 86 86 # pylint: disable = missing-docstring 87 87 return Iq(sqrt(qx ** 2 + qy ** 2), *args) 88 #Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values88 Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 89 89 90 90 demo = dict(scale = 1.0,
Note: See TracChangeset
for help on using the changeset viewer.