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

Home » Public Forums » archive » Averaging of my observations
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 of my observations [message #93253] Sun, 22 May 2016 06:42 Go to next message
Ali Gamal is currently offline  Ali Gamal
Messages: 98
Registered: June 2013
Member
Hi, I have observation saved as .save files
I want to take Averaging for all observations.
How can I do it?
Re: Averaging of my observations [message #93254 is a reply to message #93253] Sun, 22 May 2016 07:36 Go to previous messageGo to next message
dg86 is currently offline  dg86
Messages: 118
Registered: September 2012
Senior Member
On Sunday, May 22, 2016 at 9:42:49 AM UTC-4, AGW wrote:
> Hi, I have observation saved as .save files
> I want to take Averaging for all observations.
> How can I do it?

If you have access to the online documentation for IDL, you should read
http://www.harrisgeospatial.com/docs/RESTORE.html
and
http://www.harrisgeospatial.com/docs/MEAN.html

The first link explains how to restore save files. The second explains how
to obtain the average value of an array.
Re: Averaging of my observations [message #93255 is a reply to message #93253] Sun, 22 May 2016 07:49 Go to previous messageGo to next message
Ali Gamal is currently offline  Ali Gamal
Messages: 98
Registered: June 2013
Member
On Sunday, May 22, 2016 at 3:42:49 PM UTC+2, AGW wrote:
> Hi, I have observation saved as .save files
> I want to take Averaging for all observations.
> How can I do it?

thank you, but the result of mean function is one value, I want to take average for four dimensions.
Re: Averaging of my observations [message #93256 is a reply to message #93255] Sun, 22 May 2016 08:50 Go to previous messageGo to next message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
The MEAN() function will return a vector of values if you use the DIMENSION keyword.

On Sunday, May 22, 2016 at 10:49:11 AM UTC-4, AGW wrote:
> On Sunday, May 22, 2016 at 3:42:49 PM UTC+2, AGW wrote:
>> Hi, I have observation saved as .save files
>> I want to take Averaging for all observations.
>> How can I do it?
>
> thank you, but the result of mean function is one value, I want to take average for four dimensions.
Re: Averaging of my observations [message #93257 is a reply to message #93253] Mon, 23 May 2016 04:39 Go to previous messageGo to next message
Ali Gamal is currently offline  Ali Gamal
Messages: 98
Registered: June 2013
Member
IDL> y=mean(x,dimension=1)
% Keyword DIMENSION not allowed in call to: MEAN
% Execution halted at: $MAIN$
Re: Averaging of my observations [message #93260 is a reply to message #93257] Mon, 23 May 2016 05:42 Go to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den måndag 23 maj 2016 kl. 13:39:48 UTC+2 skrev AGW:
> IDL> y=mean(x,dimension=1)
> % Keyword DIMENSION not allowed in call to: MEAN
> % Execution halted at: $MAIN$

OK, you are using IDL version < 8.

You can use total() instead of mean, and divide by the number of summed items. total() does support the dimension to sum over since before IDL 8, although not as a keyword but as the second parameter.

So you could do something like

IDL> dim=1
IDL> y=total(x,dim)/(size(x,/dim))[dim-1]
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: generate sequential list
Next Topic: check whether i'm in the virtual machine

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

Current Time: Wed Oct 08 07:16:44 PDT 2025

Total time taken to generate the page: 0.00584 seconds