Changeset 4aaf89a in sasmodels for sasmodels/models/parallelepiped.py
- Timestamp:
- Apr 6, 2017 6:11:41 AM (7 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:
- 15a90c1
- Parents:
- b6e0636
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/parallelepiped.py
red0827a r4aaf89a 208 208 def ER(length_a, length_b, length_c): 209 209 """ 210 210 Return effective radius (ER) for P(q)*S(q) 211 211 """ 212 212 # now that axes can be in any size order, need to sort a,b,c where a~b and c is either much smaller 213 # or much larger 214 abc = np.vstack((length_a, length_b, length_c)) 215 abc = np.sort(abc, axis=0) 216 selector = (abc[1] - abc[0]) > (abc[2] - abc[1]) 217 length = np.where(selector, abc[0], abc[2]) 213 218 # surface average radius (rough approximation) 214 surf_rad = sqrt(length_a * length_b/ pi)215 216 ddd = 0.75 * surf_rad * (2 * surf_rad * length_c + (length_c + surf_rad) * (length_c + pi * surf_rad))219 radius = np.sqrt(np.where(~selector, abc[0]*abc[1], abc[1]*abc[2]) / pi) 220 221 ddd = 0.75 * radius * (2*radius*length + (length + radius)*(length + pi*radius)) 217 222 return 0.5 * (ddd) ** (1. / 3.) 218 223
Note: See TracChangeset
for help on using the changeset viewer.