On Fri, 23 Nov 2007, Angus McMorland wrote: > For parsimony, I think you're probably best off just using the > Gaussian equation: > > def fwhm2k(fwhm): > '''converts fwhm value to k (see above)''' > return fwhm/(2 * n.sqrt( n.log( 2 ) ) ) > > def gauss1d(r, fwhm, c): > '''returns the 1d gaussian given by fwhm (full-width at half-max), > and c (centre) at positions given by r > ''' > return exp( -(r-c)**2 / fwhm2k( fwhm )**2 )
Thank you, Angus. I'll look at the Gaussian explanation to understand the input values. > The midpoint here is c. OK. > It's not clear what you mean by endpoints - if you mean you want to be > able to specify the y value at a given x delta-x away from c, then it > should be relatively simple to solve the equation to find the required > full-width at half-max to achieve these end-points. After a very quick > look (i.e. definitely needs verification), I think What I mean is the x value where the tails of the curve have y == 0.0. These curves are defined by the range of x over which they are valid, and assume the midpoint is where y == 1.0 (the maximum value). The inflection points are at y = 0.5; in rare situations that may change. > I hope that's what you're after. I'll look at it in detail tomorrow (my time) and the weekend. I, too, hope that it's what I need. Much appreciated, Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users