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

Home » Public Forums » archive » Re: moving average of a large array
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: moving average of a large array [message #51499 is a reply to message #51487] Thu, 23 November 2006 19:58 Go to previous messageGo to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <1164296828.559622.31580@m7g2000cwm.googlegroups.com>,
"Jenny" <envi35@yahoo.ca> wrote:

> Hi, I want to calculate the moving average of a large array:
> data[800,800,365]. The moving average is for the 3rd dimension - day of
> year. But TS_SMOOTH only works for a vector. Anyone knows if there is
> another function in IDL that I could use? I probably can use TS_SMOOTH
> and for loops to get this, but it will be slow. In addition, there are
> invalid data in my array as well.
>
> I've read discussions in this list about adding Dimension and NAN
> keywords to other functions, such as Total, Median, etc., which are
> very useful. Why nobody cares about TS_SMOOTH? Or am I asking a silly
> question? Is there an obvious way to calculate the moving average of a
> large array?
>
>
> Thanks,
> Jenny

If x = FLTARR(800, 800, 365)

try

y = SMOOTH(x, [1, 1, 3])

This runs a boxcar smoother, which has awful spectral characteristics.
You also might want to consider what to do at the edges.

Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: ENVI - Output to external format - seem to be losing georeferencing
Next Topic: IDLy approach to splatting points on a grid?

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

Current Time: Sat Oct 11 06:19:20 PDT 2025

Total time taken to generate the page: 1.12124 seconds