<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Dave,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">We have a ticket (NCL-2207) for modernizing the map outlines in NCL, and we hope to do this through the use of public domain sources, like GADM or similar. I just made this ticket a higher priority, and it recently was put in our road map as a high priority.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I agree that the use of shapefiles is the best route for now. We have many examples at:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/shapefiles.shtml">http://www.ncl.ucar.edu/Applications/shapefiles.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">and a template for adding shapefile outlines to an existing plot:</div><div class="gmail_default"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/Templates/#AddingShapefileOutlinesTemplates">http://www.ncl.ucar.edu/Applications/Templates/#AddingShapefileOutlinesTemplates</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 30, 2017 at 7:32 PM, Dave Allured - NOAA Affiliate <span dir="ltr"><<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</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">Tim and NCL support,<div><br></div><div>State and county lines in the current NCL database are not accurate for high resolution maps. Please see the attached figure. Near Tim's reference point, NCL's built-in NC/VA state line is about 1 kilometer north of the same line in the GADM United States shape file. This offset is large enough to move the appearance of the reference point into the wrong state. It appears that the GADM shape file is much more accurate than the NCL database.</div><div><br></div><div>Can the NCL built-in database be updated with more accurate state and county lines?</div><div><br></div><div>Tim, for an interim fix I recommend disabling the built-in state outlines. Instead, plot state and county outlines using an accurate shape file such as the GADM U.S. shape file. See the attached NCL script for an example. I recommend against using any manual offsets, because those can lead to abundant hidden mistakes.</div><div><br></div><div>In addition, I also found discrepancies in state and county lines, between the GADM U.S. shape file and Google Earth. The state line discrepancy at this Virginia location is about 100 meters, or in general about an "order of magnitude" less than the same discrepancy with NCL.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>--Dave</div></font></span><div><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Sun, May 28, 2017 at 10:13 AM, Tim Melino <span dir="ltr"><<a href="mailto:melino33@gmail.com" target="_blank">melino33@gmail.com</a>></span> wrote:<br></span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Barry and Dennis for your help on this! <div><br></div><div>Dennis, I added your my other question was why is the point in NCL plotted south of the North Carolina border with NCL? The actual location is in Virginia, I noticed this was occurring in the image that you sent me too. </div><div><br></div><div><img src="cid:ii_15c4fd011c24c05b" alt="Inline image 1" width="528" height="390"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 28, 2017 at 12:00 PM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@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 Dennis:<div><br></div><div>Thank you for helping. Sorry I was unavailable to (try to) do more.</div><span class="m_-2068379053933202181m_-1047126119660556387HOEnZb"><font color="#888888"><div><br></div><div>Barry</div></font></span></div><div class="m_-2068379053933202181m_-1047126119660556387HOEnZb"><div class="m_-2068379053933202181m_-1047126119660556387h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 28, 2017 at 6:25 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</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><div><div><div>See attached. Please look carefully at the output produced by printVarSummary and printMinMax<br><br></div>Note: <br><br>[1] GRIB is a moving target. 6.3.0 did not have the look-up tabl builtin while NCL 6.4.0 does.<br><br></div>[2] the grib file has 'no report' coded as as -1 ... the script sets those values to _FillValue<br><br></div>[3] The grid is *rectilinear* : <br>In netCDF speak, a one dimensional variable where the variable name is the same as the variable dimension name is a coordinate variable. lat_0(lat_0) and lon_0(lon_0)<br><br></div>Good Luck<br><div><div><br><br></div></div></div><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705HOEnZb"><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 28, 2017 at 10:21 AM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@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">Tim:<div><br></div><div>If you can wait a day or two, I suggest you write to:</div><div><br></div><div><a href="mailto:Carrie.Langston@noaa.gov" target="_blank">Carrie.Langston@noaa.gov</a><br></div><div><br></div><div>and ask Him/Her what is the format of the gridded data and if they have an NCL program to read it.</div><div><br></div><div>It's looks like very useful data once you "crack the code."</div><span class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130HOEnZb"><font color="#888888"><div><br></div><div>Barry</div></font></span></div><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130HOEnZb"><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 28, 2017 at 5:09 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">Barry, <div><br></div><div>The source of the data is here: </div><div><br></div><div><a href="http://www.nssl.noaa.gov/projects/mrms/operational/tables.php" target="_blank">http://www.nssl.noaa.gov/proje<wbr>cts/mrms/operational/tables.ph<wbr>p</a></div><span class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140HOEnZb"><font color="#888888"><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Tim </div></font></span><div><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140h5"><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 28, 2017 at 10:03 AM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@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">Tim:<div><br></div><div>If you write out the latitude and longitude information is is rectilinear? </div><div><br></div><div>When trying to sort this out, you should first check if the lat/lon can be plotted by a single coordinate or two. If two, then there is a chance that your grid is not rectilinear, and you will have to account for the distortion in the grid.</div><div><br></div><div>If there is distortion, then you need to account for it (e.g., Lambert, curvilinear.</div><div><br></div><div>I can only offer advice at the moment...</div><div><br></div><div>What is the data source for the data? </div><span class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376HOEnZb"><font color="#888888"><div><br></div><div>Barry</div></font></span></div><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376HOEnZb"><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 28, 2017 at 4:52 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">Hey Barry, <div><br></div><div>The only information about the projection was: <span style="font-size:12.8px"><b>grid_type : Latitude/Longitude. </b>I attached the file!</span></div><span class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376m_5032140186964754341HOEnZb"><font color="#888888"><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Tim </span></div></font></span></div><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376m_5032140186964754341HOEnZb"><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376m_5032140186964754341h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 28, 2017 at 9:00 AM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@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">Tim:<div><br></div><div>Please remind me what the name of the file is.</div><div><br></div><div>Also, was there any information at the top of the printing about the projection?</div><div><br></div><div>Yes, the markers would (could) look off.</div></div><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376m_5032140186964754341m_-2955459713035707717HOEnZb"><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376m_5032140186964754341m_-2955459713035707717h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 28, 2017 at 3:32 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 Barry, <div><br></div><div>Here is the information when printing (a). Would the map projection also cause a marker to be printed in the wrong location?</div><div><br></div><div><div>Variable: a</div><div>Type: file</div><div>filename: test</div><div>path: ./test.grib2</div><div> file global attributes:</div><div> dimensions:</div><div> lat_0 = 30</div><div> lon_0 = 40</div><div> variables:</div><div> float VAR_209_3_34_P0_L102_GLL0 ( lat_0, lon_0 )</div><div> center : US NOAA Office of Oceanic and Atmospheric Research</div><div> production_status : Research products</div><div> long_name : unknown variable name</div><div> units : unknown</div><div> _FillValue : 1e+20</div><div> grid_type : Latitude/longitude</div><div> parameter_discipline_and_cate<wbr>gory : 209, 3</div><div> parameter_template_discipline<wbr>_category_number : ( 0, 209, 3, 34 )</div><div> level_type : Specific altitude above mean sea level (m)</div><div> level : 500</div><div> forecast_time : 0</div><div> forecast_time_units : minutes</div><div> initial_time : 07/09/2016 (04:46)</div><div><br></div><div> float lat_0 ( lat_0 )</div><div> long_name : latitude</div><div> grid_type : Latitude/Longitude</div><div> units : degrees_north</div><div> Dj : 0.01</div><div> Di : 0.009999676</div><div> Lo2 : 280.735</div><div> La2 : 36.695</div><div> Lo1 : 280.345</div><div> La1 : 36.405</div><div><br></div><div> float lon_0 ( lon_0 )</div><div> long_name : longitude</div><div> grid_type : Latitude/Longitude</div><div> units : degrees_east</div><div> Dj : 0.01</div><div> Di : 0.009999676</div><div> Lo2 : 280.735</div><div> La2 : 36.695</div><div> Lo1 : 280.345</div><div> La1 : 36.405</div></div><div><br></div></div><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376m_5032140186964754341m_-2955459713035707717m_-620206013470712545HOEnZb"><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376m_5032140186964754341m_-2955459713035707717m_-620206013470712545h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 28, 2017 at 12:48 AM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@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>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"><div><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376m_5032140186964754341m_-2955459713035707717m_-620206013470712545m_-1375217533753848781h5">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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-2068379053933202181m_-1047126119660556387m_-1283029328672780705m_-976659863210083130m_4876879840071301140m_-2002067811460463376m_5032140186964754341m_-2955459713035707717m_-620206013470712545m_-1375217533753848781h5"><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/nclscri<wbr>pts/wrf/WRFUserARW.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/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@mpGeophysicalLineThickness<wbr>F = 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@gsnContourLineThicknessesS<wbr>cale = 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,r<wbr>es)</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,lo<wbr>ns,lats,gres)</div><div>tlats =lats + .03</div><div>tlons =lons</div><div>text = gsn_add_text(wks,plot,site,tlo<wbr>ns,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></div></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></blockquote></div></div></div></div></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></div>