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

Home » Public Forums » archive » How to obtain running averages for different time scales in IDL?
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
How to obtain running averages for different time scales in IDL? [message #87388] Thu, 30 January 2014 08:00 Go to next message
atmospheric physics is currently offline  atmospheric physics
Messages: 121
Registered: June 2010
Senior Member
Hello,

Can anyone provide me information on how to compute running averages for different time scales for a variable, which is a function of time @ 1 sec resolution?

I wanted to obtain the running averages of the variable at different time stamps, say 1, minute, 5 minutes, 15 minutes, 30 minutes, 1 hour etc. and then calculate the residue of the running average values of the variable w.r.t the raw variable data. Any IDL examples will be of great help.

Thanks in advance...
Re: How to obtain running averages for different time scales in IDL? [message #87389 is a reply to message #87388] Thu, 30 January 2014 08:23 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den torsdagen den 30:e januari 2014 kl. 17:00:56 UTC+1 skrev Madhavan Bomidi:
> Hello,
>
>
>
> Can anyone provide me information on how to compute running averages for different time scales for a variable, which is a function of time @ 1 sec resolution?
>
>
>
> I wanted to obtain the running averages of the variable at different time stamps, say 1, minute, 5 minutes, 15 minutes, 30 minutes, 1 hour etc. and then calculate the residue of the running average values of the variable w.r.t the raw variable data. Any IDL examples will be of great help.
>
>
>
> Thanks in advance...

I'm not sure what you mean by wanting the running average at just a number of time stamps. Is this similar to what you want to do?

IDL> a=randomn(seed,1000)
IDL> cgplot,a
IDL> N=10
IDL> b=convol(a,replicate(1.,N)/N)
IDL> cgplot,/over,b,color='red'
IDL> N=100
IDL> b=convol(a,replicate(1.,N)/N)
IDL> cgplot,/over,b,color='blue'

Then you just have to figure out N for the time scales you are interested in.
Re: How to obtain running averages for different time scales in IDL? [message #87392 is a reply to message #87388] Thu, 30 January 2014 10:43 Go to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
> Can anyone provide me information on how to compute running averages for different time scales for a variable, which is a function of time @ 1 sec resolution?

I do not use the Convol function ever, but you can do it using Smooth().... See Phil Blitzer's answer here:
https://groups.google.com/forum/#!topic/comp.lang.idl-pvwave /rIl0HsZtpGE

Adding to that, look at the EDGE_TRUNCATE keyword in Smooth()

samples_per_second = 1
nSamples = 86400 * samples_per_second
seconds_per_minute = 60

time = findgen(nSamples)
data = randomu(0, nSamples)
data_avg = smooth(data, samples_per_second*seconds_per_minute)

residue = data - data_avg
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: trigrid + triangulate -> zero values -> ignore zeros on cgcontour
Next Topic: How many selfs do I have?

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

Current Time: Wed Oct 08 13:47:40 PDT 2025

Total time taken to generate the page: 0.00788 seconds