<div dir="ltr"><div><div><div><div><div><div><div>Hi Mary,<br><br></div>Thanks for the tips. Sorry about the typo - the NN shouldn&#39;t proceed the ash variable. I&#39;ve attached (and copy/pasted) the script as well as the variable summaries to this e-mail. If you would like to look at the HDF file, you can download it by connecting via FTP to <a href="http://emc2.iarc.uaf.edu">emc2.iarc.uaf.edu</a> with username set to anonymous. No password is required. The file is named file1.hdf. <br><br></div>Thanks,<br></div>Sean<br><br>---------------------------------<br></div>VARIABLE SUMMARIES<br>---------------------------------<br><br><span style="font-size:12.8px">ncl 61&gt; printVarSummary(ash)<br><br>Variable: ash<br>Type: float<br>Total Size: 13363200 bytes<br>            3340800 values<br>Number of Dimensions: 2<br>Dimensions and sizes:    [lines | 900] x [elements | 3712]<br>Coordinates: <br>Number Of Attributes: 10<br>  algorithm_name :    VOLCAT volcanic ash retrieval<br>  algorithm_version :    none<br>  algorithm_index :    10<br>  reference :    Pavolonis and Heidinger<br>  units :    none<br>  scaling_method :    0<br>  scale_factor :       1<br>  add_offset :       0<br>  _FillValue :    -999<br>  hdf_name :    volcld_ret_14_15_16_ash_mass_loading<br><br>ncl 62&gt; printVarSummary(latN)<br><br>Variable: latN<br>Type: float<br>Total Size: 13363200 bytes<br>            3340800 values<br>Number of Dimensions: 2<br>Dimensions and sizes:    [900] x [3712]<br>Coordinates: <br>Number Of Attributes: 1<br>  _FillValue :    -32768<br><br></span><br><span style="font-size:12.8px">ncl 63&gt; printVarSummary(lonN)<br><br>Variable: lonN<br>Type: float<br>Total Size: 13363200 bytes<br>            3340800 values<br>Number of Dimensions: 2<br>Dimensions and sizes:    [900] x [3712]<br>Coordinates: <br>Number Of Attributes: 1<br>  _FillValue :    -32768<br><br>---------------------------------<br></span></div><span style="font-size:12.8px">MAX AND MIN VALUES<br>---------------------------------<br><br>ncl 64&gt; printMinMax(ash,0)<br>(0)    min=0   max=4.58412<br><br><br>ncl 65&gt; printMinMax(latN,0)<br>(0)    min=27.5848   max=81.2629<br><br>ncl 66&gt; printMinMax(lonN,0)  <br>(0)    min=-79.6368   max=79.6368<br><br>---------------------------<br></span></div><span style="font-size:12.8px">START OF SCRIPT<br>---------------------------<br><br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br><br>a = addfile(&quot;file1.hdf&quot;,&quot;r&quot;)<br><br>wks=gsn_open_wks(&quot;x11&quot;,&quot;testing&quot;)<br><br>latS = a-&gt;pixel_latitude<br>latN = latS * 0.002746665852839747<br>lonS = a-&gt;pixel_longitude<br>lonN = lonS * 0.005493331705679495<br>ash  = a-&gt;volcld_ret_14_15_16_ash_mass_loading<br><br>b = addfile(&quot;wrfout_d01_2010-04-16_00:00:00&quot;,&quot;r&quot;)<br><br>gsn_define_colormap(wks,&quot;WhBlGrYeRe&quot;)<br>res                         = True<br>res@gsnMaximize             = False<br>res@gsnDraw                 = False        ; Turn off for now.<br>res@gsnFrame                = False        ; Will draw later<br>res@tiMainOn                = False<br><br>mpres                              = res<br>mpres                              = wrf_map_resources(b,mpres)<br>mpres@mpOutlineBoundarySets        = &quot;GeophysicalAndUSStates&quot;<br>mpres@mpFillOn                     = False<br>mpres@mpOutlineOn                  = True<br>mpres@mpCountyLineThicknessF       = 2.5<br>mpres@mpGeophysicalLineThicknessF  = 2.5<br>mpres@mpNationalLineThicknessF     = 2.5<br>mpres@mpProvincialLineThicknessF   = 2.5<br>mpres@mpUSStateLineThicknessF      = 2.5<br>mpres@mpCountyLineColor            = &quot;Black&quot;<br>mpres@mpGeophysicalLineColor       = &quot;Black&quot;<br>mpres@mpNationalLineColor          = &quot;Black&quot;<br>mpres@mpUSStateLineColor           = &quot;Black&quot;<br><br>cnres                       = res<br>cnres@tfDoNDCOverlay        = False ; Testing<br>cnres@cnFillOn              = True<br>cnres@lbLabelBarOn          = True<br>cnres@cnLinesOn             = False<br>cnres@lbOrientation         = &quot;Vertical&quot;<br>cnres@sfXArray              = lonN<br>cnres@sfYArray              = latN<br>cnres@cnLevelSelectionMode  = &quot;ManualLevels&quot;<br>cnres@cnFillMode            = &quot;RasterFill&quot;<br>cnres@cnRasterSmoothingOn   = False<br>cnres@cnFillOpacityF        = 0.75<br>cnres@cnMinLevelValF        = 0.<br>cnres@cnMaxLevelValF        = 2.0<br>cnres@cnLevelSpacingF       = 0.05<br><br>map         = gsn_csm_map(wks,mpres)<br>ash_contour = gsn_csm_contour(wks,ash,cnres)<br><br>overlay(map,ash_contour)<br>draw(map)<br>frame(wks)<br><br>end<br><br>-------------------------<br></span></div><span style="font-size:12.8px">SCRIPT ERRORS<br>-------------------------<br><br>pacman13 % ncl testing.ncl <br> Copyright (C) 1995-2013 - All Rights Reserved<br> University Corporation for Atmospheric Research<br> NCAR Command Language Version 6.1.2<br> The use of this software is governed by a License Agreement.<br> See <a href="http://www.ncl.ucar.edu/">http://www.ncl.ucar.edu/</a> for more details.<br>warning:mpNestTime is not a valid resource in map at this time<br>warning:start_lat is not a valid resource in map at this time<br>warning:start_lon is not a valid resource in map at this time<br>warning:end_lat is not a valid resource in map at this time<br>warning:end_lon is not a valid resource in map at this time<br><br><br></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 8, 2016 at 8:19 AM, Mary Haley <span dir="ltr">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt;</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 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"><span class=""><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></span><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"><span class=""><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@<wbr>mpGeophysicalLineThicknessF  = 2.5</div><div class="gmail_default">mpres@mpNationalLineThicknessF     = 2.5</div><div class="gmail_default">mpres@<wbr>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></span><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><span style="font-size:12.8px">cnre<wbr>s)</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"><div><div class="h5">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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Hi Sean.<br>
Is that &quot;i&quot; before the zero in the expression<br>
<span> 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>&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/nclscri<wbr>pts/csm/gsn_code.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_csm.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/wrf/WRFUserARW.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/contributed.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-16<wbr>_00:00:00&quot;,&quot;r&quot;)<br>
&gt; wks=gsn_open_wks(&quot;x11&quot;,&quot;testin<wbr>g&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_mas<wbr>s_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;WhBlG<wbr>rYeRe&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@mpGeophysicalLineThickne<wbr>ssF  = 2.5<br>
&gt; mpres@mpNationalLineThicknessF<wbr>     = 2.5<br>
&gt; mpres@mpProvincialLineThicknes<wbr>sF   = 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,cnre<wbr>s)<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></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font size="1">PO1 Sean D. Egan, US Navy<br></font><font size="1">PhD Candidate<br></font><font size="1">Geophysical Institute<br></font><div><font size="1">University of Alaska Fairbanks<br></font></div><div><font size="1">903 Koyukuk Drive<br>Fairbanks, AK 99775<br><a href="mailto:sdegan@alaska.edu" target="_blank">sdegan@alaska.edu</a> | 907 474-5483<br></font></div><font size="1">IARC Office 334 | <a href="http://www.gi.alaska.edu/~sdegan" target="_blank">www.gi.alaska.edu/~sdegan</a><br></font></div></div></div></div></div></div>
</div>