Re: Correlate function (bug?) [message #11269 is a reply to message #11103] |
Tue, 17 March 1998 00:00   |
John Smith
Messages: 4 Registered: March 1998
|
Junior Member |
|
|
William Connolley wrote:
> 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
This bug was reported long time ago to RSI and they said they will fix it in one of
their
next releases. Meanwhile I use the old version.
Samuel Haimov
haimov@uwyo.edu
|
|
|