[Thread Prev][Thread Next][Index]

Re: [ferret_users] regridding of time axis


There's a very useful script in $FER_DIR/contrib called def_monthaxis_days.jnl  which  allows you to define monthly axes very easily. It's not difficult to modify it to define three month axes.

For your case try

let YEAR_START = 1979
let YEAR_END = 2015
let YEAR_REF = 1979

let MONTH = MOD(INDICES*3-3,12)+1              ! Starting month of every three month period 1,4,7,10,1,4,....
let YEAR = YEAR_START + INT((INDICES-1)/4)    ! Four periods per year rather than 12

let INDICES = L[L=1:`1+NBYEARS*4`]                ! Edges of 3 month periods.

define axis/units="days"/T0="01-JAN-`year_ref`"/edges/cal="GREGORIAN" three_month_axis = DAYS1900(year,month,1)-DAYS1900(`year_ref`,1,1)


On 21/11/17 07:03, Ansley C. Manke wrote:

Hi Steffie,

This would be similar to what is described here for creating a yearly time series; using either @AVE or another regridding transformation

Except that you will want to define a seasonal axis instead of a yearly one.  You can base one axis on the definition of an existing axis, taking every nth point, so starting with a monthly axis is an easy way to do this.  If your incoming data already has a well-defined time axis, you can base it on that.  Here's how that looks, using the dataset monthly_navy_winds that comes with the Ferret distribution:

yes? use monthly_navy_winds
yes? show grid uwnd
 name       axis              # pts   start                end                 subset
 FNOCX     LONGITUDE          144mr   20E                  17.5E(377.5)        full
 FNOCY     LATITUDE            73 r   90S                  90N                 full
 normal    Z
 TIME      TIME               132 r   16-JAN-1982 20:00    17-DEC-1992 03:30   full

! Use the coordinate values of the time axis from the file to define a new time axis
yes? let tt = t[gt=uwnd]
yes? define axis/t/t0="`uwnd,return=t0`"/units="`uwnd,return=tunits`" time4 = tt[L=2:144:3]
 !-> define axis/t/t0="14-JAN-1980 14:00:00"/units="hour" time4 = tt[L=2:144:3]

! The original data:
yes? list/t=1-jan-1982:1-jan-1983/x=180/y=0 uwnd
             VARIABLE : ZONAL WIND (M/S)
             FILENAME : monthly_navy_winds.cdf
             FILEPATH : /home/users/tmap/ferret/linux/fer_dsets/data/
             SUBSET   : 12 points (TIME)
             LONGITUDE: 180E
             LATITUDE : 0
 16-JAN-1982 /  1: -2.738
 16-FEB-1982 /  2: -2.331
 18-MAR-1982 /  3: -3.251
 18-APR-1982 /  4: -3.124
 18-MAY-1982 /  5: -1.818
 18-JUN-1982 /  6: -2.007
 18-JUL-1982 /  7: -0.367
 17-AUG-1982 /  8: -0.900
 17-SEP-1982 /  9:  3.223
 17-OCT-1982 / 10:  2.167
 17-NOV-1982 / 11:  2.875
 17-DEC-1982 / 12: -0.007

! The data on the seasonal axis:
yes? list/t=1-jan-1982:1-jan-1983/x=180/y=0 uwnd[gt=time4@ave]
             VARIABLE : ZONAL WIND (M/S)
                        regrid: 2192 hour on T@AVE
             FILENAME : monthly_navy_winds.cdf
             FILEPATH : /home/users/tmap/ferret/linux/fer_dsets/data/
             SUBSET   : 4 points (TIME)
             LONGITUDE: 180E
             LATITUDE : 0
 16-FEB-1982 / 1: -2.773
 18-MAY-1982 / 2: -2.316
 17-AUG-1982 / 3:  0.652
 17-NOV-1982 / 4:  1.678

If you are reading data from a text file, then you'd first define the monthly time axis (See DEFINE AXIS) and a grid for the data, and set up to read the data as described here,  and then define the seasonal axis as above.


On 11/19/2017 10:25 PM, Steffie Tom wrote:

We have data from 1979-2015, which consists of various parameters like temperature etc. we need to create seasonal data i.e. say for summer jan-feb-march for all years i.e. separately for 1979, then jan-feb-march for 1980 etc. i.e in one file we want 111 months.

First of all how to achieve this ?

After that how to achieve the seasonal average of the same data above ?


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement