[Thread Prev][Thread Next][Index]

Re: 2D shaded time series plot



Steve,
The message you're seeing is just a warning that "MONTHS" is an ambiguous
unit; it depends on the length of the year (models might use even-spaced, 30-
day months, or you might have in mind unequally-spaced months based on the
actual number of days in each calendar month).  This warning is to make sure
you're aware of this.

It looks like the axis tcal you've created doesn't quite match the range of your
data -- your data starts in 1901 if its time origin is in January of  1900 and the
first time step is 12.  In fact, I don't think there's any reason  to regrid your time
series at all.  The example in the Users Guide is just creating an example time
series to use. If you just create the T (year) and Z (month) axes to correspond to
the length of your time series and do the RESHAPE I think it'll work fine.

Ansley


Steve Knox wrote:
Thanks for pointing me to the reshape command.
I seem to be doing something wrong, however, when I try to follow the example.
 Why do I get an error from UNITS=MON. (If I omit "UNITS=MON" I get no warning message but the results are the same).
The reshaped grid seems ok but when I list my_reshaped I get no data.

The time variable in my file tmp.cdf is :       
                float time(time) ;
                time:units = "months since 1900-01-15 00:00:00" ;
                time:title = "Time" ;
                time:long_name = "Time axis" ;
                time:time_origin = " 1900-01-15 00:00:00" ;
The variable time has values:
 time = 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
...
...
When I follow the example this is what I get:

use tmp.cdf
DEFINE AXIS/t=1-JAN-1900:31-DEC-1903/NPOINTS=48/UNITS=MON tcal
 *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days
Replacing definition of axis TCAL
LET my_time_series = tmp[gt=tcal]  ! tmp is my average temp variable
DEFINE AXIS/t=1900:1903:1 tyear
DEFINE AXIS/Z=1:12:1 zmonth
LET out_grid = Z[GZ=zmonth]+T[GT=tyear]
LET my_reshaped = RESHAPE(my_time_series, out_grid)
SHOW GRID my_reshaped
    GRID (G002)
 name       axis              # pts   start                end
 normal    X
 normal    Y
 ZMONTH    Z                   12 r   1                    12
 TYEAR     T                    4 r   1900                 1903
list my_reshaped
             VARIABLE : RESHAPE(MY_TIME_SERIES, OUT_GRID)
             FILENAME : tmp.cdf
             SUBSET   : 12 by 4 points (Z-T)
              1   2   3   4   5   6   7   8   9   10  11  12 
               1   2   3   4   5   6   7   8   9  10  11  12
 1900   / 1:................................................
 1901   / 2:................................................
 1902   / 3:................................................
 1903   / 4:................................................

Ansley Manke wrote:
Hi Steve,
The question of how to represent data as year vs month-of-year happens
to be explained as an example of the RESHAPE function.  Take a look in
the Users Guide under reshape.

Ansley Manke
 
 

Steve Knox wrote:

 
  I have a netcdf file with 1 variable, tmp  for latitudes -90 to 90 (by 1/2 deg) and longitudes -180 to 180 (by 1/2 degree)
The time unit is "months since 1900-01-15 00:00:00". There are 1200 months (100 years).
I would like to plot year along the x-axis and month (1-12) on the y-axis for a paricular spatial aggregation.
The "value" plotted should be a shaded area, representing the value at each month. I want to look for monthly
or seasonal variations over time.

12  B     A


 
 
 
 
 
 ...
 3   A
 2   B    A
 1   B    B


    1901     1902    ...

Where the letters" images would actually be shaded areas.

Is this possible with Ferret?

yes? use tmp
yes? show data
     currently SET data sets:
    1> ./tmp.cdf  (default)
 name     title                             I         J         K         L
 TMP      Surface air temperature          1:720     1:360     ...       1:1200
 

-- 
_________________________
Steve Knox
NREL
Colorado State University
(970)491-1972

-- 
_________________________
Steve Knox
NREL
Colorado State University
(970)491-1972
  


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement