Rich Shepard wrote: > 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. > Rich: The tails of a Gaussian never reach zero - they just asymptote to zero for large x. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 ------------------------------------------------------------------------- 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