overlay vectors on map

From: <elodyfluck_at_nyahnyahspammersnyahnyah>
Date: Mon Feb 06 2012 - 13:02:45 MST

Hello NCL users,

I would like to overlay wind vectors on a map. I used "vectors_ncl"  scripts examples in guidance, but my problem is still present:  In fact, I have just my vector plot but it isn't overlay on a map.
I think that I don't use the function overlay properly, so do you have any suggestion?
Data used are ERA Interim surface reanalyses.

Thanks in advance

Elody Fluck

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"
> >
> > begin
> >
> > plot = new((/1/),"graphic")
> >
> > f = addfile("/archive/crct/shared/ERA_INTERIM/SURFACE"+"/erai_sfc_1995_10.nc","r")
> >
> > x = short2flt(f->u10)
> > ;printVarSummary(x)
> > t = lonFlip(x); reorder
> > ;printVarSummary(t)
> > x@latitude = f->latitude
> > x@longitude = f->longitude
> >
> > v = t(latitude|:,longitude|:,time|:)
> > ;printVarSummary(v)
> >
> > a = v({0:30},{-21:27},:); coordinate subscripting
> > ;printVarSummary(a)
> >
> >
> > vv = dim_avg_Wrap(a)
> >
> > printVarSummary(vv)
> > print(min(vv)+" "+max(vv))
> >
> >
> >
> > ff = addfile("/archive/crct/shared/ERA_INTERIM/SURFACE"+"/erai_sfc_1995_10.nc","r")
> >
> > xmw = short2flt(ff->v10)
> > ;printVarSummary(xmw)
> > tmw = lonFlip(xmw); reorder
> > ;printVarSummary(tmw)
> >
> > vmw = tmw(latitude|:,longitude|:,time|:)
> > ;printVarSummary(vmw)
> > xmw@latitude = f->latitude
> > xmw@longitude = f->longitude
> >
> > amw = vmw({0:30},{-21:27},:); coordinate subscripting
> > ;printVarSummary(amw)
> >
> >
> > vvmw = dim_avg_Wrap(amw)
> >
> > printVarSummary(vvmw)
> > print(min(vvmw)+" "+max(vvmw))
> >
> >
> >
>
> > wks = gsn_open_wks("ps","dirwind9697zoom")
> > setvalues wks
> > "wkColorMap" : "gui_default"
> > end setvalues
> >
> > res = True
> > res@gsnDraw= False
> > res@gsnFrame = False
> > res@gsnMaximize = True
> >
> > res@gsnAddCyclic = False
> > ;Zoom on Sahel
> > res@mpLimitMode = "Corners"
> > res@mpLeftCornerLatF = 0
> > res@mpLeftCornerLonF = -21
> > res@mpRightCornerLatF = 30
> > res@mpRightCornerLonF = 27
> >
> > res@mpCenterLonF = (res@mpRightCornerLonF-res@mpLeftCornerLonF)/2
> >
> > res@tfDoNDCOverlay = True
> >
> > res@mpGeophysicalLineColor = 2
> > res@mpPerimOn = True
> > res@mpGridLineDashPattern = 2
> > res@mpOutlineBoundarySets = "AllBoundaries"
> > res@mpUSStateLineColor = "black"
> > res@pmTickMarkDisplayMode = "Always"
> > res@lbLabelBarOn =False
> >
> > ; Create vectors
> >
> >  vres= True
> > vres@vcGlyphStyle = "CurlyVector"
> > vres@vcRefMagnitudeF = 4.0 ; define vector ref mag
> > vres@vcRefLenghtF = 0.045 ; define lenght of vector ref
> > vres@vcRefAnnoOrthogonalPosF = -0.535 ; move ref vecor
> > res@vcRefAnnoArrowLineColor = "black" ; change ref vector color
> > ;vres@vcRefAnnoArrowUseVecColor = False ; don't use vec color for ref
> > ;vres@vcLineArrowColor = "white"
> > ;vres@vcLineArrowThicknessF = 2.0
> > ;vres@vcVectorDrawOrder = "PostDraw"
> >
> > map = gsn_csm_map(wks,res)
> > plot(0) = gsn_csm_vector(wks,vv,vvmw,vres)
> > overlay(map,plot(0))
> >
> > draw(map)
> > frame(wks)
> >
> > 
> > end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Feb 6 13:02:57 2012

This archive was generated by hypermail 2.1.8 : Mon Feb 06 2012 - 14:24:56 MST