Averaging to Regrid a Time Series
Question:
How can I produce a time series of annual averages (or other intervals) from a monthly time series?
Example:
Compute annual averages of the monthly_navy_winds data set.
Explanation:
The basic steps:
1. Define a target axis with the desired (annual) intervals
2. Regrid the original data to the target axis using by averaging within target intervals:
GT=newTaxis@AVE (see Ch4 Sec2.3.1. Regridding transformations)
To produce the above plot
yes? SET DATA monthly_navy_winds yes? DEFINE AXIS/EDGES/T0=1-jan-1900/UNITS=days tann82_92 = DAYS1900(X[i=1982:1993:1],1,1) yes? PLOT/X=180/Y=0 uwnd yes? PLOT/X=180/Y=0/over uwnd[gt=tann82_92@ave] ! the above plot ! Look at the time axis; noticing that the time points lie mid-year in July. yes? SHOW AXIS/T tann82_92 name axis # pts start end TANN82_92 TIME 11 i 02-JUL-1982 12:00 02-JUL-1992 00:00 T0 = 1-JAN-1900 L T BOX_SIZE TIME_STEP (DAYS) 1> 02-JUL-1982 12:00:00 365 30132.5 2> 02-JUL-1983 12:00:00 365 30497.5 3> 02-JUL-1984 00:00:00 366 30863 4> 02-JUL-1985 12:00:00 365 31228.5 5> 02-JUL-1986 12:00:00 365 31593.5 6> 02-JUL-1987 12:00:00 365 31958.5 7> 02-JUL-1988 00:00:00 366 32324 8> 02-JUL-1989 12:00:00 365 32689.5 9> 02-JUL-1990 12:00:00 365 33054.5 10> 02-JUL-1991 12:00:00 365 33419.5 11> 02-JUL-1992 00:00:00 366 33785
=====
Explanatory notes:
* The data set monthly_navy_winds (which is installed with Ferret) contains monthly wind values from Jan1982 through Dec 1992.
* The expression X[i=1982:1993] is equivalent to {1982, 1983,...,1992,1993}
* The function DAYS1900(yr,mo,day) returns the Julian day countedsince T0=1-jan-1900
====
Note that the native time axis of the monthly_navy_winds data set issomewhat unuaual -- 12 equal length months of length 730.5 hours peryear. This leads to slightly unusual weighting of points in computingthe annual averages.
For further discussion on the details of weighting and of customizing time axes,see the FAQ, How can I determine the averagingweights when regridding with @AVE?