DAYS1900(yr,mo,day): Averaging to Regrid a Time Series

annual mean 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 is somewhat unuaual — 12 equal length months of length 730.5 hours per year. This leads to slightly unusual weighting of points in computing the annual averages. For further discussion on the details of weighting and of customizing time axes, see the FAQ, How can I determine the averaging weights when regridding with @AVE? http://ferret.pmel.noaa.gov/Ferret/faq/averaging-to-regrid-a-time-series?searchterm=annual 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s