Changeset 50ec515 in sasmodels for sasmodels/models/spherical_sld.py


Ignore:
Timestamp:
Aug 5, 2016 8:35:30 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

spherical sld: document interface shape number→interface relationship since UI doesn't show dropdown list yet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/spherical_sld.py

    r4e0968b r50ec515  
    1515sub-shell is described by a line function, with *n_steps* sub-shells per 
    1616interface. The form factor is normalized by the total volume of the sphere. 
     17 
     18Interface 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) 
    1725 
    1826Definition 
     
    186194category = "shape:sphere" 
    187195 
    188 SHAPES = ["erf(|nu|*z)", "Rpow(z^|nu|)", "Lpow(z^|nu|)", 
    189           "Rexp(-|nu|z)", "Lexp(-|nu|z)"], 
     196SHAPES = [["erf(|nu|*z)", "Rpow(z^|nu|)", "Lpow(z^|nu|)", 
     197           "Rexp(-|nu|z)", "Lexp(-|nu|z)"]] 
    190198 
    191199# pylint: disable=bad-whitespace, line-too-long 
     
    234242        sld_l = sld[i] 
    235243        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))] 
    237245        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)) 
    239247            z0 += dz 
    240248            z.append(z0) 
Note: See TracChangeset for help on using the changeset viewer.