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

Home » Public Forums » archive » Re: Correlate and NAN
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: Correlate and NAN [message #23156 is a reply to message #23155] Mon, 08 January 2001 09:08 Go to previous messageGo to previous message
Andy Loughe is currently offline  Andy Loughe
Messages: 174
Registered: November 1995
Senior Member
Why not simply perform the correlation on a subset of the larger arrays,
that portion with the NaNs removed? Something like:

indices = [ where( finite(dataset1) eq 1 ), where( finite(dataset2) eq 2
) ]

common_indices = indices( UNIQ(indices, sort(indices)) )

Result = CORRELATE( dataset1(common_indices), dataset2(common_indices)
)


Ben Tupper wrote:
>
> Hello,
>
> I have two datasets that I would like to correlate using the CORRELATE
> function. Each dataset has some members flagged as NANs; the NANs are
> not neccessarily coincident. The online documentation makes no mention
> of NAN-handling, but the procedure in the lib directory indicates (see
> modifications history) that it handles NANs (although there is no
> keyword for it). It doesn't really handle NANs the way I expect it
> to. For example, repeated calls to the TOTAL function don't set the
> keyword NAN, so TOTAL doesn't check for NANs.
>
> I'm not sure if it is reasonable to involve NANs in a correlation... but
> it seems reasonable to request that the routine ignore NANs in the input
> arguments.
>
> Is there a simple solution to this NAN-jam?
>
> Thanks,
>
> Ben
>
> --
> Ben Tupper
> Bigelow Laboratory for Ocean Sciences
> 180 McKown Point Rd.
> W. Boothbay Harbor, ME 04575
> btupper@bigelow.org

--
Andrew Loughe =====================================================
NOAA/OAR/FSL/AD R/FS5 | email: loughe@fsl.noaa.gov
325 Broadway | wwweb: www-ad.fsl.noaa.gov/users/loughe
Boulder, CO 80305-3328 | phone: 303-497-6211 fax: 303-497-6301
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: count number of pixels and write to a txt file
Next Topic: IDL routine to find contiguous groups of pixels falling within an intensity range

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

Current Time: Wed Oct 08 20:05:20 PDT 2025

Total time taken to generate the page: 0.04192 seconds