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 #45982 is a reply to message #45981] Fri, 21 October 2005 11:13 Go to previous message
news.qwest.net is currently offline  news.qwest.net
Messages: 137
Registered: September 2005
Senior Member
<pimpk24@hotmail.com> wrote in message
news:1129917339.727669.218770@g49g2000cwa.googlegroups.com.. .
> 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

Simple case:
meanab = (daya+dayb)/2

Also a more general approach that you can apply to an arbitrary
amount of data is as follows: it uses total().

Arrays are rows in idl, so transpose them into columns,
and concatenate.
Make a matrix of data. Arrays are rows in idl, so transpose them
into columns, and concatenate.
IDL> matrix = [transpose(a),transpose(b)]
then total along the rows
IDL> sum = total(matrix,1)
then divide by the number of columns
IDL> ncol = (size(matrix,/dim))[0]
where I've taken the first element of the array returned by size()
IDL> meanab = sum/ncol

For more than 2 days, you can concatenate many rows into the array "matrix".
There are many other ways as well. You may want to look into the rebin()
function.

Cheers,
bob
[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 02:37:49 PDT 2025

Total time taken to generate the page: 0.40211 seconds