[Thread Prev][Thread Next][Index]

Re: overlaying years without regrid ?



Hi,
     In Ferret, Time axis always requires special consideration.
Many data sets come with time points defined on a  particular time 
of the day like 12hrs instead of 00hrs and also the data frequency 
might be 2days or more instead of daily. In this case setting/specifying 
the time region as /t=01-jan-year:31-dec-year will not make sure that 
the time axis of the delivered plot will start exactly at jan-1 of 
that year and end at dec-31 of the same year. In this case the we 
should be carefull with the viewport.
For example :

    def axis/t="1-jan-1981:12":"31-dec-1984:12":10/units=days tax
    def grid/t=tax grd
    let v=sin(6.14*t[g=grd]/350)

    plot/t="01-jan-1981:12":"31-dec-1981:12" v  ! now time axis is fine. 
                                                ! it starts on 01-jan-1981 and
                                                ! ends on 31-dec-1981
    plot/t="01-jan-1982:12":"31-dec-1982:12" v  ! now the time axis starts on
                                                ! 01-jan-1982 and ends on 
                                                ! 31-jan-1983
    ! specify time reg without hours
    plot/t="01-jan-1982":"31-dec-1982"  v   ! now time axis starts on 01-dec-1981  
                                            ! ends on 31-jan-1983 !!!!

    list/t="01-jan-1982:12":"31-dec-1982:12" v

        06-JAN-1982 12 / 38: -0.4737
        16-JAN-1982 12 / 39: -0.6202
        ............................
        22-DEC-1982 12 / 73: -0.3432
        01-JAN-1983 12 / 74: -0.5019 

    list/t="01-jan-1982":"31-dec-1982" v
 
        27-DEC-1981 12 / 37: -0.3128
        06-JAN-1982 12 / 38: -0.4737
        ............................
        22-DEC-1982 12 / 73: -0.3432
        01-JAN-1983 12 / 74: -0.5019

 It appears that the range for data at time "01-JAN-1983:12" is from 
"28-dec-1982:12" to "06-jan-1983:12". So if the specified region ends at
a time = or > 28-dec-1982:12 then the data for t="01-JAN-1983:12" also 
gets plotted and thus JAN-1983 also included in the time axis.

So if somebody is using this viewport method to plot time series for 
different years, they should take care to set/specify the time region so 
that for every year the delivered plot will be defined over the Jan-Dec of the 
respective year.

With Regards 

Jaison



On Mon, 5 Jul 2004, Mick Spillane wrote:

> > Is there any way to overlay in a single plot different years without
> > using regrid?
> > I have one time series of 4 years and neet to overlay them.
> 
> Hi Domingos,
> 	While I don't understand why you wish to exclude regridding from
> the options, here is one way to do it - plot each year in overlapping
> viewports.
> Good luck,
> Mick
> !--------------------------------------------------------------------
> ! define demo function ...
> def axis/t=1-jan-1981:31-dec-1984:1/units=days tax
> def grid/t=tax grd
> let v=sin(6.14*t[g=grd]/350)
> ! ... and see what it looks like
> plot v
> 
> ! make 4 identical viewports, using your favorite method; for example
> ppl size 10 8 ; ppl axlen 8 6 ; ppl origin 1 1
> def view/size=1/orig=0,0/clip=1,1 view1
> def view/size=1/orig=0,0/clip=1,1 view2
> def view/size=1/orig=0,0/clip=1,1 view3
> def view/size=1/orig=0,0/clip=1,1 view4
> 
> ! plot year#1
> set view view1
> plot/nolab/set/t=1-jan-1981:31-dec-1981/line=1 v
> ppl txlint,,0    ! suppress YEAR in the axis label
> ppl yaxis,-1.1,1.2,0.1  ! set y-axis to fit all years (if necessary)
> ppl plot
> label/nouser 0.2 5.0 -1 0 0.2 @p1@sr1981  ! add label to identify year#1
> !plot year#2
> set view view2
> plot/nolab/set/t=1-jan-1982:31-dec-1982/line=2 v
> ppl axset,0,0,0,0   ! suppress top, bottom, left, right axis drawing
> ppl yaxis,-1.1,1.2,0.1  ! force the common y-axis to apply
> ppl plot
> label/nouser 0.2 4.5 -1 0 0.2 @p2@sr1982  ! add label to identify year#2
> ! plot year#3
> set view view3
> plot/nolab/set/t=1-jan-1983:31-dec-1983/line=3 v
> ppl axset,0,0,0,0   ! suppress top, bottom, left, right axis drawing
> ppl yaxis,-1.1,1.2,0.1  ! force the common y-axis to apply
> ppl plot
> label/nouser 0.2 4.0 -1 0 0.2 @p3@sr1983  ! add label to identify year#3
> ! plot year#4
> set view view4
> plot/nolab/set/t=1-jan-1984:31-dec-1984/line=4 v
> ppl axset,0,0,0,0   ! suppress top, bottom, left, right axis drawing
> ppl yaxis,-1.1,1.2,0.1  ! force the common y-axis to apply
> ppl plot
> label/nouser 0.2 3.5 -1 0 0.2 @p4@sr1984  ! add label to identify year#4
> 
> 

-- 
___________________________________________________

    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