<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 "wrf_map_resources" 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 = "LambertConformal"</div><div class="gmail_default" style="font-size:small">mpres@mpLimitMode = "Corners"</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 = "MediumRes"</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 = "GeophysicalAndUSStates"</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 = "Black"</div><div class="gmail_default">mpres@mpGeophysicalLineColor = "Black"</div><div class="gmail_default">mpres@mpNationalLineColor = "Black"</div><div class="gmail_default">mpres@mpUSStateLineColor = "Black"</div><div class="gmail_default"><br></div><div class="gmail_default">are also set by "wrf_map_resources", 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 "print(mpres)" 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 "ash" array you are trying to plot: please look at your latN and lonN arrays to make sure they look correct, and that they in "degrees" 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'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't "asnNN" be "ash"?</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 "ash" doesn'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't provide the data, then insert a bunch of "printVarSummary" and "printMinMax" 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"><<a href="mailto:genito.maure@uem.mz" target="_blank">genito.maure@uem.mz</a>></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 "i" before the zero in the expression<br>
<span class=""> lat = b->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">> Hi,<br>
><br>
> 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>
><br>
> I am trying to use gsn_contour or gsn_csm_contour to plot the ash<br>
concentrations over a WRF model domain. Currently, I'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>
><br>
> 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>
><br>
> Thanks,<br>
><br>
> Sean<br>
><br>
> Script Start<br>
><br>
> load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"<br>
> load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"<br>
> load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl"<br>
> load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"<br>
><br>
> begin<br>
><br>
> a = addfile("file1.hdf","r")<br>
> b = addfile("wrfout_d01_2010-04-<wbr>16_00:00:00","r")<br>
> wks=gsn_open_wks("x11","<wbr>testing")<br>
><br>
> latS = a->pixel_latitude<br>
> latN = latS * 0.002746665852839747<br>
> lonS = a->pixel_longitude<br>
> lonN = lonS * 0.005493331705679495<br>
> ash = a->volcld_ret_14_15_16_ash_<wbr>mass_loading<br>
><br>
> lat = b->XLAT(i0,:,:) ;Not a nested domain<br>
> lon = b->XLONG(0,:,:)<br>
> dims = dimsizes(lat)<br>
> nlat = dims(0)<br>
> nlon = dims(1)<br>
><br>
> gsn_define_colormap(wks,"<wbr>WhBlGrYeRe")<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 <wbr> = res<br>
> mpres@mpProjection <wbr> = "LambertConformal"<br>
> mpres@mpLimitMode <wbr> = "Corners"<br>
> mpres@mpLeftCornerLatF <wbr> = lat(0,0)<br>
> mpres@mpLeftCornerLonF <wbr> = lon(0,0)<br>
> mpres@mpRightCornerLatF <wbr> = lat(nlat-1,nlon-1)<br>
> mpres@mpRightCornerLonF <wbr> = lon(nlat-1,nlon-1)<br>
> mpres@mpLambertParallel1F <wbr> = b@TRUELAT1<br>
> mpres@mpLambertParallel2F <wbr> = b@TRUELAT2<br>
> mpres@mpLambertMeridianF <wbr> = b@STAND_LON<br>
> mpres@mpDataBaseVersion <wbr> = "MediumRes"<br>
> mpres@mpOutlineBoundarySets <wbr> = "GeophysicalAndUSStates"<br>
> mpres@mpFillOn <wbr> = False<br>
> mpres@mpOutlineOn <wbr> = True<br>
> mpres@mpCountyLineThicknessF <wbr> = 2.5<br>
> mpres@<wbr>mpGeophysicalLineThicknessF = 2.5<br>
> mpres@mpNationalLineThicknessF<wbr> = 2.5<br>
> mpres@<wbr>mpProvincialLineThicknessF = 2.5<br>
> mpres@mpUSStateLineThicknessF <wbr> = 2.5<br>
> mpres@mpCountyLineColor <wbr> = "Black"<br>
> mpres@mpGeophysicalLineColor <wbr> = "Black"<br>
> mpres@mpNationalLineColor <wbr> = "Black"<br>
> mpres@mpUSStateLineColor <wbr> = "Black"<br>
><br>
> cnres = res<br>
> cnres@tfDoNDCOverlay = False ; Testing<br>
> cnres@cnFillOn = True<br>
> cnres@lbLabelBarOn = True<br>
> cnres@cnLinesOn = False<br>
> cnres@lbOrientation = "Vertical"<br>
> cnres@sfDataArray = ash <br>
> cnres@sfXArray = lonN<br>
> cnres@sfYArray = latN<br>
> cnres@sfMissingValueV = ash@_FillValue<br>
> cnres@cnLevelSelectionMode = "ManualLevels"<br>
> cnres@cnFillMode = "RasterFill"<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,ashNN,<wbr>cnres)<br>
><br>
> overlay(map,ash_contour)<br>
> draw(map)<br>
> frame(wks)<br>
><br>
> 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>