# Re: Contents of ncl-talk digest 1. Downsizing a ncdf file (Adolf Stips)

From: Saji Hameed (saji AT hawaii.edu)
Date: Mon Feb 14 2005 - 14:05:54 MST

Perhaps, this may be a solution to your problem. Do a running average,
in your case, a 3 -point running mean, first over longitude and then
latitude or whichever way.

Suppose your original data is over (x1,y1); (x2,y2); (x3,y3) ... etc
A 3-point centered running mean is applied to this on the longitude
dimension. Then point (x2,y2) of the processed array is an average over
the 3 longitudes, x1,x2,x3. The running mean over the lat-direction then
makes it an area-average. (you should, if needed, weigh these averages
appropriately to take care of area-changes with latitude). Writing out
every 3rd value in longitude and latitude should give you the regridded
15x15 values.

saji

Saji N. Hameed, Assistant Researcher,
IPRC-SOEST, 2525 Correa Road, Univ. of Hawaii,
Honolulu, HI 96822, U.S.A
http://iprc.soest.hawaii.edu/~saji
tel.: (808) 956 9534 , fax.: (808) 956 9425

>
> Dear All,
>
> I have model output ncdf files (lat,lon,time,levels and parameters),
> on say 5x5 minute grid (limited domain).
> I want to calculate area mean values for eg. 15x15 grid.
> I know ncks, extracts for example every third lat x lon,
> but I want the mean values. So I didn't find a way
> to do it with nco.
> (E.g extracting 3 times with ncks (shifted start) and
> averaging with ncea the 3 files, gives the mean values, but
> the coordinates are not averaged, further the handling of missing
> valuescreates another problem)
>
> Does anybody know code from NCL or..
> which would perform just this and may be general enough to
> be applied on rather arbitrary (my) ncdf files.
>
>
>
> -----------------------------------------------------
> Inland and Marine Waters unit
> CEC Joint Research Centre, TP 272
> I-21020 Ispra, Italy
> Tel: +39-0332-789876
> Fax: +39-0332-789034
> -----------------------------------------------------
> "The views expressed are purely those of the writer and
> may not in any circumstances be regarded as stating an
> official position of the European Commission."
> (Disclaimer required under the terms and conditions of
> use of the internet and electronic mail from Commission
> equipment)
>

Saji N. Hameed, Assistant Researcher,
IPRC-SOEST, 2525 Correa Road, Univ. of Hawaii,
Honolulu, HI 96822, U.S.A
http://iprc.soest.hawaii.edu/~saji
tel.: (808) 956 9534 , fax.: (808) 956 9425

_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

This archive was generated by hypermail 2b29 : Mon Feb 14 2005 - 15:29:41 MST