Changeset f1a8811 in sasmodels


Ignore:
Timestamp:
Sep 27, 2016 5:20:54 PM (4 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:
050c2c8
Parents:
bb46723
Message:

conform to sasview definition of lognormal distribution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/weights.py

    rbb46723 rf1a8811  
    120120    def _weights(self, center, sigma, lb, ub): 
    121121        x = self._linspace(center, sigma, max(lb, 1e-8), max(ub, 1e-8)) 
    122         px = np.exp(-0.5*(np.log(x)-center)**2/sigma**2)/(x*sigma) 
     122        # sigma in the lognormal function is in ln(R) space, thus needs converting 
     123        sig = np.fabs(sigma/center) 
     124        px = np.exp(-0.5*((np.log(x)-np.log(center))/sig)**2)/(x*sig) 
    123125        return x, px 
    124126 
     
    246248        pylab.grid(True) 
    247249        pylab.legend() 
     250        #pylab.show() 
Note: See TracChangeset for help on using the changeset viewer.