[Thread Prev][Thread Next][Index]

Re: Time axis definition



Ben Burford wrote:

>  AIR_TEMPERATURE
>           Air_Temperature                  1:96      ...       ...       ...
>  XAX      Longitude                        1:1       ...       ...       ...
>  YAX      Latitude                         1:1       ...       ...       ...
>  TAX      Time                             ...       ...       ...       1:2
>  
> yes? DEFINE AXIS/T="1-OCT-2002:00:30":"3-OCT-2002:00:00":30/UNITS=minutes TAX
> yes? plot/I=1:96 Air_Temperature
> yes? plot Air_Temperature
  > 
> In both cases I get a plot but the x axis doesn't show time, it shows the va
> lues 1 to 96.  How do I define my time interval, get that recognized as the 
> x axis, and plot the 96 air temperature values on the y axis against time on
>  the x axis?

You have 2 problems here: 1) your data is defined on the wrong axis (x
instead of t) and 2) although you've defined a proper time axis, you
don't use it when plotting. To get your data onto a time axis:

    let tseq_air_temp = tsequence(Air_Temperature)

It is now on an "abstract" grid, ie no proper time values but it is a
time axis (show grid time_air_temp). To get the data on your new time
axis:

    let tax_air_temp = tseq_air_temp[gt=tax@asn]
    plot tax_air_temp

The @asn assigns element 1 of the sequence to position 1 of your new
axis, disregarding any time values on the axis. That means the
tsequence and the new time axis should have the same number of
elements. This works for me, but I created a test variable so I may
have mistyped something. Let me know if it works.

Hein Zelle

>-----------------------------------------------------------------<
    Hein Zelle
    Dept. of Oceographic Research
    KNMI, The Netherlands
    work:        zelle@knmi.nl     http://www.knmi.nl/~zelle
    private:     hein@icce.rug.nl  http://www.icce.rug.nl/~hein
    Phone:       +31 (0)30 2206704
>-----------------------------------------------------------------<
-------------------------------------------------------------- 

Zie ook/see also: http://www.knmi.nl/maildisclaimer.html 
 


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement