Changeset 50ec515 in sasmodels for sasmodels/models/spherical_sld.py
- Timestamp:
- Aug 5, 2016 8:35:30 AM (8 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:
- e187b25
- Parents:
- e7fe459
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/spherical_sld.py
r4e0968b r50ec515 15 15 sub-shell is described by a line function, with *n_steps* sub-shells per 16 16 interface. The form factor is normalized by the total volume of the sphere. 17 18 Interface shapes are as follows:: 19 20 0: erf(|nu|*z) 21 1: Rpow(z^|nu|) 22 2: Lpow(z^|nu|) 23 3: Rexp(-|nu|z) 24 4: Lexp(-|nu|z) 17 25 18 26 Definition … … 186 194 category = "shape:sphere" 187 195 188 SHAPES = [ "erf(|nu|*z)", "Rpow(z^|nu|)", "Lpow(z^|nu|)",189 "Rexp(-|nu|z)", "Lexp(-|nu|z)"],196 SHAPES = [["erf(|nu|*z)", "Rpow(z^|nu|)", "Lpow(z^|nu|)", 197 "Rexp(-|nu|z)", "Lexp(-|nu|z)"]] 190 198 191 199 # pylint: disable=bad-whitespace, line-too-long … … 234 242 sld_l = sld[i] 235 243 sld_r = sld[i+1] if i < n_shells-1 else sld_solvent 236 interface = SHAPE_FUNCTIONS[int(np.clip(shape[i], 0, len(SHAPES)-1))]244 fn = SHAPE_FUNCTIONS[int(np.clip(shape[i], 0, len(SHAPE_FUNCTIONS)-1))] 237 245 for step in range(1, n_steps+1): 238 portion = interface(float(step)/n_steps, max(abs(nu[i]), 1e-14))246 portion = fn(float(step)/n_steps, max(abs(nu[i]), 1e-14)) 239 247 z0 += dz 240 248 z.append(z0)
Note: See TracChangeset
for help on using the changeset viewer.