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

Home » Public Forums » archive » Resampling data with irregular time base
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Resampling data with irregular time base [message #15693] Sat, 05 June 1999 00:00 Go to previous message
krieger is currently offline  krieger
Messages: 7
Registered: June 1997
Junior Member
I have data with an irregular time base, which I would like to resample
in a regular spaced time base. How can I average over all original data
points in each interval of the new time vector without resorting to a
FOR loop?
Currently I am using this horrible kludge:

deltat = newtime[1] - newtime[0]
FOR n=0, n_elements(newtime)-1 DO BEGIN
index = where((oldtime GT (newtime[n]-deltat/2.)) AND $
(oldtime LE (newtime[n]+deltat/2.)), $
count)
IF count GT 0 THEN newdata[n] = total(olddata[index]) / count
ENDFOR

Any idea how to transform this in vectorized IDL code? At the moment I
see no way apart from writing the function in C and calling it by
linkimage.

Best

Karl

--
To reply by email please replace domain .NOSPAM by .de in reply address
[Message index]
 
Read Message
Read Message
Previous Topic: Making MPEG Movies
Next Topic: IDL Syntax specification

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

Current Time: Sat Oct 11 15:01:53 PDT 2025

Total time taken to generate the page: 1.28039 seconds