comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Question about tutorial in 1D Gaussian Filter
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Question about tutorial in 1D Gaussian Filter [message #26067 is a reply to message #25929] Mon, 30 July 2001 14:56 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
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

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: plotting free form ascii data
Next Topic: New slackware 8.0 libraries, old executables?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 20:30:40 PDT 2025

Total time taken to generate the page: 3.06778 seconds