[ncl-talk] about irregular time with gsn_csm_lat_time

dyjbean at gmail.com dyjbean at gmail.com
Tue Aug 23 03:44:36 MDT 2016


hi,
   when i use gsn_csm_lat_time, i got the following warning info:
      warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF value
     warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear 
 and the x-axis didn't appear.

the below is my script:
  
 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/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

begin

    minlat = 9
    maxlat = 56
    minlon = 70
    maxlon = 150


files10=systemfunc("cat  nccolumn.log")
print(files10)

setfileoption("nc","Format","LargeFile")
mons01ff=addfiles(files10,"r")
ListSetType(mons01ff,"join")


slat10=mons01ff[:]->lat
slon10=mons01ff[:]->lon
colm10=mons01ff[:]->column_ozone
colm10dms=dimsizes(colm10)
colm10 at _FillValue=999.0
colm10=colm10*0.1

pcolm10=colm10(:,{minlon:maxlon},{minlat:maxlat})


tlat10=slat10(0,{minlat:maxlat})
tlon10=slon10(0,{minlon:maxlon})


tlat10 at units="degrees-north"
tlon10 at units="degrees-east"



acolm10=dim_avg_n(pcolm10,1)
;print("----"+dimsizes(acolm10))

times10=yyyymm_time(2010,2012,"integer")
;times10=yyyymm_to_yyyyfrac(itimes10, 0.0)
times10!0 = "time"
times10 at units="Months since January 2010"
times10 at long_name="Months"

acolm10!0="time"
acolm10!1="lat"
acolm10 at units=colm10 at units
acolm10 at long_name=colm10 at long_name
acolm10&time=times10
acolm10&lat=tlat10
; print(times10)

printVarSummary(acolm10)

;printMinMax(acolm10&lat, 0)
; printMinMax(tlon10, 0)

print(acolm10&time)

delfile=systemfunc("rm "+"zonal_column"+".png")
wks=gsn_open_wks("png","zonal_column")
gsn_define_colormap(wks,"GMT_no_green")
   res  = True
   res at cnFillOn  =  True
   res at cnLinesOn =  False
   res at gsnAddCyclic  = False
   
   ;res at pmTickMarkDisplayMode = "Always"
   res at tmYLMode = "Explicit"
   res at tmYLValues =(/10,15,20,25,30,35,40,45,50,55/)
   res at tmYLLabels =(/"10~S~o~N~N","15~S~o~N~N","20~S~o~N~N","25~S~o~N~N",\
                    "30~S~o~N~N","35~S~o~N~N","40~S~o~N~N", \
                    "45~S~o~N~N","50~S~o~N~N","55~S~o~N~N"/)
   ;res at tmXBMinorOn =  False 
   
   res at tmXBMode = "Explicit"
   ;res at tmXBFormat = "f"
   ;res at tmXBValues =(/201001,201002,201003,201004,201005,201006,\
   ;                  201007,201008,201009,201010,201011,201012,\
   ;                  201101,201102,201103,201104,201105,201106,\
   ;                  201107,201108,201109,201110,201111,201112,\
   ;                  201201,201202,201203,201204,201205,201206,\
   ;                  201207,201208,201209,201210,201211,201212/)

    
    res at tmXBValues =(/201001,201003,201006,201009,201012,\
                      201101,201103,201006,201109,201112,\
                      201201,201203,201206,201209,201212/)

   ;res at tmXBLabels =(/"JAN","FEB","MAR","APR","MAY","JUN",\
   ;                 "JUL","AUG","SEP","OCT","NOV","DEC",\
   ;                 "JAN","FEB","MAR","APR","MAY","JUN",\
   ;                 "JUL","AUG","SEP","OCT","NOV","DEC",\
   ;                 "JAN","FEB","MAR","APR","MAY","JUN",\
   ;                 "JUL","AUG","SEP","OCT","NOV","DEC"/)
   res at tmXBLabels =(/"JAN~C~2010","MAR~C~2010","JUN~C~2010","SEP~C~2010","DEC~C~2010",\
                     "JAN~C~2011","MAR~C~2011","JUN~C~2011","SEP~C~2011","DEC~C~2011",\
                     "JAN~C~2012","MAR~C~2012","JUN~C~2012","SEP~C~2012","DEC~C~2012"/)
   res at tmXBLabelFontHeightF = 0.015
   ;res at tmYLMinorOn = False
   
  res at tiMainString = ""

    plot=gsn_csm_lat_time(wks,acolm10(lat|:,time|:),res)

end 


the red letters is my origin destination, the blue letters is my test, but they didn't give the right plot.

the following is my running information:
 Variable: acolm10
Type: float
Total Size: 6768 bytes
            1692 values
Number of Dimensions: 2
Dimensions and sizes:   [time | 36] x [lat | 47]
Coordinates:
            time: [201001..201212]
            lat: [9.5..55.5]
Number Of Attributes: 3
  long_name :   ozone column
  units :       DU
  _FillValue :  999


Variable: time (coordinate)
Type: integer
Total Size: 144 bytes
            36 values
Number of Dimensions: 1
Dimensions and sizes:   [time | 36]
Coordinates:
Number Of Attributes: 2
  units :       Months since January 2010
  long_name :   Months
(0)     201001
(1)     201002
(2)     201003
(3)     201004
(4)     201005
(5)     201006
(6)     201007
(7)     201008
(8)     201009
(9)     201010
(10)    201011
(11)    201012
(12)    201101
(13)    201102
(14)    201103
(15)    201104
(16)    201105
(17)    201106
(18)    201107
(19)    201108
(20)    201109
(21)    201110
(22)    201111
(23)    201112
(24)    201201
(25)    201202
(26)    201203
(27)    201204
(28)    201205
(29)    201206
(30)    201207
(31)    201208
(32)    201209
(33)    201210
(34)    201211
(35)    201212
warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF value
warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear 


can you give me some advice for tuning this irregular x-axis time labels?

thanks






dyjbean at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160823/e00d8422/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 111810 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160823/e00d8422/attachment.png 


More information about the ncl-talk mailing list