<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><style>body { line-height: 1.5; }body { font-size: 10.5pt; font-family: 微软雅黑; color: rgb(0, 0, 0); line-height: 1.5; }body { font-size: 10.5pt; font-family: 微软雅黑; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>hi,</div><div> i want add several obervation wind vector data on a map, but i cannot find appropriate function to plot.</div><div> the following is my script:</div><div><br></div><div>++++++++++++++++++++++++++++++++++++++</div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>load "$GEODIAG_ROOT/geodiag.ncl"<br><br>begin<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>;; uv data<br>bj_csvs=systemfunc("ls uvdata/112920_inside_obs.csv")<br><br>lines=asciiread(bj_csvs,-1,"string")<br>nlines=dimsizes(lines) - 1<br><br>delim=","<br>field_names=str_split(lines(0),delim)<br>nfields=dimsizes(field_names)<br><br>;<br>fields=new((/nfields,nlines/),string)<br>do nf=0,nfields-1<br> fields(nf,:)=str_get_field(lines(1:),nf+1,delim)<br>end do<br><br>print(fields(1,:) + " "+fields(2,:) + " "+fields(3,:)+" "+fields(4,:))<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>;; pm2.5 data<br><br>ncol = 3 ; number of columns is 3£»ÄãµÄÁÐÊý<br> stationdata= readAsciiTable("pm2.5_txt/15112920.txt", ncol, "float", 1)<br> print(dimsizes(stationdata))<br> nps =dimsizes(stationdata)<br> npts = nps(0) ; Number of points.<br><br> lat = stationdata(:,1) ; latitude values<br> lon = stationdata(:,0) ; longitude values<br> pm25= stationdata(:,2) ; station numbers to appear on the map£»Õâ¸öµØ·½Äã¿ÉÒÔдÎÛȾÊý¾Ý<br><br> printMinMax(pm25,0)<br>;-------interpolate-----------------------------------------------------<br> olon =new(80,"float")<br> olat =new(80,"float")<br> data1=new((/80,80/),"float")<br> do j=0,79<br> olon(j)=113+j*0.1<br> end do<br> do k=0,79<br> olat(k)=36+k*0.1<br> end do<br> <br><br><br>;---------set interpolate res--------------------------------------------<br> olon!0 ="lon"<br> olon@long_name="lontitude"<br> olon@units ="degrees-east"<br> olon&lon =olon<br><br> olat!0 ="lat"<br> olat@long_name="latitude"<br> olat@units ="degrees-north"<br> olat&lat =olat<br><br>;--------Call interpolation function--------------------------------------<br> ;pm25@_FillValue=999999.000000<br> rscan=(/10,5,3,2,1,0.5,0.2,0.1/)<br> data1=obj_anal_ic_deprecated(lon, lat, pm25, olon, olat, rscan, False);creanm<br> printMinMax(data1 ,0)<br> data1!0="lat"<br> data1!1="lon"<br> data1&lat=olat<br> data1&lon=olon<br> data1@units=""<br> data1@long_name="pm2.5"<br> ;data1@_FillValue = pm25@_FillValue<br> printMinMax(olat,0)<br> printMinMax(olon, 0)<br><br>;; plot<br> type="png"<br> wks = gsn_open_wks(type,"2015112920") ; Open a workstation and<br> colors=(/"White","Black","(/.027,.729,.145/)","(/.431,.824,.035/)",\<br> "(/.800,.937,.012/)","(/1.00,.969,0.00/)","(/1.00,.871,0.00/)",\<br> "(/1.00,.710,0.00/)","(/1.00,.549,0.00/)","(/0.00,.757,1.00/)",\<br> "(/0.00,0.455,1.00/)","(/0.00,.122,1.00/)","(/1.00,.275,0.00/)",\<br> "(/1.00,0.059,0.00/)"/) <br> gsn_define_colormap(wks,colors)<br><br> res = True<br> res@cnFillOn = True<br> res@cnLinesOn = False<br> res@cnLineLabelsOn = False<br> res@gsnDraw = False<br> res@gsnFrame = False<br> res@gsnMaximize = True<br> res@gsnAddCyclic = False<br><br> <br> res@mpLimitMode = "LatLon"<br> res@mpMinLatF = 39.40<br> res@mpMaxLatF = 41.00<br> res@mpMinLonF = 115.35<br> res@mpMaxLonF = 117.55<br><br> res@isShowProvince = False<br> res@isShowBeijingCounty = True<br> res@beijingCountyColor = "black"<br> res@beijingCountyThickness = 1.0<br> res@isShowBeijingRing2 = True<br> res@beijingRing2Color = "black"<br> res@beijingRing2Thickness = 1.50<br> res@isShowBeijingRing3 = True<br> res@beijingRing3Color = "black"<br> res@beijingRing3Thickness = 1.50<br> res@isShowBeijingRing4 = True<br> res@beijingRing4Color = "black"<br> res@beijingRing4Thickness = 1.5<br> res@isShowBeijingRing5 = True<br> res@beijingRing5Color = "black"<br> res@beijingRing5Thickness = 1.5<br> res@isShowBeijingRing6 = True<br> res@beijingRing6Color = "black"<br> res@beijingRing6Thickness = 1.5<br> setup_china_map(res)<br><br> plot = gsn_csm_contour_map(wks,data1,res)<br><br> attach_china_map(wks, plot)<br><br> draw(plot)<br><br> ; wmsetp("vch", 0.05)<br> ; wmsetp("vcc", 1)<br> ; wmsetp("vcw", 3.)<br> ; wmsetp("wbs", 0.05)<br> ; wmsetp("col", 1)<br> ; wmsetp("wbs", 0.06)<br> ; wmsetp("ezf",2)<br> ; wmsetp("wbs",0.12)<br> </span><span style="background-color: rgba(0, 0, 0, 0);"><font color="#ff0000"><b>wmsetp("ars",0.05)<br> wmsetp("arl",1.5)</b></font><br> ; wmvectmap(wks, tofloat(fields(2,:)), tofloat(fields(1,:)), tofloat(fields(3,:)), tofloat(fields(4,:)))<br> ; wmvlbl(wks, 1.0, 0.0)<br> <b><font color="#ff0000">wmbarbmap(wks, tofloat(fields(2,:)), tofloat(fields(1,:)), tofloat(fields(3,:)), tofloat(fields(4,:)))</font></b><br><br> frame(wks)<br><br><br>end<br><br></span></div><div>++++++++++++++++++++++++++++++++++++++ </div><div>the red and bold font is for wind barb.</div><div><br></div><div>the figure is as follows:</div><div> <img src="cid:_Foxmail.1@aab1cd9b-dc9f-64d1-7714-3db79824f84c" border="0" style="font-size: 10.5pt; line-height: 1.5; background-color: window;"></div><div>the wind barb are so small on t<span style="background-color: window; font-size: 10.5pt; line-height: 1.5;">his plot, but those sizes are so tiny , which function can be used to enlarge the wind rod for appropriate size.</span></div><div><br></div><div>thanks </div>
<div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>dyjbean@gmail.com</div></div></span></div>
</body></html>