[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about tutorial in 1D Gaussian Filter






coraluk@hkpc.org (Cora) writes:
> > FUNCTION SIMPLEGAUSS, X, P
> >   return, P(2)*EXP(-(X-P(0))^2/(2.*P(1)^2))
> > END

Hi Cora--

Here are the parameters P to SIMPLEGAUSS. Unlike GAUSS1, the final
parameter is simply the maximum value, not the area under the curve.
It's "simple" after all.

P(0) - position of centroid
P(1) - gaussian sigma
P(2) - maximum amplitude (not area of curve)

To use it, check out the tutorial, and try something like this:

  p = mpfitfun('SIMPLEGAUSS', x, y, err, p0)
  bestfit = simplegauss(x, p)

Much of this information is in the "frequently asked questions" for
the web page.  Or, you can download MPFITPEAK, which is a function
specifically designed for fitting gaussian and other type peaks to
data.  It automatically returns the best fit curve.

Craig

http://cow.physics.wisc.edu/~craigm/idl/

-- 
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------