<div dir="ltr"><div class="gmail_default" style="font-size:small">If you don't need a lambert conformal plot, then I suggest doing a simple lat/lon plot. Instead of </div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><br></font></div><div class="gmail_default" style=""><div class="gmail_default" style=""><font face="monospace, monospace"> res@mpProjection = "LambertConformal"</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@mpLambertParallel1F = tlat1</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@mpLambertParallel2F = tlat2</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@mpLambertMeridianF = clon</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><br></font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@mpLimitMode = "Corners"</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@mpLeftCornerLatF = lat2d(20,18)</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@mpLeftCornerLonF = lon2d(20,18)</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@mpRightCornerLatF = lat2d(58,52)</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@mpRightCornerLonF = lon2d(58,52)</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><br></font></div><div class="gmail_default" style=""><font face="arial, helvetica, sans-serif">I suggest:</font></div><div class="gmail_default" style=""><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default"><font face="monospace, monospace"> res@mpMinLatF = min(lat)<br></font></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace"> res@mpMaxLatF = max(lat)<br></font></div><div><div class="gmail_default"><font face="monospace, monospace"> res@mpMinLonF = min(lon)<br></font></div></div><div><div class="gmail_default"><font face="monospace, monospace"> res@mpMaxLonF = max(lon)<br></font></div></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">You can also put in whatever lat/lon values you want for the above four resources, instead of using min/max. Sometimes I like to add a little bit of a margin so I can see the plot better:</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div><div class="gmail_default"><font face="monospace, monospace"> res@mpMinLatF = min(lat)-1<br></font></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace"> res@mpMaxLatF = max(lat)+1<br></font></div><div><div class="gmail_default"><font face="monospace, monospace"> res@mpMinLonF = min(lon)-1<br></font></div></div><div><div class="gmail_default"><font face="monospace, monospace"> res@mpMaxLonF = max(lon)+1</font></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 8, 2015 at 10:48 AM, Adv <span dir="ltr"><<a href="mailto:advita6@gmail.com" target="_blank">advita6@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">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>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>