[Thread Prev][Thread Next][Index]

Re: Relative day on Time axis



Hi,
      You can do it by defining a new axis and regridding to that
axis as the following example shows. But the method used here does have a 
drawback, you have to use normal ppl axis commands like axlsze, axlint 
etc. for the new time axis instead of the corresponding time-axis specific 
commands like txlsze, txlint etc. 

Hope this helps 

with Regards

Jaison 

!--------------------------------------------
\ cancel mode verify
  set window/clear

! get a time axis and some data (var1)
    define axis/t="10-jul-2002:00:00":"30-jul-2002:00:00"/t0="10-jul-2002:00:00"/np=21/units=hours tax
    let var1 = sin(T[GT=tax])
    set view upper ; plot var1

    let l_start = `var1,return=lstart`     ! to get the points (here days)
    let l_end  = `var1,return=lend`        ! on time axis
    let l_points= `l_end` - `l_start` + 1  ! 
    list l_start, l_end, l_points

    define axis/t=1:`l_points`:1/units=days tday ! new axis
    let var2 = var1[GT=tday@asn]                 ! regridding with @asn
    set view lower ;  plot var2

! now if you want to modify the "time axis" only...since here 
! the new time axis behaves like other axes...little care
! should be taken. We will define two viewports and will 
! use one for getting y-axis labels in the default way and 
! the second one for getting the desired plot with desired
! labelling features

   set window/clear

   define view/xlim=0:1/ylim=0.1:0.6  v1 ! for Y-axis  
   define view/xlim=0:1/ylim=0.1:0.6  v2 ! for T-axis & plot  
   
   set view v1
   ppl axset 0 0 1 1    ! only Y-axes                       
   plot/vlim=-1:1:0.2/nolab/color=white var1 ! no plot
 
   set view v2
   ppl axlsze 0.14      ! new T-axis label size
   ppl axlint, 1,2      ! new T-axis label interval
   ppl axnmtc, 1,2      ! small tics between large tics 
   ppl axset 1 1 0 0    ! skipping Y-axes
   plot/vlim=-1:1:0.2 var2 ! note vlim used in here and
                           ! in above plot command; 
! storing back the defaults
   ppl axlsze 0.1   ! restore for X axis (rather t axis here !!)
   ppl axlint, 2,2
   ppl axnmtc, 0,0

--------------------------------------------------------



On Fri, 30 Apr 2004, Le Clainche Yvonnick wrote:

> Hello,
> 
> I have  got a 1D data in a NetCDF file where :
>         time = UNLIMITED ; // (499 currently)
> and
>         time:units = "hours since 2002-07-10 00:00:00" ;
> 
> Instead of date on the TAXIS (10 11 12 13 ...), I would like to have
> only relative days. That means 1 for 10 JUL, 2 for 11 JUL, etc... on the
> TAXIS (1 2 3 ...)
> I tried different regridding  approach, but  I cannot do it.
> Do you know if there is a simple way to do that? 
> Thank you in advance.
> 
> Yvonnick Le Clainche
> ----------------------------------------------------------------------------------
> Québec-Océan
> Université Laval, Pavillon Alexandre-Vachon
> Québec, QC, G1K 7P4, Canada
> Tél. (1) 418-656-5917 #6274
> Fax (1) 418-656-2339
> -----------------------------------------------------------------------------------
> "Peu importe le voyage, pourvu que l'horizon soit vaste."
> -----------------------------------------------------------------------------------
> 
> 

-- 
___________________________________________________

    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