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

*Subject*: Re: Question about tutorial in 1D Gaussian Filter*From*: coraluk(at)hkpc.org (Cora)*Date*: 30 Jul 2001 23:15:14 -0700*Newsgroups*: comp.lang.idl-pvwave*Organization*: http://groups.google.com/*References*: <b19810c5.0107292330.37dd66aa@posting.google.com> <onr8uygjxs.fsf@cow.physics.wisc.edu>*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:25909

Craig Markwardt <craigmnet@cow.physics.wisc.edu> wrote in message news:<onr8uygjxs.fsf@cow.physics.wisc.edu>... > coraluk@hkpc.org (Cora) writes: > > > > I want to use a 1D Gaussian Filter to fit a curve. After visiting the > > tutorial about 1D Curve fitting in IDL, I still found some problems in > > the function gauss1. Following are the questions: > > > > 1) What is the return of "size(x)"? > > > > 2) What is meant by "!dpi"? > > > Cora, GAUSS1 is my program, so perhaps I should respond. > > I should be clear first of all, that computing the gaussian *should* > be as simple as EXP(-Z^2/2). Unfortunately, the exponential function > is sensitive to underflow warnings. If Z is too large, then > EXP(-Z^2/2) will underflow. My personal wish is that this would yield > zero silently, but that is not what happens. > > All of the code you see in GAUSS1 is designed to avoid the warning, > but maintain as much precision as possible. The SIZE function is used > to determine the dimension and data type of a variable. I use it that > function to decide whether the data is FLOAT or DOUBLE. You can look > up !DPI in the manual under system variables. > > If you like, a function like the following one may be easier to > understand, but will produce underflow warnings: > > FUNCTION SIMPLEGAUSS, X, P > return, P(2)*EXP(-(X-P(0))^2/(2.*P(1)^2)) > END > > Good luck, > Craig Thank you for your answers. However, there are some follow up questions after using the function simplegauss. (I have added some checking to avoid underflow and overflow) In the function simplegauss, I only need to input my X values, mean and sd of Y, and the area. Then I get a bell shape of a gaussian distribution. Is this a correct result of function simplegauss? If yes, then how can this result apply to my data to get a best fit, smooth curve. Yours, Cora

**Follow-Ups**:**Re: Question about tutorial in 1D Gaussian Filter***From:*Craig Markwardt

**References**:**Question about tutorial in 1D Gaussian Filter***From:*Cora

**Re: Question about tutorial in 1D Gaussian Filter***From:*Craig Markwardt

- Prev by Date:
**Using C++ DLM's With IDL?** - Next by Date:
**Re: IDL crashing badly on my solaris 8 system** - Prev by thread:
**Re: Question about tutorial in 1D Gaussian Filter** - Next by thread:
**Re: Question about tutorial in 1D Gaussian Filter** - Index(es):