[Thread Prev][Thread Next][Index]

Re: [ferret_users] Daily Averages from 6 hourly data

Hi Ashley -

One simple way is to successively average 4 points, then subsample:

! find all the 4-point forward averages
let adailyav = (a+a[l=@shf:1]+a[l=@shf:2]+a[l=@shf:3])/4
! subsample every 4th point
let adailyav_by4 = adailyav[l=1:`a[l=@ngd]`:4]

This assumes no missing values.

Note that @sbx:4 would not produce true daily averages because even arguments to @sbx are weighted 1/2 at the endpoints.

A possibly-undesirable feature of this method is that the time value of the points in adailyav_by4 will be that of the first point, but the daily average is in fact centered halfway between the second and third points. That is, if the original values are on 0000,0600,1200,1800, then the above method makes a daily average centered at 0900, but the variable adailyav_by4 will have its time values at 0000.

Billy K

On Jun 20, 2007, at 5:15 AM, Ashley Watson wrote:

Hi ferreters,
I am trying to get daily averages of a varaible which has values from 01-oct-1998 to 01-jun-1999 with timestep of 6hours. As it spreads over two years 1998 and 1999, I am getting problem in defining output timestep. Any hint or suggestion how to calculate this daily average.

yes? show data
     currently SET data sets:
    1> ./latentheat.nc  (default)
name title I J K L
 LTH      Latent_Heat             1:150     1:130     ...       1:973

Thanks in Advance

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement