You can specify two dimensions to average over in one call.
e.g. averaged_Data = dim_avg_n( raw_data(:,lat|:,lon|:), (/1,2/) ) ;; will now average over the lat and lon dimensions.
from the ncl site: http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_avg_n.shtml
Example 4
Let z be defined as z(time,lev,lat,lon). Compute the time average at each latitude/longitude grid point.
zAvg = dim_avg_n(z, (/0,1/)) ; ==> zAvg(nlat,nlon)
If metadata is desired use:
zAvg = dim_avg_n_Wrap(z, (/0,1/)) ; ==> zAvg(nlat,nlon)
Alan.
forgot to cc the list.
##############################
Alan Brammer,
PhD Student,
Department of Atmospheric and Environmental Sciences,
University at Albany, State University of New York, Albany, NY, 12222
abrammer@albany.edu
##############################
On Nov 1, 2012, at 8:12 AM, Renata Tedeschi <rgtedeschi@gmail.com> wrote:
> Hi
>
> I need to average in latitude and longitude, and the dim_avg_n function makes the average in only one dimension. Is there an easier way than using this function twice?
>
> Thanks
> Renata Tedeschi
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 1 06:42:05 2012
This archive was generated by hypermail 2.1.8 : Tue Nov 06 2012 - 15:05:49 MST