[Thread Prev][Thread Next][Index]

Re: [ferret_users] irregular time axis



Hi -
For any axis, you need to set up a list of the values that will be the coordinates, in the units of the coordinate axis.  So, for a time axis you will need the list of days since the time origin, or hours, or whatever units you choose.  The calendar that is to be used must be taken into account as well.  For instance you could define an axis with units of years as follows:

yes? define axis/t/t0=1-jan-1000/units=years my_year_axis = {0,10,100,1000,2000}
yes? list t[gt=my_year_axis]
             VARIABLE : T
                        axis MY_YEAR_AXIS
             SUBSET   : 5 points (TIME)
 JAN-1000 / 1:     0.
 JAN-1010 / 2:    10.
 JAN-1100 / 3:   100.
 JAN-2000 / 4:  1000.
 JAN-3000 / 5:  2000.


or

yes? define axis/t/t0=1-jan-2000/units=days/calendar=NOLEAP my_month_axis = {0,31,59,90,120,161,181,212,243,273,304,334}
yes? sh axis/t my_month_axis
 name       axis              # pts   start                end
 MY_MONTH_AXIS TIME            12 i   01-JAN-2000 00:00    01-DEC-2000 00:00
T0 = 1-JAN-2000
CALENDAR = NOLEAP
   Axis span (to cell edges) = 364.5
 
       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
       1>  01-JAN-2000 00:00:00  31         16-DEC-1999 12:00:00    0
       2>  01-FEB-2000 00:00:00  29.5       16-JAN-2000 12:00:00    31
       3>  01-MAR-2000 00:00:00  29.5       15-FEB-2000 00:00:00    59
       4>  01-APR-2000 00:00:00  30.5       16-MAR-2000 12:00:00    90
       5>  01-MAY-2000 00:00:00  35.5       16-APR-2000 00:00:00    120
       6>  11-JUN-2000 00:00:00  30.5       21-MAY-2000 12:00:00    161
       7>  01-JUL-2000 00:00:00  25.5       21-JUN-2000 00:00:00    181
       8>  01-AUG-2000 00:00:00  31         16-JUL-2000 12:00:00    212
       9>  01-SEP-2000 00:00:00  30.5       16-AUG-2000 12:00:00    243
      10>  01-OCT-2000 00:00:00  30.5       16-SEP-2000 00:00:00    273
      11>  01-NOV-2000 00:00:00  30.5       16-OCT-2000 12:00:00    304
      12>  01-DEC-2000 00:00:00  30         16-NOV-2000 00:00:00    334



There are functions in Ferret that return these kinds of days-since values. DAYS1900 returns the number of days since 1900 from one or more year, month, day values.  This FAQ,

http://ferret.pmel.noaa.gov/Ferret/faq/creating-a-time-axis-from-time-variables

gives an example which uses this function. It returns days-since the start of 1900, using Ferret's default Proleptic Gregorian calendar.  There's a script, def_ monthaxis_days.jnl which defines the number of days since an origin for other calendars. 

There is another example under DEFINE AXIS/EDGES.  You could also use the ideas in that example, and leave off the /EDGES qualifier, to define an axis whose coordinate values are at the start of each month.


On 6/12/2012 5:27 AM, golla nageswararao wrote:
Hi all,
 How to define irregular time axis in ferret. I know for lat and lon by using xsequence. But how to define for time axis?

Thanks in advance.

--
With Best regards,
G.NageswaraRao,


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

Privacy Policy | Disclaimer | Accessibility Statement