[Thread Prev][Thread Next][Index]

Re: time_counter as axis

Hi Greene,
             These are the necessary steps to find a climatology for your 
data set.

    1. To find climatology we need the variable in actual calendar 
          "time axis" instead of the index axis. So we need to "impose"
          a calendar time axis to the variable.
       If you know the exact years over which the data is collected then
          use it or use arbitary years to define the calendar time axis.

    2. Define a monthly climatological axis and regrid the variable on 
          calendar time grid to this climatological axes via "MODULO"

Your questions....

     (a) how to produce such a delimited-interval climatology ?
  From ferret user manual, Ch4 Sec2.5. Modulo regridding

   "To generate a climatology based on a restricted range of input data 
   simply define an intermediate variable with the desired points".
   ....then use this intermediate variable to find the climatology (see
   the example below).

    (b) what was the problem with my formulation ?

     let vclim = v[GT=month_reg@asn]   this should be like

     let vclim = v[GT=month_reg@MOD]   provided "v" is on "actual" time

 @ASN regridding associates by subscript (blindly) the points from the 
 source grid onto destination coordinates (see the example below where
 @ASN is used to impose the calendat time axis intead of the abstract
 @MOD regriddging computes climatology/mean by averaging the full time 
 domain of the input variable in a "modulo fashion" into the time points
 of the climatological axis. 
     let v1 = v[T=13:60]
     let v1clim = v1[GT=month_reg@asn]
     plot v1clim

  Try listing "list/l=1:10 v1" ...you will get all the 48 values from 
  v[T=13] to v[T=60] instead of v[T=13] to v[T=24]...why ? v1 is defined
  as data "segment" with no identity to individual entries in the segment.
  You are making an attempt to "assign" a 12 point grid (month_reg) to a 
  sata segment with 48 values. That is why you are getting blank plot and
  empty values.

  So the preferred way to define v1 is 

    let v1 = TSEQUENCE(v[T=13:60]) (see example below)

  TSEQUENCE unravels the data from the argument into a 1-dimensional line
  of data on "ABSTRACT" axis L.
  Again you should use "@mod" instead of "@asn".

  Please go thorugh the example below. If anything remains not explained
  please let me know.

  Hope this hleps 

  With Regards 


! --------------example.jnl--------------------------------

! get some dummy data

      define axis/t=1:60:1 tabs
      let v   = 30 - ( sin(t[gt=tabs]) ) + RANDU(t[gt=tabs])
      set var/title="Some variable"/units="something" v

! Suppose your data is from 16-JAN-1995 to 16-DEC-1999 (60 points).
! You want to calculate a climatology from ..say last 3 year's of data
! ( from JAN-1997 to DEC-1999). Then..

   ! extract last three years data ie. abstract index L=25:60

   let v_3to5yr = TSEQUENCE(v[L=25:60])

   ! define monthly time axis from JAN-1997 to DEC-1999 & assign it
   !     T=0:`365.2425*3`/NPOINTS=36/UNITS=DAYS together will make it for 
   !      3 years and  T0 will take care of actual year stamp.

      define axis/T=0:`365.2425*3`/NPOINTS=36/EDGES/units=days/\
                  T0="01-JAN-1997:00:00" t3to5yr

      let v_3to5yr_t = v_3to5yr[gt=t3to5yr@asn] 

   ! Define a monthly climatological axis 
      define axis/T=0:365.2425/EDGES/NPOINTS=12/T0=1-JAN-0001/\
                     UNITS=DAYS/MODULO tclim

   ! Find monthly climatology by "MODULO" regridding

      let v_clim_12mon = v_3to5yr_t[GT=tclim@MOD]
      plot v_clim_12mon     

! If you want to find anomaly or want to plot the climatology
!   over the data then please refer :
!   http://ferret.pmel.noaa.gov/Ferret/Mail_Archives/fu_2003/msg01470.html

!---------------------- end of example.jnl-------------

On Tue, 31 Aug 2004, Arthur M. Greene wrote:

> Hello Ferreters...
> I have 5 years of monthly data at a single gridpoint, with the time axis
> specified by a simple index: 1,2,3,4,5... 60, rather than by specific
> dates. According to the "show axis" command, this is a "time_counter,"
> and ferret shows "# pts" as "60 r," beginning at 1 and ending at 60. I
> would like to display a monthly climatology, but only for the last four
> (or possibly three) years. 
> Let's call the variable in question v. Then, when I do
> let vclim = v[GT=month_reg@asn]
> plot vclim
> I get a nice climatological plot, with Jan Feb Mar... along the x-axis
> (these happen to be the correct months, even though I haven't told
> ferret how to map the time index to the calendar.)
> However, if I pick off the last four years,
> let v1 = v[T=13:60]
> let v1clim = v1[GT=month_reg@asn]
> plot v1clim
> the resulting plot is blank; a listing shows empty values.
> I have read a lot of the grid and axis parts of the docs, but I'm afraid
> it is still not clear to me (a) how to produce such a delimited-interval
> climatology, and (b) what the problem actually is with the formulation
> as given above.
> Comments appreciated, and thanks!
> A. Greene


    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

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement