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 #63359 is a reply to message #63357] Tue, 04 November 2008 13:30 Go to previous messageGo to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
Chad Bender wrote:
> Hi all -
>
> 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.
>
> I can do something like this, but there has to be a better way
>
> good=FINITE(data)
> i=0L
> WHILE i LT N_ELEMENTS(data) DO BEGIN
> IF i EQ 0 THEN i++ ELSE BEGIN
>
>
ind= where(finite(data),count)
then, values = data[ind]

Jean
[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: Thu Oct 09 22:55:05 PDT 2025

Total time taken to generate the page: 0.96019 seconds