I was just thinking about this a bit more. It's not too hard to
think of a script which will define the new time axis from the one
in the dataset.
Here's how it would go if the dataset has a time axis with units of
days.
yes? use timeseries.nc
! Define variables containing the time coordinates, the first
! coordinate, and the starting year.
yes? let tt = t[gt=var]
yes? let t1 = tt[L=1]
yes? let year1 = tax_year(t1,tt)
! This variable will be yyyy.nn, the year and
fraction of year,
! corresponding to the time axis of the
variable.
yes? let ttyear = year1 + (tt-t1)/365.2425
yes? list/L=1:10/prec=9 ttyear
VARIABLE : YEAR1 + (TT-T1)/365.2425
SUBSET : 10 points (TIME)
01-JAN-2000 00 / 1: 2000.00000
02-JAN-2000 00 / 2: 2000.00274
03-JAN-2000 00 / 3: 2000.00548
04-JAN-2000 00 / 4: 2000.00821
05-JAN-2000 00 / 5: 2000.01095
06-JAN-2000 00 / 6: 2000.01369
07-JAN-2000 00 / 7: 2000.01643
08-JAN-2000 00 / 8: 2000.01917
09-JAN-2000 00 / 9: 2000.02190
10-JAN-2000 00 / 10: 2000.02464
Now, define the new time axis as a non-calendar axis:
yes? define axis/t/units=year newaxis = ttyear
yes? let varplot = var[gt=newaxis@asn]
yes? plot varplot
The tics on my plot were every 5 years, so:
yes? plot/set varplot
yes? ppl axnmtc,5
yes? ppl plot
If the units of the time axis in the dataset were months, then we'd
divide by a number (365.2425/12) instead of 365.2425, and if it's
already in units of years, no division. If this is model data with
a different calendar-axis definition such as a NOLEAP calendar, use
the appropriate length for a year.
--
On 2/13/2013 4:11 PM, Jian Ma wrote:
Hi Ansley and Billy,
It seems this is the only way out.
Many thanks,
Tony
|