[Thread Prev][Thread Next][Index]

Re: Again: plotting only data in Feburary



Hi Jang,
         If i understood your question properly, you want to extract
the data for 01-FEB 6am of all the years and plot it as a time series
for a selected X-Y location. Correct ??

  Here is an example using a dummy one dimensional (time) variable.
Please find the explanations inside the example script.

Hope This Helps

With Regards

Jaison

!---------------------------example.jnl-------------------------
\ cancel mode verify

!  define a time axis with 6hr increment and create a dummy variable

      define axis/t="01-JAN-1978 00:00":"31-DEC-1997 18:00":6/units=hours/\
                      T0="31-DEC-1977 18:00" t6hr
      let var = RANDU(t[gt=t6hr])
      list/l=1:10 var               ! just to check the time axis

! now extract  the "L" index corresponding to "01-FEB-???? 06:00"
!      for all the years, save it to a dummy file and read it

      let ys = 1978 ! year start
      let ye = 1997 ! year end

      sp rm -f dummy.dat  ! remove previous versions if any
      REPEAT/RANGE=`ys`:`ye`:1/NAME=yr ( ;\
           let ll = L[GT=var,T="01-FEB-`yr` 06:00"] ;\
           list/nohead/file=dummy.dat/quiet/append ll  ;\
      )

      let ysz = ye - ys + 1           ! how many feb-01
      define axis/x=1:`ysz`:1 xfile
      define grid/x=xfile     gfile

      FILE/grid=gfile/var="lpts" dummy.dat ! read in "L" values

! please specify the dataset numbers if needed
!
!   let var_sampled = SAMPLEL(var[d=1],lpts[d=2])
!
      let var_sampled = SAMPLEL(var,lpts)          ! now sample along these "L" points
      define axis/t=`ys`:`ye`:1 tyear              ! time axis for the sampled data
      let var_feb1_6am = var_sampled[GT=tyear@ASN] ! assign above time axis
      plot var_feb1_6am   ! use "set reg" to specify X-Y location if needed

! remove the dummy data
      sp rm -f dummy.dat

! if you want to save the data to a file

   !   save/file=myfile.nc/append var_feb1_6am

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

On Fri, 20 May 2005, Chan Joo Jang wrote:

For clarity, I should mention about the plot I want to do.
What I want to do is time-series plot at one position using only 6 am data.
===========

I would like to plot the data at only 6 am in Feb. 1 of every year in
following netCDF data.

The time interval of the NetCDF data is 6 hours from 01-JAN-1978 00:00
to 31-DEC-1997 18:00

%ncdump sun_ecmwf.nc
netcdf sub_ecmwf {
dimensions:
XE = 28 ;
YE = 29 ;
TE = UNLIMITED ; // (29220 currently)
variables:
double XE(XE) ;
XE:units = "degrees_east" ;
XE:modulo = 360. ;
XE:point_spacing = "even" ;
XE:AXIS = "X" ;
double YE(YE) ;
YE:units = "degrees_north" ;
YE:point_spacing = "even" ;
YE:AXIS = "Y" ;
double TE(TE) ;
TE:units = "HOURS since 1901-01-15 00:00:00" ;
TE:time_origin = "15-JAN-1901" ;

Thanks in advance.

Jang, Chan Joo





--
___________________________________________________

    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-22932505 Extn. 229
        +91-80-23600450
    Fax:+91-80-23600865
___________________________________________________

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement