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

Home » Public Forums » archive » Re: mean() function
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: mean() function [message #46934 is a reply to message #46933] Tue, 10 January 2006 15:09 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
F�LDY Lajos wrote:
> Hi,
>
> have you tried mean(y,/double)?

Even regular old single worked for me:

IDL> y = fltarr(1008879)+35
IDL> id = where(y ne 35, cc)
IDL> print, cc
0
IDL> print, mean(y)
% Compiled module: MEAN.
% Compiled module: MOMENT.
35.0000
IDL> print, mean(y[0:400000])
35.0000

Maybe it's version related? I noticed that biocpu used () rather than [] for array
indexing. Maybe an earlier version of IDL had a MEAN() function that didn't use a
compensated summation algorithm? The OP mean from 0->400000 that worked suggests that's
not the case, but who knows? Anyway....

IDL> print, !version
{ x86 linux unix linux 6.0.3 Feb 26 2004 32 64}


paulv

>
> regards,
> lajos
>
>
> On Tue, 10 Jan 2006 biocpu@yahoo.com wrote:
>
>
>> The following looks very odd. Have any clues?
>>
>> IDL> y = fltarr(1008879)+35
>> IDL> id = where(y ne 35, cc)
>> IDL> print, cc
>> 0
>> ; so y is strictly 35.0 BUT
>> IDL> print, mean(y)
>> 35.5249
>>
>> IDL> print, mean(y(0:400000))
>> 35.0000
>>
>> Thanks,
>>
>>


--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: reading a ninary file
Next Topic: mean() function

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

Current Time: Fri Oct 10 20:29:23 PDT 2025

Total time taken to generate the page: 1.68208 seconds