<div dir="ltr"><div class="gmail_default" style="font-size:small">Sean,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">First, I recommend using &quot;wrf_map_resources&quot; to set the necessary WRF map resources for you.  This will allow you to get rid of all this code:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default" style="font-size:small">mpres@mpProjection                 = &quot;LambertConformal&quot;</div><div class="gmail_default" style="font-size:small">mpres@mpLimitMode                  = &quot;Corners&quot;</div><div class="gmail_default" style="font-size:small">mpres@mpLeftCornerLatF             = lat(0,0)</div><div class="gmail_default" style="font-size:small">mpres@mpLeftCornerLonF             = lon(0,0)</div><div class="gmail_default" style="font-size:small">mpres@mpRightCornerLatF            = lat(nlat-1,nlon-1)</div><div class="gmail_default" style="font-size:small">mpres@mpRightCornerLonF            = lon(nlat-1,nlon-1)</div><div class="gmail_default" style="font-size:small">mpres@mpLambertParallel1F          = b@TRUELAT1</div><div class="gmail_default" style="font-size:small">mpres@mpLambertParallel2F          = b@TRUELAT2</div><div class="gmail_default" style="font-size:small">mpres@mpLambertMeridianF           = b@STAND_LON</div><div class="gmail_default" style="font-size:small">mpres@mpDataBaseVersion            = &quot;MediumRes&quot;</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">and replace it with one line:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">mpres = wrf_map_resources(b,mpres)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The other resources you are setting:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default">mpres@mpOutlineBoundarySets        = &quot;GeophysicalAndUSStates&quot;</div><div class="gmail_default">mpres@mpFillOn                     = False</div><div class="gmail_default">mpres@mpOutlineOn                  = True</div><div class="gmail_default">mpres@mpCountyLineThicknessF       = 2.5</div><div class="gmail_default">mpres@mpGeophysicalLineThicknessF  = 2.5</div><div class="gmail_default">mpres@mpNationalLineThicknessF     = 2.5</div><div class="gmail_default">mpres@mpProvincialLineThicknessF   = 2.5</div><div class="gmail_default">mpres@mpUSStateLineThicknessF      = 2.5</div><div class="gmail_default">mpres@mpCountyLineColor            = &quot;Black&quot;</div><div class="gmail_default">mpres@mpGeophysicalLineColor       = &quot;Black&quot;</div><div class="gmail_default">mpres@mpNationalLineColor          = &quot;Black&quot;</div><div class="gmail_default">mpres@mpUSStateLineColor           = &quot;Black&quot;</div><div class="gmail_default"><br></div><div class="gmail_default">are also set by &quot;wrf_map_resources&quot;, but since you are using different values than what wrf_map_resources uses, I recommend leaving these alone. Just make sure you set all these resources *after* you call wrf_map_resources.  You can always do a &quot;print(mpres)&quot; after you call wrf_map_resources to see exactly what values it is setting for you.</div><div class="gmail_default"><br></div></div><div class="gmail_default" style="font-size:small">As for the &quot;ash&quot; array you are trying to plot: please look at your latN and lonN arrays to make sure they look correct, and that they in &quot;degrees&quot;  units. That is, the lat values should range from -90 to 90, and the longitude values from -180 to 180 or 0 to 360:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">  printMinMax(latN,0)</div><div class="gmail_default" style="font-size:small">  printMinMax(lonN,0)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You have the sfXArray and sfYArray arrays set correctly, but you do NOT want to set this:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">cnres@sfDataArray           = ash  </span></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You also do not need this, because the gsn_csm_contour function will set it for you:</div><div class="gmail_default"><br><span style="font-size:12.8px">cnres@sfMissingValueV       = ash@_FillValue</span><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I&#39;m not sure if this is a typo:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">ash_contour = gsn_csm_contour(wks,ashNN,</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">cnres)</span><br style="font-size:12.8px"></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">but shouldn&#39;t &quot;asnNN&quot; be &quot;ash&quot;?</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default"><span style="font-size:12.8px">Finally, you want to be sure that &quot;ash&quot; doesn&#39;t already have some kind of coordinate arrays attached to it.</span></div><div class="gmail_default"><span style="font-size:12.8px"><br></span></div><div class="gmail_default"><span style="font-size:12.8px">If you continue to have problems, it would really help if we could get the latest version of your script and your data, or, if you can&#39;t provide the data, then insert a bunch of &quot;printVarSummary&quot; and &quot;printMinMax&quot; statements so we can see what your data looks like:</span></div><div class="gmail_default"><span style="font-size:12.8px"><br></span></div><div class="gmail_default"><span style="font-size:12.8px">printVarSummary(ash)</span></div><div class="gmail_default"><span style="font-size:12.8px">printVarSummary(latN)</span></div><div class="gmail_default"><span style="font-size:12.8px">printVarSummary(lonN)</span></div><div class="gmail_default"><div class="gmail_default"><span style="font-size:12.8px">printMinMax(ash,0)</span></div><div class="gmail_default"><span style="font-size:12.8px">printMinMax</span><span style="font-size:12.8px">(latN</span><span style="font-size:12.8px">,0</span><span style="font-size:12.8px">)</span></div><div class="gmail_default"><span style="font-size:12.8px">printMinMax</span><span style="font-size:12.8px">(lonN</span><span style="font-size:12.8px">,0</span><span style="font-size:12.8px">)</span></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 8, 2016 at 9:57 AM, Genito Amos Maure <span dir="ltr">&lt;<a href="mailto:genito.maure@uem.mz" target="_blank">genito.maure@uem.mz</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Sean.<br>
Is that &quot;i&quot; before the zero in the expression<br>
<span class=""> lat = b-&gt;XLAT(i0,:,:) ;Not a nested domain<br>
</span>a typo?<br>
<br>
<br>
<br>
On Thu, 8 Sep 2016 07:48:52 -0800, Sean Egan wrote<br>
<div><div class="h5">&gt; Hi,<br>
&gt;<br>
&gt; I have an HDF file that contains volcanic ash column densities in a 900x3712<br>
array. Most of the elements are fill values. In addition, there are two arrays<br>
of latitudes and longitudes, both 900x3712.<br>
&gt;<br>
&gt; I am trying to use gsn_contour or gsn_csm_contour to plot the ash<br>
concentrations over a WRF model domain. Currently, I&#39;m unable to get NCL to<br>
reference the ash array with the latitude and longitude arrays. I have posted<br>
my script below and can upload the HDF file if needed.<br>
&gt;<br>
&gt; Any tips as to why I cannot get NCL to reference the lat and lon arrays<br>
correctly would be greatly appreciated. I believe it may have something to do<br>
with the sfXArray and sfYArray resources....<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Sean<br>
&gt;<br>
&gt; Script Start<br>
&gt;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl&quot;<br>
&gt;<br>
&gt; begin<br>
&gt;<br>
&gt; a = addfile(&quot;file1.hdf&quot;,&quot;r&quot;)<br>
&gt; b = addfile(&quot;wrfout_d01_2010-04-<wbr>16_00:00:00&quot;,&quot;r&quot;)<br>
&gt; wks=gsn_open_wks(&quot;x11&quot;,&quot;<wbr>testing&quot;)<br>
&gt;<br>
&gt; latS = a-&gt;pixel_latitude<br>
&gt; latN = latS * 0.002746665852839747<br>
&gt; lonS = a-&gt;pixel_longitude<br>
&gt; lonN = lonS * 0.005493331705679495<br>
&gt; ash  = a-&gt;volcld_ret_14_15_16_ash_<wbr>mass_loading<br>
&gt;<br>
&gt; lat = b-&gt;XLAT(i0,:,:) ;Not a nested domain<br>
&gt; lon = b-&gt;XLONG(0,:,:)<br>
&gt; dims = dimsizes(lat)<br>
&gt; nlat = dims(0)<br>
&gt; nlon = dims(1)<br>
&gt;<br>
&gt; gsn_define_colormap(wks,&quot;<wbr>WhBlGrYeRe&quot;)<br>
&gt; res                         = True<br>
&gt; res@gsnMaximize             = False<br>
&gt; res@gsnDraw                 = False        ; Turn off for now.<br>
&gt; res@gsnFrame                = False        ; Will draw later<br>
&gt; res@tiMainOn                = False<br>
&gt;<br>
&gt; mpres                         <wbr>     = res<br>
&gt; mpres@mpProjection            <wbr>     = &quot;LambertConformal&quot;<br>
&gt; mpres@mpLimitMode             <wbr>     = &quot;Corners&quot;<br>
&gt; mpres@mpLeftCornerLatF        <wbr>     = lat(0,0)<br>
&gt; mpres@mpLeftCornerLonF        <wbr>     = lon(0,0)<br>
&gt; mpres@mpRightCornerLatF       <wbr>     = lat(nlat-1,nlon-1)<br>
&gt; mpres@mpRightCornerLonF       <wbr>     = lon(nlat-1,nlon-1)<br>
&gt; mpres@mpLambertParallel1F     <wbr>     = b@TRUELAT1<br>
&gt; mpres@mpLambertParallel2F     <wbr>     = b@TRUELAT2<br>
&gt; mpres@mpLambertMeridianF      <wbr>     = b@STAND_LON<br>
&gt; mpres@mpDataBaseVersion       <wbr>     = &quot;MediumRes&quot;<br>
&gt; mpres@mpOutlineBoundarySets   <wbr>     = &quot;GeophysicalAndUSStates&quot;<br>
&gt; mpres@mpFillOn                <wbr>     = False<br>
&gt; mpres@mpOutlineOn             <wbr>     = True<br>
&gt; mpres@mpCountyLineThicknessF  <wbr>     = 2.5<br>
&gt; mpres@<wbr>mpGeophysicalLineThicknessF  = 2.5<br>
&gt; mpres@mpNationalLineThicknessF<wbr>     = 2.5<br>
&gt; mpres@<wbr>mpProvincialLineThicknessF   = 2.5<br>
&gt; mpres@mpUSStateLineThicknessF <wbr>     = 2.5<br>
&gt; mpres@mpCountyLineColor       <wbr>     = &quot;Black&quot;<br>
&gt; mpres@mpGeophysicalLineColor  <wbr>     = &quot;Black&quot;<br>
&gt; mpres@mpNationalLineColor     <wbr>     = &quot;Black&quot;<br>
&gt; mpres@mpUSStateLineColor      <wbr>     = &quot;Black&quot;<br>
&gt;<br>
&gt; cnres                       = res<br>
&gt; cnres@tfDoNDCOverlay        = False ; Testing<br>
&gt; cnres@cnFillOn              = True<br>
&gt; cnres@lbLabelBarOn          = True<br>
&gt; cnres@cnLinesOn             = False<br>
&gt; cnres@lbOrientation         = &quot;Vertical&quot;<br>
&gt; cnres@sfDataArray           = ash <br>
&gt; cnres@sfXArray              = lonN<br>
&gt; cnres@sfYArray              = latN<br>
&gt; cnres@sfMissingValueV       = ash@_FillValue<br>
&gt; cnres@cnLevelSelectionMode  = &quot;ManualLevels&quot;<br>
&gt; cnres@cnFillMode            = &quot;RasterFill&quot;<br>
&gt; cnres@cnRasterSmoothingOn   = False<br>
&gt; cnres@cnFillOpacityF        = 0.75<br>
&gt; cnres@cnMinLevelValF        = 0.<br>
&gt; cnres@cnMaxLevelValF        = 2.0<br>
&gt; cnres@cnLevelSpacingF       = 0.05<br>
&gt;<br>
&gt; map         = gsn_csm_map(wks,mpres)<br>
&gt; ash_contour = gsn_csm_contour(wks,ashNN,<wbr>cnres)<br>
&gt;<br>
&gt; overlay(map,ash_contour)<br>
&gt; draw(map)<br>
&gt; frame(wks)<br>
&gt;<br>
&gt; end<br>
<br>
<br>
<br>
</div></div>______________________________<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>
</blockquote></div><br></div>