<div dir="ltr">Hi:<div><br></div><div>When the data is skewed, it is often because the projection you're reading is not the one your plotting.</div><div><br></div><div>Do you know the projection of the data you're using?</div><div><br></div><div>If you print(a) where a is the file you specify from addfile, you can see the variables (and hopefully projection) indicated within.</div><div><br></div><div>Barry</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 27, 2017 at 4:20 PM, Tim Melino <span dir="ltr"><<a href="mailto:melino33@gmail.com" target="_blank">melino33@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">Hi, <div><br></div><div>I am attempting to plot a subset of the MRMS data from NCEP. The latitude and longitude I am plotting is : </div><div><br></div><div>LAT: <span style="color:rgb(0,0,0);font-family:"Times New Roman";font-weight:bold;text-align:-webkit-center">36.5459089</span></div><div>LON: <span style="color:rgb(0,0,0);font-family:"Times New Roman";font-weight:bold;text-align:-webkit-center">-79.4585847</span></div><div><br></div><div>I attached an image of the output along with the grib file I am using for input. I am noticing a couple things first the data appears to be skewed, so I am not sure if it is an issue with the map projection. Second the point which should be plotted in Virginia is actually plotted in North Carolina, the only thing that I have been able to do if offset the marker to compensate for the issue. Does anyone have any ideas on how to fix these issues? Any ideas would be greatly appreciated! </div><div><br></div><div>Thanks! </div><div>Tim </div><div><br></div><div>Code: </div><div><br></div><div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"</div><div><br></div><div>begin</div><div><br></div><div>lati=LAT</div><div>loni=LON</div><div>date=DATE</div><div>address=ADDRESS</div><div><br></div><div><br></div><div>; Convert the Lat/Lon to a Float</div><div>latc= stringtofloat(lati)</div><div>lonc = stringtofloat(loni)</div><div><br></div><div>; Set the Map Bounds</div><div>minlat = latc - .12</div><div>maxlat = latc + .12</div><div>minlon = lonc - .15</div><div>maxlon = lonc + .15</div><div><br></div><div><br></div><div> ;========================</div><div> ; get list of all files and open as "one big file"</div><div> ;========================</div><div> a = addfile( "./" + lati + "_" + loni + ".grib2","r")</div><div><br></div><div> type = "png"</div><div> wks = gsn_open_wks(type,"./" + lati + "" + loni + ".png")</div><div><br></div><div>; Set some Basic Plot options</div><div> res = True</div><div> res@gsnDraw = False ; do not draw the plot</div><div> res@gsnFrame = False ; do not advance the frame</div><div> pltres = True</div><div> pltres@NoTitles = True</div><div> pltres@CommonTitle = True</div><div> pltres@PlotTitle = ""</div><div> pltres@PanelPlot = True</div><div> pltres@FramePlot = False</div><div><br></div><div>; Set the Colormap</div><div> gsn_define_colormap(wks,"hail"<wbr>)</div><div> lat = a->lat_0</div><div> lon = a->lon_0</div><div> water = a->VAR_209_3_34_P0_L102_GLL0(:<wbr>,:)</div><div> hail = water *0.0393701;</div><div><br></div><div><br></div><div> ; Plotting options for Hail</div><div> res@gsnMaximize = True</div><div> res@<wbr>mpGeophysicalLineThicknessF = 4.0</div><div> ;res@mpProjection = "LambertConformal"</div><div> res@mpGridLineThicknessF = 0.5</div><div> res@mpLimbLineThicknessF = 4.0</div><div> res@mpNationalLineThicknessF = 4.0</div><div> res@mpUSStateLineThicknessF = 4.0</div><div> res@mpProvincialLineThicknessF = 4.0</div><div> res@mpOutlineBoundarySets = "AllBoundaries"</div><div> res@mpDataBaseVersion = "Ncarg4_1"</div><div> res@mpDataSetName = "Earth..4"</div><div> res@mpFillOn = False ; fill continents</div><div> res@mpPerimOn = False ; no box around map</div><div> res@tiMainOn = True</div><div> res@tiMainFontColor = "Black"</div><div> res@tiMainString =""</div><div> res@tiXAxisString = ""</div><div> res@tiYAxisString = ""</div><div> res@gsnLeftString = "Date: " + date ; add the gsn titles</div><div> res@gsnRightString = ""</div><div> res@gsnStringFontHeightF = 0.016</div><div> res@cnInfoLabelOrthogonalPosF = 0.07 ; offset second label information</div><div> res@<wbr>gsnContourLineThicknessesScale = 0.001</div><div> res@cnFillOn = True</div><div> res@lbTitleOn = True ; remove field name from label bar</div><div><br></div><div> ; Set the Map Bounds</div><div> res@sfYArray = lat</div><div> res@sfXArray = lon</div><div> res@mpLimitMode = "LatLon"</div><div> res@mpMinLatF = minlat</div><div> res@mpMaxLatF = maxlat</div><div> res@mpMinLonF = minlon</div><div> res@mpMaxLonF = maxlon</div><div> res@tmXBOn = False</div><div> res@tmYLOn = False</div><div> res@tmXTOn = False</div><div> res@tmYROn = False</div><div> res@gsnAddCyclic = False</div><div> res@tfDoNDCOverlay = False ; do not transform data</div><div> res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels</div><div> res@cnLevels = (/ 0.5,0.75, 1.00, 1.25, 1.50, 1.75, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00/) ; set levels</div><div> res@tiMainFontHeightF = 0.018 ; font height of title</div><div> res@lbAutoManage = False ; we control label bar</div><div> res@pmLabelBarDisplayMode = "Always" ; turns on label bar</div><div> res@lbOrientation = "Horizontal" ; ncl default is vertical</div><div> res@pmLabelBarSide = "Bottom" ; default is right</div><div> res@lbLabelStride = 1 ; skip every other label</div><div> res@pmLabelBarWidthF = 0.7 ; default is shorter</div><div> res@pmLabelBarHeightF = 0.1 ; default is taller</div><div> res@lbLabelFontHeightF = .012 ; default is HUGE</div><div> res@lbPerimOn = False ; default has box</div><div> res@lbTitleString = "Hail Size (Inches)"</div><div> res@lbTitleFontHeightF = 0.012</div><div> plot = gsn_csm_contour_map(wks,hail,<wbr>res)</div><div><br></div><div>; Setup the point</div><div> mstring1 = "z"</div><div> fontnum1 = 35</div><div> xoffset1 = .4</div><div> yoffset1 = .7</div><div> ratio1 = 0.0</div><div> size1 = 1.0</div><div> angle1 = 0.0</div><div><br></div><div> Tm_index = NhlNewMarker(wks, mstring1, fontnum1, xoffset1, yoffset1, ratio1, size1, angle1)</div><div><br></div><div> ; Plot the sites and label them</div><div> gres = True</div><div> gres@gsMarkerIndex = Tm_index ; 16</div><div> gres@gsMarkerSizeF = 0.015 ; .009</div><div> gres@gsMarkerColor = "black"</div><div> gres@txFont ="helvetica-bold"</div><div> gres@txFontHeightF = "25"</div><div><br></div><div>site = (/address/)</div><div>lats = (/latc/)</div><div>lons = (/lonc/)</div><div><br></div><div>dot = gsn_add_polymarker(wks,plot,<wbr>lons,lats,gres)</div><div>tlats =lats + .03</div><div>tlons =lons</div><div>text = gsn_add_text(wks,plot,site,<wbr>tlons,tlats ,gres)</div><div><br></div><div>; Draw the graphics</div><div> draw(plot)</div><div> frame(wks)</div><div><br></div><div> end</div></div><div><br></div></div>
<br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US 914 432 3108<br></div></div></div>
</div>