[ncl-talk] Hovmoller Plot with 2d lat/lon (Y coordinates out of data range)

David Adams dave.k.adams at gmail.com
Thu Oct 9 20:28:52 MDT 2014


HI NCLers,
I am trying to make a hovmoller plot but it does appear that my coordinates
are correct.

warning:ContourPlotInitialize: Y coordinates out of data range: defaulting
warning:ContourPlotInitialize: Zero Y coordinate span:
defaulting:[errno=1104]

and then a blank plot.  The code is from the NCL website with slight
modification

--------------------------------------------------------------------------------
begin
;=============================================
; data processing
;===========================================
 fili  = "test.nc"                 ; filename
  f     = addfile (fili , "r")             ; add file
 new_temp   = f->new_temp                                ; get chi
 new_lat  = f->new_lat
 new_lon  = f->new_lon
;==============================================
; creat plot: Reverse time axis; contour labels horizontal
; Dash negative contours; double width of Zero
;==============================================
 wks  = gsn_open_wks ("pdf", "hov")
 res                     = True                ; plot mods desired
 res at gsnContourZeroLineThicknessF = 2.         ; doubles thickness of zero
contour
 res at gsnContourNegLineDashPattern = 1          ; sets negative contours to
dash pattern 1
 res at trYReverse          = True                ; reverse y axis
 res at tiMainString        = "Reverse Time"      ; title
 res at cnLineLabelAngleF   = 0.0                 ; [cn] label horizontal

;new_temp at lat2d = new_lat(0,:,:)
;new_temp at lon2d = new_lon(0,:,:)

 plot  = gsn_csm_hov(wks, new_temp(:,0,:), res )           ; default
hovmueller
end
--------------------------------------------------------------------------------------------
Here is an ncdump -h on the data file

netcdf test {
dimensions:
    yc = 221 ;
    xc = 141 ;
    time = UNLIMITED ; // (130 currently)
variables:
    float new_temp(time, yc, xc) ;
        new_temp:time = 1372896900 ;
        new_temp:units = "K" ;
        new_temp:coordinates = "lon lat" ;
        new_temp:type = "GVAR" ;
        new_temp:long_name = "Temperature" ;
    float new_lat(time, yc, xc) ;
        new_lat:units = "degrees_north" ;
        new_lat:long_name = "lat" ;
    float new_lon(time, yc, xc) ;
        new_lon:units = "degrees_east" ;
        new_lon:long_name = "lon" ;
    int time(time) ;
        time:units = "seconds since 2013-185 00:15" ;


any obvious errors?

thanks in advance,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141009/c386fbfd/attachment.html 


More information about the ncl-talk mailing list