# Re: 2 dimensional running local area average

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 21 2011 - 11:16:41 MST

[0] If the grid is global, you can use spherical harmonics

[1] Have you tried

fo = area_hi2lores (xi,yi,fi, False, 1, xo,yo, False or True)

where xo=xi and yo=yi

fo = area_hi2lores (xi,yi,fi, False, 1, xi,yi, False or True)

Perhaps, you will get an error message. I don't know.

Some preprocessing is required, and the grid must be rectilinear
and be equally spaced 1x1, 1x2.5, 2x2, 3x2,......

zlon = ndtooned(xi)
zlat = ndtooned(yi)

dimz = dimsizes(zi)
rankz= dimsizes(dimz)
if (rankz.eq.2) then
zVal = ndtooned(zi)
else if (rankz.eq.3) then
nt = dimz(0)
nz = dimz(1)*dimz(2)
zVal = onedtond(ndtooned(zi), (/nt,nz/))
else if (rankz.eq.4) then
nt = dimz(0)
nl = dimz(1)
nz = dimz(2)*dimz(3)
zVal = onedtond(ndtooned(zi), (/nt,nl,nz/))
end if
end if
end if

grid = bin_avg(zlon,zlat,zVal, lon,lat, False or True)

Cheers

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Nov 21 11:16:49 2011

This archive was generated by hypermail 2.1.8 : Tue Nov 22 2011 - 14:17:52 MST