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

Home » Public Forums » archive » Re: Correlate function (bug?)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Correlate function (bug?) [message #11085] Mon, 16 March 1998 00:00
wmc is currently offline  wmc
Messages: 117
Registered: February 1995
Senior Member
In article 9AA03CE1@fz-juelich.de, Theo Brauers <Th.Brauers@fz-juelich.de> writes:
> I was facing a problem with the correlate function
> which is demonstrated by the following IDL procedure:

> pro testc
> x=[1.D-5, 1.D-6, 0.0]
> y=[1.D-5, 1.1D-6, 0.0]
> print, correlate(x,y, /double)

> giving the following result:
>
> NAN

The problem is due to stupid programming in the correlate function.
You can look at the source in $IDL_DIR/lib/correlate.pro.
There is a tolerance (set to 1e-12 at /double, or 1e-6 otherwise) and if
||x'||^2*||y'||^2 is less than this, NAN is returned. Double precision should be
good for a lot better than 1e-12, and anyway its more the ratio between x and y
that would matter not the absolute value. Ho hum.

Just take the code and insert tol=0 in the appropriate place...

ps - the documentation doesn't mention this tolerance factor, presumably to avoid
worrying our pretty little heads...

- William

---
William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: How to upgrade IDL, Poor support
Next Topic: Re: Is there a worthy printing utility

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

Current Time: Wed Oct 08 15:47:22 PDT 2025

Total time taken to generate the page: 0.00512 seconds