Re: time_axis_labels for wrf data

From: Arindam Chakraborty <arch_at_nyahnyahspammersnyahnyah>
Date: Thu Sep 02 2010 - 06:15:59 MDT

hi Chris,
 Saji is right. The 0th argument should be a string of numerical values representing time-coordinate points. Time coordinate values are interpreted by the units attribute of that variable. Normally this starts with "days since ...." or "hours since ..." etc,
which has both an origin and a unit. This string is directly passed to ut_calendar() series of functions to calculate year,month,day,hour,minute,second of the coordinate points. For example, to represent 31 days of Jan 2010 (at 00 GMT), you may have an array like this:

time = ispan(0,30,1)
time@units = "days since 2010-01-01 00:00:00"

The above is a valid variable to pass on to the time_axis_label() as its 0th argument.

 Normally netcdf files have time axis represented in this fashion. However, it is also possible to have time coordinates represented by integers or strings like, say, 20100101, 20100102 etc. These probably cannot be handled by the function right now and requires some pre-processing before passing to the function.

regards,

arindam

-- 
ARINDAM CHAKRABORTY
---------- Original Message -----------
From: Saji Hameed <saji.nh@gmail.com> 
To: Christopher Steele <christopher.steele@uea.ac.uk> 
Cc: ncl-talk@ucar.edu 
Sent: Thu, 2 Sep 2010 17:42:09 +0900 
Subject: Re: time_axis_labels for wrf data
> Hi Chris,
> 
> What variable are you passing to time_axis_labels as first argument? I guess it needs to be a netcdf time co-ordinate variable. 
> 
> Alternately you can create your own "string of times" from the WRF netcdf output. See the following for an example
> 
> fin=addfile("wrfout_d01_2010-08-23_12:00:00.nc","r")
> times=fin->Times
> dims=dimsizes(times)
> ntime=dims(0)
> years=new(ntime,"string")
> months=years
> days=years
> hrs=years
> do itim = 0,ntime-1
>   years(itim) = chartostring(times(itim,0:3))
>   months(itim) = chartostring(times(itim,5:6))
>   days(itim) = chartostring(times(itim,8:9))
>   hrs(itim) = chartostring(times(itim,11:12))
> end do
> 
> You can then combine them as you wish to make your own time axis label.
> 
> cheers!
> saji
> 
> On Thu, Sep 2, 2010 at 5:08 PM, Christopher Steele <christopher.steele@uea.ac.uk> wrote:
> Hi everyone,
> 
> I'm trying to produce a time series plot using a day's worth of data from the WRF model. The data to be shown begins six hours after the beginning of the model run to account for model spin up time, and so if I were to set a minimum value it would begin on hour 6 instead of hour "0 after yyyy-mm-dd_hh:mm:ss", ie the day that I'm interested in without the spin up time.
> 
> So far, I've tried to use the function time_axis_labels to produce a string of times on the x-axis but keep on getting the error message:
> 
> fatal:Argument type mismatch on argument (0) of (time_axis_labels) can not coerce
> 
> I've attempted to add the unit attribute to the list of times but I'm not sure on the correct format for WRF times data. Has anyone used this, or an equivalent function for WRF times, before? 
> 
> Any help offered would be very much appreciated
> 
> cheers
> 
> Chris  
> 
>  
>   
> 
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> 
> 
> 
> -- 
> This message has been scanned for viruses and
> dangerous content byMailScanner, and is
> believed to be clean.
------- End of Original Message -------
 
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Sep 2 05:00:44 2010

This archive was generated by hypermail 2.1.8 : Thu Sep 16 2010 - 11:05:25 MDT