Changeset d277229 in sasmodels for sasmodels/models/parallelepiped.py
- Timestamp:
- Sep 7, 2018 5:29:38 AM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 3c60146
- Parents:
- 2a12351b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/parallelepiped.py
r71b751d rd277229 231 231 source = ["lib/gauss76.c", "parallelepiped.c"] 232 232 have_Fq = True 233 234 def ER(length_a, length_b, length_c): 235 """ 236 Return effective radius (ER) for P(q)*S(q) 237 """ 238 # now that axes can be in any size order, need to sort a,b,c 239 # where a~b and c is either much smaller or much larger 240 abc = np.vstack((length_a, length_b, length_c)) 241 abc = np.sort(abc, axis=0) 242 selector = (abc[1] - abc[0]) > (abc[2] - abc[1]) 243 length = np.where(selector, abc[0], abc[2]) 244 # surface average radius (rough approximation) 245 radius = sqrt(np.where(~selector, abc[0]*abc[1], abc[1]*abc[2]) / pi) 246 247 ddd = 0.75 * radius * (2*radius*length + (length + radius)*(length + pi*radius)) 248 return 0.5 * (ddd) ** (1. / 3.) 233 effective_radius_type = ["equivalent sphere","half length_a", "half length_b", "half length_c", 234 "equivalent circular cross-section","half ab diagonal","half diagonal"] 235 236 #def ER(length_a, length_b, length_c): 237 # """ 238 # Return effective radius (ER) for P(q)*S(q) 239 # """ 240 # # now that axes can be in any size order, need to sort a,b,c 241 # # where a~b and c is either much smaller or much larger 242 # abc = np.vstack((length_a, length_b, length_c)) 243 # abc = np.sort(abc, axis=0) 244 # selector = (abc[1] - abc[0]) > (abc[2] - abc[1]) 245 # length = np.where(selector, abc[0], abc[2]) 246 # # surface average radius (rough approximation) 247 # radius = sqrt(np.where(~selector, abc[0]*abc[1], abc[1]*abc[2]) / pi) 248 # 249 # ddd = 0.75 * radius * (2*radius*length + (length + radius)*(length + pi*radius)) 250 # return 0.5 * (ddd) ** (1. / 3.) 249 251 250 252 # VR defaults to 1.0
Note: See TracChangeset
for help on using the changeset viewer.