Changeset 465e627 in sasmodels


Ignore:
Timestamp:
Mar 20, 2016 12:26:43 PM (8 years ago)
Author:
wojciech
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:
39674a0, 8ad9619
Parents:
1805a9e (diff), 4416868 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of https://github.com/SasView/sasmodels

Files:
3 added
12 edited

Legend:

Unmodified
Added
Removed
  • example/sesans_parameters_css-hs.py

    r84db7a5 r3415f4f  
    2222# Initial parameter values (if other than defaults) 
    2323initial_vals = { 
    24     "core_sld" : 1.0592, 
    25     "solvent_sld" : 2.88, 
     24    "sld_core" : 1.0592, 
     25    "sld_solvent" : 2.88, 
    2626    "radius" : 890, 
    2727    "thickness" : 130 
  • sasmodels/kerneldll.py

    r17bbadd r6ad0e87  
    5151import ctypes as ct 
    5252from ctypes import c_void_p, c_int, c_longdouble, c_double, c_float 
     53import _ctypes 
    5354 
    5455import numpy as np 
     
    125126    if callable(model_info.get('Iq', None)): 
    126127        return PyModel(model_info) 
    127  
     128     
    128129    dtype = np.dtype(dtype) 
    129130    if dtype == generate.F16: 
     
    138139    else: 
    139140        tempfile_prefix = 'sas_' + model_info['name'] + '128_' 
    140  
     141  
    141142    source = generate.convert_type(source, dtype) 
    142143    source_files = generate.model_sources(model_info) + [model_info['filename']] 
     
    188189    Call :meth:`release` when done with the kernel. 
    189190    """ 
     191     
    190192    def __init__(self, dllpath, model_info, dtype=generate.F32): 
    191193        self.info = model_info 
     
    217219        self.Iqxy = self.dll[generate.kernel_name(self.info, True)] 
    218220        self.Iqxy.argtypes = IQXY_ARGS + pd_args_2d + [fp]*Nfixed2d 
     221         
     222        self.release() 
    219223 
    220224    def __getstate__(self): 
     
    230234        kernel = self.Iqxy if q_input.is_2d else self.Iq 
    231235        return DllKernel(kernel, self.info, q_input) 
    232  
     236     
    233237    def release(self): 
    234238        """ 
    235239        Release any resources associated with the model. 
    236240        """ 
    237         pass # TODO: should release the dll 
     241        if os.name == 'nt': 
     242            #dll = ct.cdll.LoadLibrary(self.dllpath) 
     243            dll = ct.CDLL(self.dllpath) 
     244            libHandle = dll._handle 
     245            #libHandle = ct.c_void_p(dll._handle) 
     246            del dll, self.dll 
     247            self.dll = None 
     248            #_ctypes.FreeLibrary(libHandle) 
     249            ct.windll.kernel32.FreeLibrary(libHandle) 
     250        else:     
     251            pass  
    238252 
    239253 
  • sasmodels/models/correlation_length.py

    r326281f r0cc31e1  
    1616incoherent background B and the two exponents n and m are used as fitting 
    1717parameters. (Respectively $porod\_scale$, $lorentz\_scale$, $background$, $exponent\_p$ and  
    18 $exponent\_l$ in the parameter list.) The remaining parameter \xi is a correlation  
     18$exponent\_l$ in the parameter list.) The remaining parameter \ |xi|\ is a correlation  
    1919length for the polymer chains. Note that when m=2 this functional form becomes the  
    2020familiar Lorentzian function. Some interpretation of the values of A and C may be  
  • sasmodels/models/elliptical_cylinder.py

    r74fd96f r0cc31e1  
    1212.. figure:: img/elliptical_cylinder_geometry.png 
    1313 
    14    Elliptical cylinder geometry $a$ = $r_{minor}$ and \nu = $axis\_ratio$ = $r_{major} / r_{minor}$ 
     14   Elliptical cylinder geometry $a$ = $r_{minor}$ and \ |nu|\ = $axis\_ratio$ = $r_{major} / r_{minor}$ 
    1515 
    1616The function calculated is 
  • sasmodels/models/fuzzy_sphere.py

    raa2edb2 r0cc31e1  
    1919 
    2020    A(q) = \frac{3\left[\sin(qR) - qR \cos(qR)\right]}{(qR)^3} 
    21            \exp\left(\frac{-(o_{fuzzy}q)^2}{2}\right) 
     21           \exp\left(\frac{-(\sigma_{fuzzy}q)^2}{2}\right) 
    2222 
    2323Here *|A(q)|*:sup:`2`\  is the form factor, *P(q)*. The scale is equivalent to the 
     
    2626solvent. 
    2727 
    28 Poly-dispersion in radius and in fuzziness is provided for. 
     28Poly-dispersion in radius and in fuzziness is provided for, though the fuzziness 
     29must be kept much smaller than the sphere radius for meaningful results. 
    2930 
    3031 
     
    6566or just volume fraction for absolute scale data 
    6667radius: radius of the solid sphere 
    67 fuzziness = the STD of the height of fuzzy interfacial 
     68fuzziness = the standard deviation of the fuzzy interfacial 
    6869thickness (ie., so-called interfacial roughness) 
    6970sld: the SLD of the sphere 
     
    7677# pylint: disable=bad-whitespace,line-too-long 
    7778# ["name", "units", default, [lower, upper], "type","description"], 
    78 parameters = [["sld",         "1e-6/Ang^2",  1, [-inf, inf], "",       "Layer scattering length density"], 
    79               ["solvent_sld", "1e-6/Ang^2",  3, [-inf, inf], "",       "Solvent scattering length density"], 
     79parameters = [["sld",         "1e-6/Ang^2",  1, [-inf, inf], "",       "Particle scattering length density"], 
     80              ["sld_solvent", "1e-6/Ang^2",  3, [-inf, inf], "",       "Solvent scattering length density"], 
    8081              ["radius",      "Ang",        60, [0, inf],    "volume", "Sphere radius"], 
    81               ["fuzziness",   "Ang",        10, [0, inf],    "",       "The STD of the height of fuzzy interfacial"], 
     82              ["fuzziness",   "Ang",        10, [0, inf],    "",       "std deviation of Gaussian convolution for interface (must be << radius)"], 
    8283             ] 
    8384# pylint: enable=bad-whitespace,line-too-long 
     
    9596    const double bes = sph_j1c(qr); 
    9697    const double qf = q*fuzziness; 
    97     const double fq = bes * (sld - solvent_sld) * form_volume(radius) * exp(-0.5*qf*qf); 
     98    const double fq = bes * (sld - sld_solvent) * form_volume(radius) * exp(-0.5*qf*qf); 
    9899    return 1.0e-4*fq*fq; 
    99100    """ 
     
    102103    // never called since no orientation or magnetic parameters. 
    103104    //return -1.0; 
    104     return Iq(sqrt(qx*qx + qy*qy), sld, solvent_sld, radius, fuzziness); 
     105    return Iq(sqrt(qx*qx + qy*qy), sld, sld_solvent, radius, fuzziness); 
    105106    """ 
    106107 
     
    114115 
    115116demo = dict(scale=1, background=0.001, 
    116             sld=1, solvent_sld=3, 
     117            sld=1, sld_solvent=3, 
    117118            radius=60, 
    118119            fuzziness=10, 
     
    121122 
    122123oldname = "FuzzySphereModel" 
    123 oldpars = dict(sld='sldSph', solvent_sld='sldSolv', radius='radius', fuzziness='fuzziness') 
     124oldpars = dict(sld='sldSph', sld_solvent='sldSolv', radius='radius', fuzziness='fuzziness') 
    124125 
    125126 
  • sasmodels/models/gauss_lorentz_gel.py

    raa2edb2 rb8954d7  
    22This model calculates the scattering from a gel structure, 
    33but typically a physical rather than chemical network. 
    4 It is modeled as a sum of a low-q exponential decay plus 
    5 a lorentzian at higher-q values. 
     4It is modeled as a sum of a low-q exponential decay (which happens to 
     5give a functional form similar to Guinier scattering, so interpret with  
     6care) plus a Lorentzian at higher-q values. See also the gel_fit model. 
    67 
    78Definition 
     
    1617$\Xi$ is the length scale of the static correlations in the gel, 
    1718which can be attributed to the "frozen-in" crosslinks. 
    18 $\xi is the dynamic correlation length, which can be attributed to the 
     19\ |xi|\ is the dynamic correlation length, which can be attributed to the 
    1920fluctuating polymer chains between crosslinks. 
    20 $IG(0)$ and $IL(0)$ are the scaling factors for each of these structures. 
     21$I_G(0)$ and $I_L(0)$ are the scaling factors for each of these structures. 
    2122Think carefully about how these map to your particular system! 
    2223 
  • sasmodels/models/gel_fit.py

    raa2edb2 rb8954d7  
    88and a longer distance (denoted here as $a2$ ) needed to account for the static 
    99accumulations of polymer pinned down by junction points or clusters of such 
    10 points. The latter is derived from a simple Guinier function. 
     10points. The latter is derived from a simple Guinier function. Compare also the  
     11gauss_lorentz_gel model. 
    1112 
    1213 
     
    3334 
    3435 
    35 Reference 
    36 --------- 
     36References 
     37---------- 
    3738 
    3839Mitsuhiro Shibayama, Toyoichi Tanaka, Charles C Han, 
     
    6061# pylint: disable=bad-whitespace, line-too-long 
    6162#             ["name", "units", default, [lower, upper], "type","description"], 
    62 parameters = [["guinier_scale",    "cm^{-1}",   1.7, [-inf, inf], "", "Guinier length scale"], 
    63               ["lorentzian_scale", "cm^{-1}",   3.5, [-inf, inf], "", "Lorentzian length scale"], 
     63parameters = [["guinier_scale",    "cm^-1",   1.7, [-inf, inf], "", "Guinier length scale"], 
     64              ["lorentzian_scale", "cm^-1",   3.5, [-inf, inf], "", "Lorentzian length scale"], 
    6465              ["gyration_radius",  "Ang",     104.0, [2, inf],    "", "Radius of gyration"], 
    6566              ["fractal_exp",      "",          2.0, [0, inf],    "", "Fractal exponent"], 
  • sasmodels/models/guinier.py

    ra84a0ca r45330ed  
    55This model fits the Guinier function 
    66 
    7 .. math:: q_1=\frac{1}{R_g}\sqrt{\frac{(m-s)(3-s)}{2}} 
     7.. math:: I(q) = scale \exp{\left[ \frac{-Q^2R_g^2}{3} \right]} 
    88 
    99to the data directly without any need for linearisation 
    10 (*cf*. $\ln I(q)$ vs $q^2$\ ). 
     10(*cf*. the usual plot of $\ln I(q)$ vs $q^2$\ ). Note that you may have to  
     11restrict the data range to include small q only, where the Guinier approximation 
     12actually applies. See also the guinier_porod model. 
    1113 
    1214For 2D data the scattering intensity is calculated in the same way as 1D, 
     
    2729title = "" 
    2830description = """ 
    29  I(q) = scale exp ( - rg^2 q^2 / 3.0 ) 
     31 I(q) = scale.exp ( - rg^2 q^2 / 3.0 ) 
    3032  
    3133    List of default parameters: 
  • sasmodels/models/guinier_porod.py

    raa2edb2 r45330ed  
    3939Note that the radius-of-gyration for a sphere of radius R is given by $R_g = R \sqrt(3/5)$. 
    4040 
    41 The cross-sectional radius-of-gyration for a randomly oriented cylinder 
    42 of radius R is given by $R_g = R / \sqrt(2)$. 
     41For a cylinder of radius $R$ and length $L$,    $R_g^2 = \frac{L^2}{12} + \frac{R^2}{2}$ 
    4342 
    44 The cross-sectional radius-of-gyration of a randomly oriented lamella 
     43from which the cross-sectional radius-of-gyration for a randomly oriented thin  
     44cylinder is $R_g = R / \sqrt(2)$. 
     45 
     46and the cross-sectional radius-of-gyration of a randomly oriented lamella 
    4547of thickness $T$ is given by $R_g = T / \sqrt(12)$. 
    4648 
  • sasmodels/models/raspberry.c

    rbad8b12 ra2d8a67  
    2121double Iq(double q, 
    2222          double sld_lg, double sld_sm, double sld_solvent, 
    23           double volfraction_lg, double volfraction_sm, double surf_fraction, 
     23          double volfraction_lg, double volfraction_sm, double surface_fraction, 
    2424          double radius_lg, double radius_sm, double penetration) 
    2525{ 
     
    3737    sldL = sld_lg; 
    3838    vfS = volfraction_sm; 
     39    fSs = surface_fraction; 
    3940    rS = radius_sm; 
    40     aSs = surf_fraction; 
    4141    sldS = sld_sm; 
    4242    deltaS = penetration; 
     
    4848    VL = M_4PI_3*rL*rL*rL; 
    4949    VS = M_4PI_3*rS*rS*rS; 
    50     Np = aSs*4.0*pow(((rL+deltaS)/rS), 2.0); 
    51     fSs = Np*vfL*VS/vfS/VL; 
    52      
    53     Np2 = aSs*4.0*(rS/(rL+deltaS))*VL/VS;  
    54     fSs2 = Np2*vfL*VS/vfS/VL; 
     50 
     51    //Number of small particles per large particle 
     52    Np = vfS*fSs*VL/vfL/VS; 
     53 
     54    //Total scattering length difference 
    5555    slT = delrhoL*VL + Np*delrhoS*VS; 
    5656 
    57     sfLS = sph_j1c(q*rL)*sph_j1c(q*rS)*sinc(q*(rL+deltaS*rS)); 
    58     sfSS = sph_j1c(q*rS)*sph_j1c(q*rS)*sinc(q*(rL+deltaS*rS))*sinc(q*(rL+deltaS*rS)); 
    59          
    60     f2 = delrhoL*delrhoL*VL*VL*sph_j1c(q*rL)*sph_j1c(q*rL);  
    61     f2 += Np2*delrhoS*delrhoS*VS*VS*sph_j1c(q*rS)*sph_j1c(q*rS);  
    62     f2 += Np2*(Np2-1)*delrhoS*delrhoS*VS*VS*sfSS;  
    63     f2 += 2*Np2*delrhoL*delrhoS*VL*VS*sfLS; 
     57    //Form factors for each particle 
     58    psiL = sph_j1c(q*rL); 
     59    psiS = sph_j1c(q*rS); 
     60 
     61    //Cross term between large and small particles 
     62    sfLS = psiL*psiS*sinc(q*(rL+deltaS*rS)); 
     63    //Cross term between small particles at the surface 
     64    sfSS = psiS*psiS*sinc(q*(rL+deltaS*rS))*sinc(q*(rL+deltaS*rS)); 
     65 
     66    //Large sphere form factor term 
     67    f2 = delrhoL*delrhoL*VL*VL*psiL*psiL; 
     68    //Small sphere form factor term 
     69    f2 += Np*delrhoS*delrhoS*VS*VS*psiS*psiS; 
     70    //Small particle - small particle cross term 
     71    f2 += Np*(Np-1)*delrhoS*delrhoS*VS*VS*sfSS; 
     72    //Large-small particle cross term 
     73    f2 += 2*Np*delrhoL*delrhoS*VL*VS*sfLS; 
     74    //Normalise by total scattering length difference 
    6475    if (f2 != 0.0){ 
    6576        f2 = f2/slT/slT; 
    6677        } 
    6778 
    68     f2 = f2*(vfL*delrhoL*delrhoL*VL + vfS*fSs2*Np2*delrhoS*delrhoS*VS); 
    69  
    70     f2+= vfS*(1.0-fSs)*pow(delrhoS, 2)*VS*sph_j1c(q*rS)*sph_j1c(q*rS); 
     79    //I(q) for large-small composite particles 
     80    f2 = f2*(vfL*delrhoL*delrhoL*VL + vfS*fSs*Np*delrhoS*delrhoS*VS); 
     81    //I(q) for free small particles 
     82    f2+= vfS*(1.0-fSs)*delrhoS*delrhoS*VS*psiS*psiS; 
    7183     
    7284    // normalize to single particle volume and convert to 1/cm 
  • sasmodels/models/raspberry.py

    rbad8b12 r2c1bbcdd  
    33---------- 
    44 
    5 The large and small spheres have their own SLD, as well as the solvent. The 
    6 surface coverage term is a fractional coverage (maximum of approximately 0.9 
    7 for hexagonally-packed spheres on a surface). Since not all of the small 
    8 spheres are necessarily attached to the surface, the excess free (small) 
    9 spheres scattering is also included in the calculation. The function calculate 
    10 follows equations (8)-(12) of the reference below, and the equations are not 
    11 reproduced here. 
    12  
    13 No inter-particle scattering is included in this model. 
    14  
     5The figure below shows a schematic of a large droplet surrounded by several 
     6smaller particles forming a structure similar to that of Pickering emulsions. 
    157 
    168.. figure:: img/raspberry_geometry.jpg 
    179 
    1810    Schematic of the raspberry model 
    19      
    20 where *Ro* is the radius of the large sphere, *Rp* the radius of the smaller  
    21 spheres on the surface and |delta| = the fractional penetration depth. 
    2211 
    23 For 2D data: The 2D scattering intensity is calculated in the same way as 1D, 
    24 where the *q* vector is defined as 
     12In order to calculate the form factor of the entire complex, the self- 
     13correlation of the large droplet, the self-correlation of the particles, the 
     14correlation terms between different particles and the cross terms between large 
     15droplet and small particles all need to be calculated. 
     16 
     17Consider two infinitely thin shells of radii R1 and R2 separated by distance r. 
     18The general structure of the equation is then the form factor of the two shells 
     19multiplied by the phase factor that accounts for the separation of their 
     20centers. 
    2521 
    2622.. math:: 
    2723 
    28     q = \sqrt{q_x^2 + q_y^2} 
     24    S(q) = \frac{sin(qR_1)}{qR_1}\frac{sin(qR_2)}{qR_2}\frac{sin(qr)}{qr} 
     25 
     26In this case, the large droplet and small particles are solid spheres rather 
     27than thin shells. Thus the two terms must be integrated over $R_L$ and $R_S$ 
     28respectively using the weighting function of a sphere. We then obtain the 
     29functions for the form of the two spheres: 
     30 
     31.. math:: 
     32 
     33    \Psi_L = \int_0^{R_L}(4\pi R^2_L)\frac{sin(qR_L)}{qR_L}dR_L =  
     34    \frac{3[sin(qR_L)-qR_Lcos(qR_L)]}{(qR_L)^2} 
     35 
     36.. math:: 
     37 
     38    \Psi_S = \int_0^{R_S}(4\pi R^2_S)\frac{sin(qR_S)}{qR_S}dR_S = 
     39    \frac{3[sin(qR_S)-qR_Lcos(qR_S)]}{(qR_S)^2} 
     40 
     41The cross term between the large droplet and small particles is given by: 
     42 
     43.. math:: 
     44    S_{LS} = \Psi_L\Psi_S\frac{sin(q(R_L+\delta R_S))}{q(R_L+\delta\ R_S)} 
     45 
     46and the self term between small particles is given by: 
     47 
     48.. math:: 
     49    S_{SS} = \Psi_S^2\biggl[\frac{sin(q(R_L+\delta R_S))}{q(R_L+\delta\ R_S)} 
     50    \biggr]^2 
     51 
     52The number of small particles per large droplet, $N_p$, is given by: 
     53 
     54.. math:: 
     55 
     56    N_p = \frac{\phi_S\phi_{surface}V_L}{\phi_L V_S} 
     57 
     58where $\phi_S$ is the volume fraction of small particles in the sample, 
     59$\phi_{surface}$ is the fraction of the small particles that are adsorbed to 
     60the large droplets, $\phi_L$ is the volume fraction of large droplets in the 
     61sample, and $V_S$ and $V_L$ are the volumes of individual small particles and 
     62large droplets respectively. 
     63 
     64The form factor of the entire complex can now be calculated including the excess 
     65scattering length densities of the components $\Delta\rho_L$ and $\Delta\rho_S$, 
     66where $\Delta\rho_x = |\rho_x-\rho_{solvent}|$ : 
     67 
     68.. math:: 
     69 
     70    P_{LS} = \frac{1}{M^2}\bigl[(\Delta\rho_L)^2V_L^2\Psi_L^2 
     71                +N_p(\Delta\rho_S)^2V_S^2\Psi_S^2 
     72                + N_p(1-N_p)(\Delta\rho_S)^2V_S^2S_{SS} 
     73                + 2N_p\Delta\rho_L\Delta\rho_SV_LV_SS_{LS}\bigr] 
     74 
     75where M is the total scattering length of the whole complex : 
     76 
     77.. math:: 
     78    M = \Delta\rho_LV_L + N_p\Delta\rho_SV_S 
     79 
     80In a real system, there will ususally be an excess of small particles such that 
     81some fraction remain unbound. Therefore the overall scattering intensity is 
     82given by: 
     83 
     84.. math:: 
     85    I(Q) = I_{LS}(Q) + I_S(Q) = (\phi_L(\Delta\rho_L)^2V_L +  
     86            \phi_S\phi_{surface}N_p(\Delta\rho_S)^2V_S)P_{LS} 
     87            + \phi_S(1-\phi_{surface})(\Delta\rho_S)^2V_S\Psi_S^2 
     88 
     89A useful parameter to extract is the fraction of the surface area of the large 
     90droplets that is covered by small particles. This can be calculated from the 
     91model parameters as: 
     92 
     93.. math:: 
     94    \chi = \frac{4\phi_L\phi_{surface}(R_L+\delta R_S)}{\phi_LR_S} 
    2995 
    3096 
     
    3298---------- 
    3399 
    34 K Larson-Smith, A Jackson, and D C Pozzo, *Small angle scattering model for Pickering emulsions and raspberry* 
    35 *particles*, *Journal of Colloid and Interface Science*, 343(1) (2010) 36-41 
     100K Larson-Smith, A Jackson, and D C Pozzo, *Small angle scattering model for 
     101Pickering emulsions and raspberry particles*, *Journal of Colloid and Interface 
     102Science*, 343(1) (2010) 36-41 
    36103 
    37 **Author:** Andrew jackson **on:** 2008 
     104**Author:** Andrew Jackson **on:** 2008 
    38105 
    39 **Modified by:** Paul Butler **on:** March 18, 2016 
     106**Modified by:** Andrew Jackson **on:** March 20, 2016 
    40107 
    41 **Reviewed by:** Paul Butler **on:** March 18, 2016 
     108**Reviewed by:** Andrew Jackson **on:** March 20, 2016 
    42109""" 
    43110 
     
    50117description = """ 
    51118                RaspBerryModel: 
    52                 volf_Lsph = volume fraction large spheres 
    53                 radius_Lsph = radius large sphere (A) 
    54                 sld_Lsph = sld large sphere (A-2) 
    55                 volf_Ssph = volume fraction small spheres 
    56                 radius_Ssph = radius small sphere (A) 
    57                 surfrac_Ssph = fraction of small spheres at surface 
    58                 sld_Ssph = sld small sphere 
    59                 delta_Ssph = small sphere penetration (A)  
    60                 sld_solv   = sld solvent 
     119                volfraction_lg = volume fraction large spheres 
     120                radius_lg = radius large sphere (A) 
     121                sld_lg = sld large sphere (A-2) 
     122                volfraction_sm = volume fraction small spheres 
     123                radius_sm = radius small sphere (A) 
     124                surface_fraction = fraction of small spheres at surface 
     125                sld_sm = sld small sphere 
     126                penetration = small sphere penetration (A) 
     127                sld_solvent   = sld solvent 
    61128                background = background (cm-1) 
    62129            Ref: J. coll. inter. sci. (2010) vol. 343 (1) pp. 36-41.""" 
     
    74141              ["volfraction_sm", "", 0.005, [-inf, inf], "", 
    75142               "volume fraction of small spheres"], 
    76               ["surf_fraction", "", 0.4, [-inf, inf], "", 
     143              ["surface_fraction", "", 0.4, [-inf, inf], "", 
    77144               "fraction of small spheres at surface"], 
    78145              ["radius_lg", "Ang", 5000, [0, inf], "volume", 
     
    80147              ["radius_sm", "Ang", 100, [0, inf], "", 
    81148               "radius of small spheres"], 
    82               ["penetration", "Ang", 0.0, [0, inf], "", 
    83                "penetration depth of small spheres into large sphere"], 
     149              ["penetration", "Ang", 0, [-1, 1], "", 
     150               "fractional penetration depth of small spheres into large sphere"], 
    84151             ] 
    85152 
     
    89156demo = dict(scale=1, background=0.001, 
    90157            sld_lg=-0.4, sld_sm=3.5, sld_solvent=6.36, 
    91             volfraction_lg=0.05, volfraction_sm=0.005, surf_fraction=0.4, 
     158            volfraction_lg=0.05, volfraction_sm=0.005, surface_fraction=0.4, 
    92159            radius_lg=5000, radius_sm=100, penetration=0.0, 
    93160            radius_lg_pd=.2, radius_lg_pd_n=10) 
     
    95162# For testing against the old sasview models, include the converted parameter 
    96163# names and the target sasview model name. 
    97 oldname = 'RaspBerryModel' 
    98 oldpars = dict(sld_lg='sld_Lsph', sld_sm='sld_Ssph', sld_solvent='sld_solv', 
    99                volfraction_lg='volf_Lsph', volfraction_sm='volf_Ssph', 
    100                surf_fraction='surfrac_Ssph', 
    101                radius_lg='radius_Lsph', radius_sm='radius_Ssph', 
    102                penetration='delta_Ssph') 
    103  
    104164 
    105165# NOTE: test results taken from values returned by SasView 3.1.2, with 
  • sasmodels/sesans.py

    rd459d4e ra154ad16  
    2626    q_max is determined by the acceptance angle of the SESANS instrument. 
    2727    """ 
     28    from sas.sascalc.data_util.nxsunit import Converter 
     29 
    2830    q_min = dq = 0.1 * 2*pi / Rmax 
    29     return np.arange(q_min, q_max, dq) 
     31    return np.arange(q_min, Converter("1/A")(q_max[0], units=q_max[1]), dq) 
    3032     
    3133def make_all_q(data): 
Note: See TracChangeset for help on using the changeset viewer.