[Thread Prev][Thread Next][Index]

Re: Time axis definition



Hi Ben,
          Hein Zelle made a detailed explanation for your querry.
It is also possible to impose a grid with the lat and lon information
along with time to the variable "air_temperature". (Hope  "XAX"
cotains longitude value and "YAX" contains latitude value) 

     set data foo.nc
     define axis/t="1-OCT-2002:00:30":"3-OCT-2002:00:00":30/\
               T0="30-SEP-2002:00:00"/UNITS=minutes tmnts

!define lat and lon axes from data 
 
     define axis/x/units=longitudes/from_data xlon=xax
     define axis/y/units=latitudes/from_data  ylat=yax

!create a dummy variable on the final destination grid

     let xyt_stamp = t[gt=tmnts]*0 + x[gx=xlon]*0 + y[gy=ylat]*0 

!get "air_temperature" on to the destination grid
!    RESHAPE function wraps the first argument to the
!    grid of second argument

     let airt = RESHAPE(air_temperature,xyt_stamp)

!assign  title & units

     set var/title="Air Temperature"/units="^oC" airt

     plot airt

! save to a netcdf file for future use

  ! save/file=foo_xytgrd.nc/append airt


Hope This Helps

With Regards 

Jaison 
   

 On Tue, 31 Aug 2004, Hein Zelle wrote:

> 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 
>  
> 

-- 
___________________________________________________

    Jaison Kurian                           
    Centre for Atmospheric and Oceanic Sciences
    Indian Institute of Science
    B A N G A L O R E   560 012
    Ph: +91-80-3942505
        +91-80-3600450
    Fax:+91-80-3600865
___________________________________________________




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement