Changeset 10576d1 in sasmodels


Ignore:
Timestamp:
Feb 16, 2015 6:25:36 PM (9 years ago)
Author:
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:
d547f16
Parents:
250fa25
Message:

add hankel function and sesans demo (not yet integrated with models)

Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/spherepy.py

    rb3f6bc3 r10576d1  
    5858""" 
    5959 
    60 from numpy import pi, inf, sin, cos, sqrt 
     60import numpy as np 
     61from numpy import pi, inf, sin, cos, sqrt, exp, log 
    6162 
    6263name = "sphere" 
     
    105106Iqxy.vectorized = True 
    106107 
     108def sesans(z, sld, solvent_sld, radius): 
     109    """ 
     110    Calculate SESANS-correlation function for a solid sphere. 
     111 
     112    Wim Bouwman after formulae Timofei Kruglov J.Appl.Cryst. 2003 article 
     113    """ 
     114    d = z/radius 
     115    g = np.zeros_like(z) 
     116    g[d==0] = 1. 
     117    low = ((d > 0) & (d < 2)) 
     118    dlow = d[low] 
     119    dlow2 = dlow**2 
     120    g[low] = sqrt(1-dlow2/4.)*(1+dlow2/8.) + dlow2/2.*(1-dlow2/16.)*log(dlow/(2.+sqrt(4.-dlow2))) 
     121    return g 
     122sesans.vectorized = True 
     123 
    107124def ER(radius): 
    108125    return radius 
Note: See TracChangeset for help on using the changeset viewer.