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

Home » Public Forums » archive » segment vector with missing data
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
segment vector with missing data [message #63366] Tue, 04 November 2008 13:14
Chad is currently offline  Chad
Messages: 9
Registered: January 2008
Junior Member
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Strange behavior of /cumulative keyword in total()
Next Topic: Re: Lions and tiger and objects, oh my!

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

Current Time: Wed Oct 08 18:08:10 PDT 2025

Total time taken to generate the page: 0.00512 seconds