Changeset 0542fe1 in sasmodels
- Timestamp:
- Dec 20, 2016 4:29:22 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 2586093f
- Parents:
- f1ec7002
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/unified_power_Rg.py
rb3f2a24 r0542fe1 85 85 86 86 def Iq(q, level, rg, power, B, G): 87 ilevel = int(level)88 if ilevel == 0:87 level = int(level + 0.5) 88 if level == 0: 89 89 with errstate(divide='ignore'): 90 90 return 1./q … … 92 92 with errstate(divide='ignore', invalid='ignore'): 93 93 result = np.zeros(q.shape, 'd') 94 for i in range( ilevel):94 for i in range(level): 95 95 exp_now = exp(-(q*rg[i])**2/3.) 96 96 pow_now = (erf(q*rg[i]/sqrt(6.))**3/q)**power[i] 97 if i < ilevel-1:97 if i < level-1: 98 98 exp_next = exp(-(q*rg[i+1])**2/3.) 99 99 else: … … 101 101 result += G[i]*exp_now + B[i]*exp_next*pow_now 102 102 103 result[q == 0] = np.sum(G[: ilevel])103 result[q == 0] = np.sum(G[:level]) 104 104 return result 105 105
Note: See TracChangeset
for help on using the changeset viewer.