[gradsusr] weighting in vertical in 'ave' function?
Jennifer Adams
jma at cola.iges.org
Thu Apr 8 14:53:31 EDT 2010
Hi, Katrina --
I did a simple test:
ga-> man =
(u
(z=1)+u(z=2)+u(z=3)+u(z=4)+u(z=5)+u(z=6)+u(z=7)+u(z=8)+u(z=9)+u(z=10))/
10
ga-> avg = ave(u,z=1,z=10)
ga-> mean = mean(u,z=1,z=10)
ga-> d avg-man
Contouring: -1e-14 to 1e-14 interval 2e-15
(this is just the noise)
ga-> d avg-mean
Constant field. Value = 0
So the ave() and mean() functions give the same thing. There is no
weighting in the vertical. And I am unable to reproduce a
significantly different average when calculating in manually. How did
you calculate "a straight average of T over 11 levels" that was
different from ave()?
--Jennifer
On Apr 7, 2010, at 4:08 PM, Katrina Hales-Garcia wrote:
> Hello,
> I recently joined the grads users' group. And I do apologize if
> this topic is covered in the old list archives, I haven't been able
> to access them to search.
>
> I am trying to reproduce/understand a value averaged in the vertical
> over a subset of layers. The variable was defined by something
> simple like:
>
> define Tave=ave(T,z=1,z=11)
>
> However, I find this is different than a straight average of T over
> the 11 levels. In the documentation, it is noted that ave has some
> weighting for non-linear grid spacing in the y-direction, averaging
> along latitude. But I haven't found the details of weighting in the
> vertical. If I use the function 'mean' instead of 'ave' I get the
> same result (which according to the documentation, does not have the
> non-linear grid space weighting at least in the y-direction).
> (Excerpt from the documentation below.)
>
> Of course, the data I'm looking at has non-linear spacing in the
> vertical pressure coordinate. Does anyone have details of how this
> weighting is done?
>
> Thanks much,
> Katrina
>
> What is in the documentation:
> Usage Note 3
> The average is weighted by grid interval to account for non-linear
> grid spacing. Averages in the latitude dimension are weighted by the
> difference between the sines of the latitude at the northern and
> southern edges of the grid box. The edges of the grid box are always
> defined as being the midpoint between adjacent grid points. To
> calculate an average without using the latitude weighting, use the
> meanfunction.
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20100408/b6ce906a/attachment-0003.html
More information about the gradsusr
mailing list