# vector plot

From: Chao Luo <chao.luo_at_nyahnyahspammersnyahnyah>
Date: Fri Apr 08 2011 - 16:30:35 MDT

Hi,

I am trying to plot wind vector. What I am doing is to read U and V from ascii data file and read 2D lat and lon, and use
res@sfXArray = lon2d
res@sfYArray = lat2d
the error message like:
warning:sfXArray is not a valid resource in vector_vector at this time
warning:sfYArray is not a valid resource in vector_vector at this time

How to set lat and lon attributes to U and V, since U and V read from ASCII data file?

here is my short script

--------------------------------------
;***************************************************************************
; tstvec_1.ncl
;
;***************************************************************************

procedure metaUtil (z[*][*][*]:numeric, time[*], lat[*], lon[*])

begin
z!0 = "time" ; name dimensions
z!1 = "lat"
z!2 = "lon"
z&time = time ; assign coordinate variables
z&lat = lat
z&lon = lon
end

begin
lat2d = f->LAT(0,0,:,:)
lon2d = f->LON(0,0,:,:)

;;;; read model simulated IC2CG data
lat_nbr = 100
lon_nbr = 142

;*************create plots*******************
wks = gsn_open_wks ("ps", "vector") ; open workstation
gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap
res = True ; plot mods desired
res@gsnDraw = False ; Don't draw plot or advance the
res@gsnFrame = False ; frame after plot is created.
res@gsnFrame = False ; so we can draw time stamp
res@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector up
res@vcRefMagnitudeF = 10.0 ; define vector ref mag
res@vcRefLengthF = 0.045 ; define length of vec ref
res@vcGlyphStyle = "CurlyVector" ; turn on curly vectors
res@vcMinDistanceF = 0.017
res@sfXArray = lon2d
res@sfYArray = lat2d
res@mpLimitMode = "Corners"
res@mpLeftCornerLatF = lat2d(0,0)
res@mpLeftCornerLonF = lon2d(0,0)
res@mpRightCornerLatF = lat2d(99,141)
res@mpRightCornerLonF = lon2d(99,141)

vector = gsn_csm_vector_map_ce(wks,uw,vw,res)
frame (wks)
end

--------------------------------------------------
Thanks,
Chao

Thanks,

Chao
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Apr 9 08:30:43 2011

This archive was generated by hypermail 2.1.8 : Tue Apr 19 2011 - 18:32:03 MDT