Re: Curly Vectors

From: Rick Brownrigg <brownrig_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 26 2013 - 10:52:35 MDT

Hi Brittany,

Not for certain, but you may need to use "gsn_csm_vector_map()", rather than "gsn_csm_vector()" (?)

Rick

On Mar 26, 2013, at 10:45 AM, "brittany.hailey" <brittany.hailey@students.jsums.edu> wrote:

> I am trying to use curly vectors to plot over a gsn_csm map, but I keep getting the following errors:
>
> warning:mpProjection is not a valid resource in winds_vector at this time
> warning:mpLimitMode is not a valid resource in winds_vector at this time
> warning:mpLeftCornerLonF is not a valid resource in winds_vector at this time
> warning:mpRightCornerLonF is not a valid resource in winds_vector at this time
> warning:mpLeftCornerLatF is not a valid resource in winds_vector at this time
> warning:mpRightCornerLatF is not a valid resource in winds_vector at this time
> warning:mpLambertMeridianF is not a valid resource in winds_vector at this time
> warning:mpLambertParallel1F is not a valid resource in winds_vector at this time
> warning:mpLambertParallel2F is not a valid resource in winds_vector at this time
>
>
> This is my script:
>
>
> ;*******************************************
> ; Open file and read in data
> ;*******************************************
>
> dir = "/narrr-data/data/" ; input directory
> f = addfile (dir + "narr-a_221_20011231_0000_000.grb", "r")
>
> ;*******************************************
> ; Read variables and assign names
> ;*******************************************
>
> ; These are 2-D arrays
> lat = f->gridlat_221
> lon = f->gridlon_221
> lev = f->lv_ISBL2 ; [0:19] [150,200,300,500,550,600,650,700,725,750,775,800,825,850,875,900,925,950,975,1000]
> ;*******************************************
> ; Remove ";" for required variable
> ;*******************************************
> u_wind = f->U_GRD_221_ISBL(19,:,:) ; (lev,lat,lon) u-wind_component
> v_wind = f->V_GRD_221_ISBL(19,:,:)
> u_wind@lat2d = lat
> u_wind@lon2d = lon
> v_wind@lat2d = lat
> v_wind@lon2d = lon
>
> ; speed = sqrt(u_wind^2+v_wind^2) ; Calculate windspeed
> ; copy_VarCoords(u_wind,speed) ; copy coord vars to speed
>
> ;*************create plots*******************
> wks = gsn_open_wks ("ps", "winds") ; Create output filename and type
> gsn_define_colormap (wks,"gui_default") ; choose color map
>
> res = True ; plot mods desired for original grid
>
> ;************************************************************
> ; Define NARR Map
> ;
> ; Define how map is to be displayed [gridlines, boundaries]
> res@mpLimitMode = "Corners" ; choose range of map
> res@mpLeftCornerLatF = 30
> res@mpLeftCornerLonF = -93
> res@mpRightCornerLatF = 35
> res@mpRightCornerLonF = -86
> res@tfDoNDCOverlay = False
> res@mpProjection = "LambertConformal"
> res@mpLambertParallel1F = 50
> res@mpLambertParallel2F = 50
> res@mpLambertMeridianF = 253
>
>
> ; END NARR MAP
> ;**********************************************************************
> res@vcMonoLineArrowColor = False ; vec's colored by their mag
> res@vcRefMagnitudeF = 5.0 ; add a reference vector
> res@vcRefLengthF = 0.045 ; what the ref length is
> res@vcMonoLineArrowColor = False ; vec's colored by their mag
> res@vcGlyphStyle = "CurlyVector" ; turn on curly vectors
> res@gsnSpreadColors = True ; use total colormap
> ; res@gsnSpreadColorStart = 4
> res@pmLabelBarDisplayMode = "Always" ; Turn on a label bar.
> res@pmLabelBarWidthF = 0.08 ; make it thinner
> res@lbPerimOn = False ; no box around it
>
> res@tiMainString = "Curly Wind Vector at @"+lev(19) + "mb for Mississippi colored by wind speed" ; draw center subtitle
> ; res@gsnLeftString = "U Component Wind" ; draw left subtitle
> plot = gsn_csm_vector(wks,u_wind,v_wind,res) ; Draw original grid on map
>
> end
>
> _______________________________________________
> 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 Tue Mar 26 10:52:44 2013

This archive was generated by hypermail 2.1.8 : Tue Apr 02 2013 - 21:23:48 MDT