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

Home » Public Forums » archive » constant time cadence
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: constant time cadence [message #94362 is a reply to message #94361] Thu, 20 April 2017 05:46 Go to previous messageGo to previous message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
Interpolation (see function interpol) or nearest neighbor. Example:

n=10
new_data=replicate(!values.f_nan,n)
new_time=lindgen(n)*300L

for i=0L, n-1 do begin
dist=min(abs(your_time - new_time[i]),pos)
if dist lt 5 then new_data[i]=your_data[pos]
endfor

In this example "your_time" and "your_data" are you arrays. Note that I set a tolerance of 5 seconds, you could change that...


Using interpol, would be something like:

new_data=interpol(your_data,your_time,new_time)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Saving file after editting
Next Topic: How to get _overloadSize to return N_Dimensions=0?

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

Current Time: Wed Oct 08 15:27:46 PDT 2025

Total time taken to generate the page: 0.00490 seconds