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

Home » Public Forums » archive » Re: help on creating a mean array of data
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: help on creating a mean array of data [message #45981 is a reply to message #45949] Fri, 21 October 2005 11:11 Go to previous messageGo to previous message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
pimpk24@hotmail.com wrote:
> hello, iam very new to idl and would appreciate any help anyone could
> give on performing the following task:
>
> I have a large array of data which is meteorological data from multiple
> days. The data for each day is consistent (i.e. same amount) and i need
> a program that can average each kind of data
>
> For example, I have something like the following:
>
> day a :
> temp-1
> temp-2
> temp-3
>
> day b :
> temp-1
> temp-2
> temp-3
>
>
>
>
> and I need the following:
>
> day a+b:
> temp-1
> temp-2
> temp-3
>
>
> thanks for any feedback
>

If you have one array which looks like

t = [dayA_t1, dayA_t2, dayA_t3, dayB_t1, dayB_t2, dayB_t3]

you can do the following

;; turn array into a 2-dimensional array with one day per row
;; and one temperature per column
t = reform(t, n_temps, n_days, /overwrite)

;; calculate daily average for each temperature. total(.., 2)
;; will sum over the 2nd dimension (sum up all days),
;; then divide by the number of days.
t_avg = total(t, 2) / n_days


Good luck,
Benjamin
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: How to display both wavenumber & wavelength (Z-profile window) in ENVI
Next Topic: Re: Problem: Opening a 20-30MB sized ShapeFile

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

Current Time: Fri Oct 10 10:35:31 PDT 2025

Total time taken to generate the page: 0.88107 seconds