[ncl-talk] doubts in the eof script

Dennis Shea shea at ucar.edu
Thu Nov 16 09:10:35 MST 2017


I think your question is about the 'time' being plotted along the x-axis

The source file has

%> ncdump -h pacific_sst_test_data.nc

netcdf pacific_sst_test_data {
dimensions:
        time = 29 ;
        lat = 60 ;
        lon = 180 ;
variables:
        float SST(time, lat, lon) ;
                SST:units = "C" ;
                SST:info = "period 1965-1993, from the daSilva data set
(based on COADS)" ;
                SST:long_name = "annual SST anomalies" ;
                SST:_FillValue = -1.e+10f ;
        float time(time) ;
                time:long_name = "time" ;
                *time:units = "?" *;
====
printing 'time' yields

Variable: time
Type: float
Total Size: 116 bytes
            29 values
Number of Dimensions: 1
Dimensions and sizes:   [time | 29]
Coordinates:
            time: [23574.5..23910.5]
Number Of Attributes: 2
  long_name :   time
  units :       ?
(0)     23574.5
(1)     23586.5
(2)     23598.5
(3)     23610.5
(4)     23622.5
[snip]

=====
These 'time' are  being plotted. Without a units attribute, there is no way
to convert to (say) yyyy.fraction.
=====
***IF**** there was a units attribute like: " {seconds/hours/days} since
....."
then something like the following could be used:

  yyyymm = cd_calendar(x&time,-1)
  yrfrac = yyyymm_to_yyyyfrac(yyyymm, 0.5)
 ;print(yyyymm+"  "+yrfrac)

[snip]
replace
       plot(n) = gsn_csm_xy (wks,*x&time*,eof_ts(n,:),rts)
with
        plot(n) = gsn_csm_xy (wks,*yrfrac*,eof_ts(n,:),rts)

Then the x/time-axis would have year and fraction of year.

===
NCL's 'date category' has many functions for handling 'time'.
Become familiar with thes.

http://www.ncl.ucar.edu/Document/Functions/date.shtml

Good luck






On Thu, Nov 16, 2017 at 4:16 AM, MADHU V <madhuv68 at gmail.com> wrote:

> Dear Friends
>
> I am attaching the ncl cript for the EOF calculations. In that i need the
> PC componet graph is not appearing in the year wise scale.
>
> I need to display my PC graph in time series. year wise.
>
> I here by attach the script which I have taken from the Data analysis of
> the NCL site.
>
> Link attached.
> http://www.ncl.ucar.edu/Applications/eof.shtml
>
> the script file is
>
> http://www.ncl.ucar.edu/Applications/Scripts/eof_2.ncl
>
> In the script file help me to modify the scritp , so that i can get the
> plot in time series ( years wise)
>
>
> Your help will be greatly appreciated. I am new to this package.
>
> regards
> Madhu
>
>
>
>
> --
> Dr. V Madhu M.Sc, B.Ed, M.Tech, Ph,D
> Assistant Professor
> Department of Atmospheric Sciences
> School of Marine Science
> Cochin University of Science and Technology
> Lakeside Campus, Cochin-16
> Phone:+91 (484) 2863814 <+91%20484%20286%203814>, Fax: +91 (484)2353662
> <+91%20484%20235%203662>
> Email: madhuv at cusat.ac.in
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171116/2232700e/attachment.html>


More information about the ncl-talk mailing list