<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Neil,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In the future, please post NCL questions to ncl-talk (<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>) and not ncarg-talk. ncarg-talk is for people using old Fortran and C NCAR Graphics programs.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks for providing a clean and short script and information about your data.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The main thing that looks like a potential problem is that you have NaN as a _FillValue, which will not work in NCL. Does your data actually contain NaNs as well? If so, these will need to be converted to actual values as well. NCL does not like NaNs!</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Your plotting code looks correct, but it's hard to tell if the issue is because of the NaNs, or something else.  In order to rule out NaNs as an issue, I've modified your code a bit:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[1]</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I added some code to fix the potential NaN issue.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[2]</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It's always important to look at your data to make sure it looks correct. I'm not sure how you checked your data before, but I added printMinMax and stat_dispersion as two ways of looking at your data.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[3]</div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><br></div><div class="gmail_default">You can use a call to gsn_csm_contour_map in place of calls to gsn_csm_map, gsn_csm_contour, overlay, draw, and frame.</div></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><br></div><div class="gmail_default">[4]</div><div class="gmail_default"><br></div><div class="gmail_default">To use gsn_csm_contour_map, you need to make sure the x and y arrays have the proper units of "degrees_north" and "degrees_east". Most NetCDF files use this type of units convention, and plotting tools others than NCL tend to look for this information. </div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Please give the modified script a try and let me know if you still have issues plotting your data.  If you continue to have issues, it would help if you could provide the data file as well.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</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 Thu, Sep 21, 2017 at 4:36 PM, Neil Weston - NOAA Federal <span dir="ltr"><<a href="mailto:neil.d.weston@noaa.gov" target="_blank">neil.d.weston@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">NCL Users,<div><br></div><div>I have a netcdf file with 'z' data that ranges from 0 to 1.76. The NCL script below overlays contours on a map of North America.  However, I have noticed that data from 0.5 to 1.2 are not plotted even though measurements with values in that range do exist in the netcdf dataset.  I verified this by plotting the 'z' values in the dataset using Generic Mapping Tools (GMT) as well as using ncdump to look at the data.</div><div><br></div><div>I may have overlooked something but if you have any suggestions to plot these values, I would sincerely appreciate them.  The short NCL script is below.</div><div><br></div><div>Kind regards,</div><div>Neil</div><div>----------</div><div>ncdump header and NCL script below</div><div><br></div><div><div><div class="m_-2834734329080786098gmail-m_-3541227480198404697gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div>netcdf horizontal-high {</div><div>dimensions:</div><div>        x = 4601 ;</div><div>        y = 3001 ;</div><div>variables:</div><div>        double x(x) ;</div><div>                x:long_name = "x" ;</div><div>                x:actual_range = -170., -55. ;</div><div>        double y(y) ;</div><div>                y:long_name = "y" ;</div><div>                y:actual_range = 5., 80. ;</div><div>        float z(y, x) ;</div><div>                z:long_name = "z" ;</div><div>                z:_FillValue = NaNf ;</div><div>                z:actual_range = 0.000674999959301203, 1.76100623607635 ;</div><div><br></div><div>// global attributes:</div><div>                :Conventions = "COARDS, CF-1.5" ;</div><div>                :title = "" ;</div><div>                :history = "grdsample <a href="http://horizontal.nc" target="_blank">horizontal.nc</a> -Ghorizontal-high.nc -I0.025/0.025" ;</div><div>                :description = "" ;</div><div>                :GMT_version = "5.3.2 (r17593) [64-bit]" ;</div></div><div><br></div><div>----------------</div><div><br></div><div><div>begin</div><div><br></div><div>   cdf_file = addfile("<a href="http://horizontal-high.nc" target="_blank">horizontal-high.nc</a>","<wbr>r")</div><div>   ;cdf_file = addfile("<a href="http://vertical-high.nc" target="_blank">vertical-high.nc</a>","r"<wbr>)</div><div>   shift = cdf_file->z(:,:)</div><div>   lat = cdf_file->y</div><div>   lon = cdf_file->x</div><div>   shift@long_name = ""</div><div>   lat@long_name = ""</div><div>   lon@long_name = ""</div><div><br></div><div>   wks = gsn_open_wks("x11","overlay")</div><div><br></div><div>   ; define resources</div><div>   mpres = True</div><div>   mpres@gsnDraw = False</div><div>   mpres@gsnFrame = False</div><div>   res = mpres</div><div>   cnres = mpres</div><div><br></div><div>   ; contour</div><div>   cnres@cnFillOn = True</div><div>   cnres@cnLinesOn = False</div><div>   cnres@cnInfoLabelOn = False</div><div>   cnres@cnFillPalette = "MPL_jet"</div><div>   ;cnres@cnFillPalette = "BkBlAqGrYeOrReViWh200"</div><div>   ;cnres@cnFillPalette = "horizontal"</div><div>   cnres@lbOrientation = "Vertical"</div><div>   ;cnres@lbTitleString = "Horizontal Shift"</div><div>   cnres@lbTitlePosition = "Left"</div><div>   cnres@lbBoxLinesOn = False</div><div>   cnres@lbTitleFontHeightF = 0.015</div><div>   cnres@lbLabelFontHeightF = 0.01</div><div><br></div><div><br></div><div>   cnres@sfXArray = lon</div><div>   cnres@sfYArray = lat</div></div><div><div>   cnres@cnLevelSelectionMode = "ManualLevels"</div><div>   cnres@cnMinLevelValF = 0.0</div><div>   cnres@cnMaxLevelValF = 2.0</div><div>   cnres@cnLevelSpacingF = 0.1</div><div>   cnres@cnLineLabelsOn = False</div><div><br></div><div>   ; make sure contours are drawn in "predraw" phase</div><div>   cnres@cnFillDrawOrder = "Predraw"</div><div><br></div><div>   ; map</div><div>   mpres@tiMainString = "Horizontal Shift (m)"</div><div>   mpres@mpFillOn = False</div><div>   mpres@mpMaxLatF = 80</div><div>   mpres@mpMinLatF = 5</div><div>   mpres@mpMinLonF = -170</div><div>   mpres@mpMaxLonF = -55</div><div>   mpres@mpOutlineOn = True</div><div>   mpres@mpOutlineDrawOrder = "PostDraw"</div><div><br></div><div>   ; create but don't draw contours, maps, vectors etc.</div><div>   cnid = gsn_csm_contour(wks,shift,<wbr>cnres)</div><div>   mpid = gsn_csm_map(wks,mpres)</div><div><br></div><div>   ; overlay contour, streamline and vector plots on the map plot</div><div>   overlay(mpid,cnid)</div><div><br></div><div>   draw(mpid)</div><div>   frame(wks)</div><div><br></div><div>end</div></div><div><div><font color="#3d85c6">------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------</font></div>Dr. Neil D. Weston<div><br></div><div>Technical Director</div><div>OCS, National Ocean Service, NOAA</div><div>SSMC3, Rm 7806</div><div>1315 East West Hwy, Silver Spring, MD 20910</div><div><br></div><div><img src="https://lh3.googleusercontent.com/ZkLxozigg75AQijJIUgi3DNbOPl7SDUSKT8IDXJID4U=s21-p-no"><span><span title="Call with Google Voice"><span title="Call with Google Voice"><span title="Call with Google Voice"><a href="tel:(301)%20713-2801" value="+13017132801" target="_blank">301-713-2801</a></span></span></span>     </span><img src="https://lh6.googleusercontent.com/LBaC2QL4MQYrjJosbc3qbOaOgxpiQdCD8bbri_2htmE=w19-h22-p-no"><span><span title="Call with Google Voice"><span title="Call with Google Voice"><span title="Call with Google Voice"><a href="tel:(240)%20278-7194" value="+12402787194" target="_blank">240-278-7194</a></span></span></span>     </span><img src="https://lh3.googleusercontent.com/Al5wJW-OOXme8gnlQn1NDU562zNN0xVNdnBgQpr9UmM=s21-p-no"><span> <span title="Call with Google Voice"><span title="Call with Google Voice"><span title="Call with Google Voice"><a href="tel:(301)%20713-4501" value="+13017134501" target="_blank">301-713-4501</a></span></span></span>     </span><img src="https://lh4.googleusercontent.com/G0GpSYqY_PL8FGh8aZoUPlm0gvsVNeXUT8vnziWgU8E=s21-p-no"> <a href="mailto:neil.d.weston@noaa.gov" target="_blank">neil.d.weston@noaa.gov</a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>
<br>______________________________<wbr>_________________<br>
ncarg-talk mailing list<br>
<a href="mailto:ncarg-talk@ucar.edu">ncarg-talk@ucar.edu</a><br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncarg-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncarg-talk</a><br>
<br></blockquote></div><br></div>