[Thread Prev][Thread Next][Index]

Re: [ferret_users] Time tics every year



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


On Wed, Feb 13, 2013 at 3:40 PM, Ansley Manke <ansley.b.manke@xxxxxxxx> wrote:
Hi,
The original pplus did not have a time-axis style for long time axes like this. We've added a bit of support for such axes but it's not completely flexible.

For plotting, you might want to define a time axis with units of years, but not a calendar time axis. You'll need to take care that you are representing the same times, but here's an example.  Say the time axis of the data is monthly from the start of 1940 through October of 1999.

   yes? define axis/t=1940.0:1999.833/npoints=718/units=year yearax

   yes? let/title="variable title"/units="variable units"  my_plot_var = input_var[gt=yearax@asn]

This is not a calendar axis, so Ferret will NOT translate between the time units as it does for axes defined with both time units and a time origin. Again, make sure you're making an equivalent definition, and you have to use the @ASN transformation to put the data onto this axis, again because Ferret won't translate between the two.

Now if needed you would use the PPLUS commands such as AXNMTC and AXLINT to adjust tic marks on this axis.





On 2/13/2013 12:26 PM, Jian Ma wrote:

Hi William,

Thanks. But this does not work either. It does not control the tics at all.

Any other solution? Desperately appreciated!


Tony


On Wed, Feb 13, 2013 at 6:55 AM, William S. Kessler <william.s.kessler@xxxxxxxx> wrote:

On Feb 12, 2013, at 5:18 PM, Jian Ma wrote:

> Hi All,
>
> I have a plot with 50 years data per viewport. the time axis is show with a tic for 10 years. I would like the tics to show up every year. I tried many ppl commands like TXNMTC, AXNMTC, AXATIC but none works. The tics show up well if I change the window ratio to very wide, though, however I don't like it that way. The automatic setting is annoying here.
>
> Anyone has ideas? Thank you very much!
> Tony

ppl txlint,low,high             time axis lab intervals (0,1=yr only; 1,0=mon only; 3,1=every 3 mon+yr; 10,0=every 10 years, no months)






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

Privacy Policy | Disclaimer | Accessibility Statement