<div dir="ltr"><div>Hi, <br></div>I have been trying to modify this code <a href="https://www.ncl.ucar.edu/Applications/Scripts/station_1.ncl">https://www.ncl.ucar.edu/Applications/Scripts/station_1.ncl</a> to plot data set with four states station data. I don't know how to select values for <br><pre>tlat1 = 60.0
tlat2 = 30.0
clon = -98.5
clat = 36.3<br></pre><pre>and also for <br>res@mpLeftCornerLatF = lat2d(20,18)<br> res@mpLeftCornerLonF = lon2d(20,18)<br> res@mpRightCornerLatF = lat2d(58,52)<br> res@mpRightCornerLonF = lon2d(58,52)<br></pre><pre>I attached here a file i use to plot. <br>begin<br> strll = asciiread("stationmac.txt", -1, "string") ;<br> print(strll) ; STATION","STATION_NAME", "LAT", "LON"<br> print("=====")<br><br>sloc = str_get_field(strll , 2, ",")<br> lat = tofloat( str_get_field(strll , 3, ",") )<br> lon = tofloat( str_get_field(strll , 4, ",") )<br> print(sloc +" : "+lat+" "+lon)<br>dimsizes(lat)<br>dimsizes(lon)<br> NOBS = 65<br>diri="/home/dailysimms/prec-obs/01/"<br>z1 = asciiread(diri+"PrecJan1965-2014",-1,"float")<br>print(z1)<br>printVarSummary(z1)<br>;a = (/1,2,3,4,5,6,7,8/)<br>;391 rows by 50 columns<br>a0 = onedtond(z1,(/391,50/))<br>;print(a0)<br>x=dim_avg(a0)<br>print(x)<br>;<br>; This second file is not so tricky. The 2D lat/lon data is sorted with<br>; lat values first, and then lon values.<br>;<br> nlat = 70<br> nlon = 70<br> latlon2d = asciiread("stn_latlon.dat",(/2,nlat,nlon/),"float")<br> lat2d = latlon2d(0,:,:)<br> lon2d = latlon2d(1,:,:)<br><br> delete(latlon2d)<br><br> tlat1 = 60.0<br> tlat2 = 30.0<br> clon = -98.5<br> clat = 36.3<br><br>;***********************************************<br>; Plot<br>;***********************************************<br> pltDir = "./"<br>; wks = gsn_open_wks("x11",pltDir+pltNam)<br> wks = gsn_open_wks("x11","god")<br> gsn_define_colormap(wks,"WhViBlGrYeOrRe")<br><br> res = True<br> res@gsnFrame = False ; So we can draw markers<br> res@gsnMaximize = True<br><br>res@gsnSpreadColors = True<br> res@gsnSpreadColorEnd = 90<br><br>res@trGridType = "TriangularMesh"<br><br>res@cnLevelSelectionMode = "ManualLevels"<br> res@cnMinLevelValF = 15 ; 15.25<br> res@cnMaxLevelValF = 20 ; 49.75<br> res@cnLevelSpacingF = 0.125<br><br>res@cnFillOn = True<br> res@cnLinesOn = False<br>res@cnLineLabelsOn = True<br> res@cnLevelFlags = new(139,"string")<br> res@cnLevelFlags(:) = "NoLine"<br> res@cnLevelFlags(0::20) = "LineAndLabel"<br><br>res@lbLabelAutoStride = True<br> res@lbBoxLinesOn = False<br> res@tiMainString = "XX"<br><br>res@sfXArray = lon<br> res@sfYArray = lat<br><br>res@mpProjection = "LambertConformal"<br> res@mpLambertParallel1F = tlat1<br> res@mpLambertParallel2F = tlat2<br> res@mpLambertMeridianF = clon<br><br>res@mpLimitMode = "Corners"<br> res@mpLeftCornerLatF = lat2d(20,18)<br> res@mpLeftCornerLonF = lon2d(20,18)<br> res@mpRightCornerLatF = lat2d(58,52)<br> res@mpRightCornerLonF = lon2d(58,52)<br><br> res@mpFillOn = False<br> res@mpOutlineDrawOrder = "PostDraw"<br> res@mpFillDrawOrder = "PreDraw"<br>; res@mpOutlineBoundarySets = "GeophysicalAndUSStates"<br>res@mpOutlineBoundarySets= "USStates"<br>; res@mpUSStateLineColor = "Gray10"<br>; res@mpUSStateLineDashPattern = 2<br><br> res@pmTickMarkDisplayMode = "Always"<br> map = gsn_csm_contour_map(wks,x,res)<br><br><br> frame(wks)<br>end<br> <br></pre><pre>I would appreciate any help and suggestion to understand and fix this issue. <br><br></pre><pre>Thank you,<br></pre><pre>Adv <br></pre><pre><br></pre></div>