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

Home » Public Forums » archive » Re: segment vector with missing data
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: segment vector with missing data [message #63364 is a reply to message #63359] Tue, 04 November 2008 13:28 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Chad Bender writes:

> This should be an easy problem, but I'm having a hard time figuring it
> out without using a bunch of loops. I've got a vector with N-elements
> (typically N~1000, but could be any number), with some NaNs
> interspersed. Typically, there will be a block of NaNs together, but
> a single NaN by itself is also possible. I want to extract the short
> segments of good data, and their corresponding indices from the
> original vector.

How about this:

goodIndices = Where(Finite(array) EQ 0, COMPLEMENT=badIndices)

The goodIndices finds all the good data, the badIndices
finds all the NANs.

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Moving to objects loses array functionality?
Next Topic: How does IDL locate netCDF?

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

Current Time: Sat Oct 11 01:46:54 PDT 2025

Total time taken to generate the page: 2.63824 seconds