Re: how to use "time_axis_labels"?

From: Arindam Chakraborty <arch_at_nyahnyahspammersnyahnyah>
Date: Mon May 28 2012 - 03:35:31 MDT

hi Basit,
 make sure that the 0th argument to time_axis_label() is an 1-d array
containing the 'time' values as numbers. The numbers must have been
calculated from a origin with a proper units, specified by the "units"
attribute to the 0th argument. In your case, please make sure that
'newdate' is a numerical variable and not a string, and has a units
attribute something of this form: "days since yyyy-mm-dd hh:mm:ss". Check
cd_inv_calendar() for more details about this "units" attribute.

regards,

--
*Dr Arindam Chakraborty
*
On Mon, May 28, 2012 at 2:32 PM, BasitAli Khan
<BasitAli.Khan@kaust.edu.sa>wrote:
> Hi NCL users,
> I have been trying to use time_axis_labels to plot an xy-plot from my
> wrfoutput however, I am getting the following error.
>
> fatal:Argument type mismatch on argument (0) of (time_axis_labels) can not
> coerce
>
> I looked at NCL mail archive and tried Saji Hameed's solution but that
> also didn't work for me. I would greatly appreciate if some could help to
> fix this.  My script for the xy plot is copied below.
>
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"
>
> begin
>
>  f1 = addfile("/project/k14/basit/wrf-sims/wrf_153/times.nc","r")
>  f2 = addfile("/project/k14/basit/wrf-sims/wrf_153/tauaer2.nc","r")
>  wks   = gsn_open_wks ("x11","outFname")
>
>  nTimes = dimsizes(times_f1)
>
>  date_f1    = times_f1
>  year_f1    = str_get_cols(date_f1,0,3)
>  month_f1   = str_get_cols(date_f1,5,6)
>  day_f1     = str_get_cols(date_f1,8,9)
>  hour_f1    = str_get_cols(date_f1,11,12)
>  minutes_f1 = str_get_cols(date_f1,14,15)
>
> aoT2   = wrf_user_getvar(f2,"TAUAER2", -1)
>  aoT2_new = aoT2(:,0,300,300)
>
>  newdate=year_f1+month_f1+day_f1+hour_f1+minutes_f1
>  resplot =True
>  restick = True
>  restick@ttmFormat="%Y%N%D%H%M"
>  newdate@units="200606010000"
>  restick@ttmAxis ="XB"
>  print(newdate)
>
> time_axis_labels(newdate,resplot,restick)
>
>  plot = gsn_csm_xy(wks, aoT2_new,newdate,resplot)
>
> end
>
>
>
> Thanks and best regards,
> ----
>
> Basit A. Khan, Ph.D.****
>
> Postdoctoral Research Fellow****
>
> Division of Physical Sciences & Engineering****
>
> Office# 3204, Level 3, Building 1,****
>
> King Abdullah University of Science & Technology****
>
> 4700 King Abdullah Blvd, Box 2753, Thuwal 23955 –6900,****
>
> Kingdom of Saudi Arabia.****
>
> ** **
>
> Office: +966(0)2 808 0276,  Mobile: +966(0)5 0860 3617****
>
> E-mail: basitali.khan@kaust.edu.sa****
>
> Skype name: basit.a.khan
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 28 03:36:04 2012

This archive was generated by hypermail 2.1.8 : Wed May 30 2012 - 09:25:29 MDT