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

Home » Public Forums » archive » averaging w.r.t time resolution
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
averaging w.r.t time resolution [message #87239] Mon, 20 January 2014 05:22 Go to next message
atmospheric physics is currently offline  atmospheric physics
Messages: 121
Registered: June 2010
Senior Member
Hello,

I have a data array for 86400 seconds each day (i.e., @ 1 second resolution). Is there any direct function in IDL which can be used to get the different time resolution (i.e., say 1 minute or 5 minute or 15 minute or 1 hour etc.) averages of the data array with respective time stamp automatically?

Thanks in advance
Re: averaging w.r.t time resolution [message #87240 is a reply to message #87239] Mon, 20 January 2014 06:53 Go to previous messageGo to next message
Matthew is currently offline  Matthew
Messages: 18
Registered: February 2006
Junior Member
> I have a data array for 86400 seconds each day (i.e., @ 1 second resolution). Is there any direct function in IDL which can be used to get the different time resolution (i.e., say 1 minute or 5 minute or 15 minute or 1 hour etc.) averages of the data array with respective time stamp automatically?

I can think of three options:

1. Rebin + Interpol

IDL> data = randomu(1, 86400)
IDL> time = findgen(86400)
IDL> new_time = rebin(time, 17280) ;Every ~5 minutes
IDL> new_data = interpol(data, time, new_time)
http://exelisvis.com/docs/REBIN.html
http://exelisvis.com/docs/INTERPOL.html

2. Congrid + Interpol

IDL> data = randomu(1, 86400)
IDL> time = findgen(86400)
IDL> new_time, congrid(time, 12342) ;Every ~7 minutes
IDL> new_data = interpol(data, time, new_time)
http://exelisvis.com/docs/CONGRID.html

Note that rebin and congrid do different things. Rebin averages while Congrid resamples.


3. Interpol + a little work

Might be helpful:
linspace https://klassenresearch.orbs.com/Emulate+linspace+and+logspa ce
or
In IDL 8.3 use findgen or the colon operator
http://www.exelisvis.com/docs/Other_Operators.html
http://www.exelisvis.com/docs/FINDGEN.html

IDL> data = randomu(1, 86400)
IDL> old_time = findgen(86400)
IDL> nMinute = 7 ;Minute intervals
IDL> nTimes = 86400/nMinute ;Number of time stamps
IDL> new_time = findgen(nTimes)/(nTimes-1) * 86400
IDL> new_data = interpol(data, old_time, new_time)
Re: averaging w.r.t time resolution [message #87243 is a reply to message #87239] Mon, 20 January 2014 08:23 Go to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
On Monday, January 20, 2014 7:22:05 AM UTC-6, Madhavan Bomidi wrote:

>
> I have a data array for 86400 seconds each day (i.e., @ 1 second resolution). Is there any direct function in IDL which can be used to get the different time resolution (i.e., say 1 minute or 5 minute or 15 minute or 1 hour etc.) averages of the data array with respective time stamp automatically?
>

Well, you need to decide what is statistically correct for averaging your data. Simple boxcar smoothing can be done with SMOOTH.
http://www.exelisvis.com/docs/SMOOTH.html

Look at this as well, and links therein:
http://www.exelisvis.com/Company/PressRoom/Blogs/IDLDataPoin tDetail/TabId/902/ArtMID/2926/ArticleID/13080/Beware-the-beh avior-of-SMOOTH.aspx
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Plotting with colorbar
Next Topic: Subset of a structure?

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

Current Time: Wed Oct 08 11:43:19 PDT 2025

Total time taken to generate the page: 0.00385 seconds