Changeset 4f611f1 in sasmodels
- Timestamp:
- Jun 29, 2017 1:05:14 AM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- e5d7a60
- Parents:
- 4f0c993
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/special.py
r859567e r4f611f1 283 283 return scipy.special.sici(x)[0] 284 284 285 def sas_j1(x): 286 if np.isscalar(x): 287 retvalue = (sin(x) - x*cos(x))/x**2 if x != 0. else 0. 288 else: 289 with np.errstate(all='ignore'): 290 retvalue = (sin(x) - x*cos(x))/x**2 291 retvalue[x == 0.] = 0. 292 285 293 def sas_3j1x_x(x): 286 retvalue = 3*sas_j1(x)/x 287 retvalue[x==0] = 1. 294 if np.isscalar(x): 295 retvalue = 3*(sin(x) - x*cos(x))/x**3 if x != 0. else 1. 296 else: 297 with np.errstate(all='ignore'): 298 retvalue = 3*(sin(x) - x*cos(x))/x**3 299 retvalue[x == 0.] = 1. 300 return retvalue 288 301 289 302 def sas_2J1x_x(x): 290 retvalue = 2*sas_J1(x)/x 291 retvalue[x==0] = 1. 303 if np.isscalar(x): 304 retvalue = 2*sas_J1(x)/x if x != 0 else 1. 305 else: 306 with np.errstate(all='ignore'): 307 retvalue = 2*sas_J1(x)/x 308 retvalue[x==0] = 1. 309 return retvalue 292 310 293 311
Note: See TracChangeset
for help on using the changeset viewer.