Changeset 4c08e69 in sasmodels


Ignore:
Timestamp:
Jan 9, 2018 12:14:34 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
c11d09f
Parents:
22279a4 (diff), 791281c (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' into boltzmann

Files:
2 added
18 edited

Legend:

Unmodified
Added
Removed
  • extra/pylint.rc

    rb669b49 r6e68289  
    2121# List of plugins (as comma separated values of python modules names) to load, 
    2222# usually to register additional checkers. 
    23 load-plugins=pylint_numpy,pylint_pyopencl,pylint_sas 
     23#load-plugins=pylint_numpy,pylint_scipy,pylint_pyopencl,pylint_sas 
    2424 
    2525# Use multiple processes to speed up Pylint. 
     
    280280# (useful for modules/projects where namespaces are manipulated during runtime 
    281281# and thus existing member attributes cannot be deduced by static analysis 
    282 ignored-modules=numpy,np,numpy.random, 
    283     bumps,sas, 
     282ignored-modules=bumps,sas,numpy,numpy.random,scipy,scipy.special 
    284283 
    285284# List of classes names for which member attributes should not be checked 
  • sasmodels/models/_spherepy.py

    r2d81cfe ref07e95  
    4040John Wiley and Sons, New York, (1955) 
    4141 
    42 *2013/09/09 and 2014/01/06 - Description reviewed by S King and P Parker.* 
     42* **Last Reviewed by:** S King and P Parker **Date:** 2013/09/09 and 2014/01/06 
    4343""" 
    4444 
  • sasmodels/models/be_polyelectrolyte.py

    r2d81cfe ref07e95  
    6767* **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    6868* **Last Modified by:** Paul Kienzle **Date:** July 24, 2016 
    69 * **Last Reviewed by:** Paul Butler and Richard Heenan **Date:** 
    70   October 07, 2016 
     69* **Last Reviewed by:** Paul Butler and Richard Heenan **Date:** October 07, 2016 
    7170""" 
    7271 
  • sasmodels/models/fractal_core_shell.py

    r2d81cfe ref07e95  
    5555 
    5656* **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    57 * **Last Modified by:** Paul Butler and Paul Kienzle **on:** November 27, 2016 
    58 * **Last Reviewed by:** Paul Butler and Paul Kienzle **on:** November 27, 2016 
     57* **Last Modified by:** Paul Butler and Paul Kienzle **Date:** November 27, 2016 
     58* **Last Reviewed by:** Paul Butler and Paul Kienzle **Date:** November 27, 2016 
    5959""" 
    6060 
  • sasmodels/models/multilayer_vesicle.py

    r2d81cfe ref07e95  
    107107* **Last Modified by:** Paul Kienzle **Date:** Feb 7, 2017 
    108108* **Last Reviewed by:** Paul Butler **Date:** March 12, 2017 
    109  
    110109""" 
    111110 
  • sasmodels/models/parallelepiped.py

    r2d81cfe ref07e95  
    167167---------------------------- 
    168168 
    169 * **Author:** This model is based on form factor calculations implemented 
    170   in a c-library provided by the NIST Center for Neutron Research (Kline, 2006). 
     169* **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    171170* **Last Modified by:**  Paul Kienzle **Date:** April 05, 2017 
    172171* **Last Reviewed by:**  Richard Heenan **Date:** April 06, 2017 
  • sasmodels/models/polymer_micelle.py

    r2d81cfe r791281c  
    2828.. math:: 
    2929    P(q) &= N^2\beta^2_s\Phi(qr)^2 + N\beta^2_cP_c(q) 
    30             + 2N^2\beta_s\beta_cS_{sc}s_c(q) + N(N-1)\beta_c^2S_{cc}(q) \\ 
     30            + 2N^2\beta_s\beta_cS_{sc}(q) + N(N-1)\beta_c^2S_{cc}(q) \\ 
    3131    \beta_s &= V_\text{core}(\rho_\text{core} - \rho_\text{solvent}) \\ 
    3232    \beta_c &= V_\text{corona}(\rho_\text{corona} - \rho_\text{solvent}) 
     
    6969 
    7070J Pedersen, *J. Appl. Cryst.*, 33 (2000) 637-640 
     71 
     72* **Modified by:** Richard Heenan **Date:** March 20, 2016 
     73* **Verified by:** Paul Kienzle **Date:** November 29, 2017 
     74* **Description modified by:** Paul Kienzle **Date:** November 29, 2017 
     75* **Description reviewed by:** Steve King **Date:** November 30, 2017 
    7176""" 
    7277 
  • sasmodels/models/pringle.py

    r2d81cfe ref07e95  
    4343Derivation by Stefan Alexandru Rautu. 
    4444 
    45 **Author:** Andrew Jackson **on:** 2008 
    46  
    47 **Last Modified by:** Wojciech Wpotrzebowski **on:** March 20, 2016 
    48  
    49 **Last Reviewed by:** Andrew Jackson **on:** September 26, 2016 
     45* **Author:** Andrew Jackson **Date:** 2008 
     46* **Last Modified by:** Wojciech Wpotrzebowski **Date:** March 20, 2016 
     47* **Last Reviewed by:** Andrew Jackson **Date:** September 26, 2016 
    5048""" 
    5149 
  • sasmodels/models/raspberry.py

    r2d81cfe ref07e95  
    102102Science*, 343(1) (2010) 36-41 
    103103 
    104 **Author:** Andrew Jackson **on:** 2008 
    105  
    106 **Modified by:** Andrew Jackson **on:** March 20, 2016 
    107  
    108 **Reviewed by:** Andrew Jackson **on:** March 20, 2016 
     104* **Author:** Andrew Jackson **Date:** 2008 
     105* **Modified by:** Andrew Jackson **Date:** March 20, 2016 
     106* **Reviewed by:** Andrew Jackson **Date:** March 20, 2016 
    109107""" 
    110108 
  • sasmodels/models/sphere.py

    r2d81cfe ref07e95  
    4040John Wiley and Sons, New York, (1955) 
    4141 
    42 *2013/09/09 and 2014/01/06 - Description reviewed by S King and P Parker.* 
     42* **Last Reviewed by:** S King and P Parker **Date:** 2013/09/09 and 2014/01/06 
    4343""" 
    4444 
  • sasmodels/models/spinodal.py

    r2d81cfe ref07e95  
    2626 
    2727* **Author:** Dirk Honecker **Date:** Oct 7, 2016 
    28 * **Last Modified by:** 
    29 * **Last Reviewed by:** 
    3028""" 
    3129 
  • sasmodels/models/stacked_disks.py

    r2d81cfe ref07e95  
    106106 
    107107* **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    108 * **Last Modified by:** Paul Butler and Paul Kienzle **on:** November 26, 2016 
    109 * **Last Reviewed by:** Paul Butler and Paul Kienzle **on:** November 26, 2016 
     108* **Last Modified by:** Paul Butler and Paul Kienzle **Date:** November 26, 2016 
     109* **Last Reviewed by:** Paul Butler and Paul Kienzle **Date:** November 26, 2016 
    110110""" 
    111111 
  • sasmodels/models/triaxial_ellipsoid.py

    r2d81cfe r37f08d2  
    162162    Returns the effective radius used in the S*P calculation 
    163163    """ 
    164     import numpy as np 
    165164    from .ellipsoid import ER as ellipsoid_ER 
    166165 
  • sasmodels/models/two_lorentzian.py

    r2d81cfe ref07e95  
    2727None. 
    2828 
    29 **Author:** NIST IGOR/DANSE **on:** pre 2010 
    30  
    31 **Last Modified by:** Piotr rozyczko **on:** January 29, 2016 
    32  
    33 **Last Reviewed by:** Paul Butler **on:** March 21, 2016 
     29* **Author:** NIST IGOR/DANSE **Date:** pre 2010 
     30* **Last Modified by:** Piotr rozyczko **Date:** January 29, 2016 
     31* **Last Reviewed by:** Paul Butler **Date:** March 21, 2016 
    3432""" 
    3533 
  • sasmodels/models/two_power_law.py

    r2d81cfe ref07e95  
    3737None. 
    3838 
    39 **Author:** NIST IGOR/DANSE **on:** pre 2010 
    40  
    41 **Last Modified by:** Wojciech Wpotrzebowski **on:** February 18, 2016 
    42  
    43 **Last Reviewed by:** Paul Butler **on:** March 21, 2016 
     39* **Author:** NIST IGOR/DANSE **Date:** pre 2010 
     40* **Last Modified by:** Wojciech Wpotrzebowski **Date:** February 18, 2016 
     41* **Last Reviewed by:** Paul Butler **Date:** March 21, 2016 
    4442""" 
    4543 
  • sasmodels/models/vesicle.py

    r2d81cfe ref07e95  
    5656Sons, New York, (1955) 
    5757 
    58 **Author:** NIST IGOR/DANSE **on:** pre 2010 
    59  
    60 **Last Modified by:** Paul Butler **on:** March 20, 2016 
    61  
    62 **Last Reviewed by:** Paul Butler **on:** March 20, 2016 
     58* **Author:** NIST IGOR/DANSE **Date:** pre 2010 
     59* **Last Modified by:** Paul Butler **Date:** March 20, 2016 
     60* **Last Reviewed by:** Paul Butler **Date:** March 20, 2016 
    6361""" 
    6462 
  • doc/guide/pd/polydispersity.rst

    reda8b30 r22279a4  
    4242calculations are generally more robust with more data points or more angles. 
    4343 
    44 The following five distribution functions are provided: 
     44The following distribution functions are provided: 
    4545 
    4646*  *Rectangular Distribution* 
     47*  *Uniform Distribution* 
    4748*  *Gaussian Distribution* 
    4849*  *Lognormal Distribution* 
    4950*  *Schulz Distribution* 
    5051*  *Array Distribution* 
     52*  *Boltzmann Distribution* 
    5153 
    5254These are all implemented as *number-average* distributions. 
     
    8587    Rectangular distribution. 
    8688 
     89Uniform Distribution 
     90^^^^^^^^^^^^^^^^^^^^^^^^ 
     91 
     92The Uniform Distribution is defined as 
     93 
     94    .. math:: 
     95 
     96        f(x) = \frac{1}{\text{Norm}} 
     97        \begin{cases} 
     98          1 & \text{for } |x - \bar x| \leq \sigma \\ 
     99          0 & \text{for } |x - \bar x| > \sigma 
     100        \end{cases} 
     101 
     102    where $\bar x$ is the mean of the distribution, $\sigma$ is the half-width, and 
     103    *Norm* is a normalization factor which is determined during the numerical 
     104    calculation. 
     105 
     106    Note that the polydispersity is given by 
     107 
     108    .. math:: \text{PD} = \sigma / \bar x 
     109 
     110    .. figure:: pd_uniform.jpg 
     111 
     112        Uniform distribution. 
     113 
    87114.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    88115 
     
    183210^^^^^^^^^^^^^^^^^^ 
    184211 
    185 This user-definable distribution should be given as as a simple ASCII text 
     212This user-definable distribution should be given as a simple ASCII text 
    186213file where the array is defined by two columns of numbers: $x$ and $f(x)$. 
    187214The $f(x)$ will be normalized to 1 during the computation. 
     
    202229given for the model will have no affect, and will be ignored when computing 
    203230the average.  This means that any parameter with an array distribution will 
    204 not be fittable. 
     231not be fitable. 
     232 
     233.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     234 
     235Boltzmann Distribution 
     236^^^^^^^^^^^^^^^^^^^^^^ 
     237 
     238The Boltzmann Distribution is defined as 
     239 
     240.. math:: 
     241 
     242    f(x) = \frac{1}{\text{Norm}} 
     243           \exp\left(-\frac{ | x - \bar x | }{\sigma}\right) 
     244 
     245where $\bar x$ is the mean of the distribution and *Norm* is a normalization 
     246factor which is determined during the numerical calculation. 
     247The width is defined as 
     248 
     249.. math:: \sigma=\frac{k T}{E} 
     250 
     251which is the inverse Boltzmann factor, 
     252where $k$ is the Boltzmann constant, $T$ the temperature in Kelvin and $E$ a 
     253characteristic energy per particle. 
     254 
     255.. figure:: pd_boltzmann.jpg 
     256 
     257    Boltzmann distribution. 
    205258 
    206259.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
  • sasmodels/weights.py

    r2d81cfe r34bbb9c  
    9797        return x, px 
    9898 
     99class UniformDispersion(Dispersion): 
     100    r""" 
     101    Uniform dispersion, with width $\sigma$. 
     102 
     103    .. math:: 
     104 
     105        w = 1 
     106    """ 
     107    type = "uniform" 
     108    default = dict(npts=35, width=0, nsigmas=1) 
     109    def _weights(self, center, sigma, lb, ub): 
     110        x = self._linspace(center, sigma, lb, ub) 
     111        x = x[np.fabs(x-center) <= np.fabs(sigma)] 
     112        return x, np.ones_like(x) 
    99113 
    100114class RectangleDispersion(Dispersion): 
     
    190204        return x, px 
    191205 
     206class BoltzmannDispersion(Dispersion): 
     207    r""" 
     208    Boltzmann dispersion, with $\sigma=k T/E$. 
     209 
     210    .. math:: 
     211 
     212        w = \exp\left( -|x - c|/\sigma\right) 
     213    """ 
     214    type = "boltzmann" 
     215    default = dict(npts=35, width=0, nsigmas=3) 
     216    def _weights(self, center, sigma, lb, ub): 
     217        x = self._linspace(center, sigma, lb, ub) 
     218        px = np.exp(-np.abs(x-center) / np.abs(sigma)) 
     219        return x, px 
    192220 
    193221# dispersion name -> disperser lookup table. 
     
    196224MODELS = OrderedDict((d.type, d) for d in ( 
    197225    RectangleDispersion, 
     226    UniformDispersion, 
    198227    ArrayDispersion, 
    199228    LogNormalDispersion, 
    200229    GaussianDispersion, 
    201230    SchulzDispersion, 
     231    BoltzmannDispersion 
    202232)) 
    203233 
Note: See TracChangeset for help on using the changeset viewer.