<div dir="ltr">Alex,<div><br></div><div>Thanks for the help.  This did the trick. </div><div><br></div><div>Craig</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 9, 2015 at 11:44 AM, Alexander Schaefer <span dir="ltr">&lt;<a href="mailto:alexander.schaefer@mines.sdsmt.edu" target="_blank">alexander.schaefer@mines.sdsmt.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><div><div>Hi Craig,<br><br></div>I do a lot of specializing of my plots with my WRF data so I have strayed from using the wrf functions except getvar since it has a bunch of diagnostic variables.  When I do my map projection, which is also LambertConformal I set all of the following resources as such:<br><br></div>    lat = wrf_user_getvar(a,&quot;lat&quot;, it)<br></div>    lon = wrf_user_getvar(a,&quot;lat&quot;, it)<div><div><br>    pltres = True<br>    projres = res<br>    projres@mpProjection                            = &quot;LambertConformal&quot;<br>    projres@mpRightCornerLatF                 = lat(0,0)<br>    projres@mpRightCornerLonF                = lon(0,0)<br>    projres@mpLeftCornerLatF                   = lat(nlon-1,nlat-1)<br>    projres@mpLeftCornerLonF                  = lon(nlon-1,nlat-1)<br>    projres@mpLambertParallel1F               = a@TRUELAT1<br>    projres@mpLambertParallel2F               = a@TRUELAT2<br>    projres@mpLambertMeridianF               = a@STAND_LON<br>    projres@mpCenterLonF                         = a@CEN_LON<br>    projres@mpCenterLatF                          = a@CEN_LAT<br>    projres@mpLimitMode                           = &quot;Corners&quot;<br>    projres@pmTickMarkDisplayMode        = &quot;Always&quot;<br>    projres@mpDataBaseVersion                  = &quot;Ncarg4_1&quot;<br>    projres@mpDataSetName                      = &quot;Earth..4&quot;<br>    projres@mpOutlineBoundarySets            = &quot;AllBoundaries&quot; ; all boundaries<br>    projres@mpNationalLineThicknessF        =  1.0<br>    projres@mpGeophysicalLineThicknessF  =  1.0<br>    projres@mpUSStateLineThicknessF        =  2.0<br><br></div><div>I have altered the options so you should be able to just paste it into your script.  This is a piece that I copy into all of my map scripts.  <br><br></div><div>I will then usually do other resources such as contour or vector or streamlines and to keep the projection in mind instead of setting &quot;contres&quot;, contour resources equal to true, set it equal to projres and then continue adding resources.<br><br></div><div>Hope that helps.<br><br></div><div>-Alex<br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Apr 9, 2015 at 11:07 AM, Craig Tierney - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:craig.tierney@noaa.gov" target="_blank">craig.tierney@noaa.gov</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"><div dir="ltr">Hello,<div><br></div><div>I am trying to plot WRF data using NCL 6.1.2 without using the built-in WRF functions.  The reason I am doing this is because what I really want to do is plot streamlines, and when I had problems doing that I tried to simplify what I was doing first.</div><div><br></div><div>I found the examples page for plotting WRF using the gsn functions.  I started with the wrf_gsn_2.ncl example.  All I did was change the WRF input file to point to mine. The output looked like the map was CylindralEquidistant (the specified mapping) but the data are in LambertConformal, so the height field is not plotted as rectangular.  So you get the curved shape of my domain on the rectangular map where the lines of latitude are horizontal.   This isn&#39;t want I want, but the script seems to be doing what it should for my domain.</div><div><br></div><div>What I found strange is that when I looked at the output of wrf_map_resources, that it says the Projection is LambertConformal.</div><div><br></div><div>So I tried changing the mpProjection to LambertConformal.  When I did this I got something that looked more StereoGraphic.  The plot was centered at the north pole.</div><div><br></div><div>When I compare the output of wrf_map_resources between this script and my script that uses wrf_map_overlays, the contents are identical.</div><div><br></div><div>So how do I get NCL to plot my data using the GSN functions in the same projection as using wrf_map_overlays?</div><div><br></div><div>Here is the script that I ran:</div><div><br></div><div><div>;----------------------------------------------------------------------</div><div>; wrf_gsn_2.ncl</div><div>;----------------------------------------------------------------------</div><div>; Concepts illustrated:</div><div>;   - Using gsn_csm_contour_map to plot WRF-ARW data</div><div>;----------------------------------------------------------------------</div><div>; This example is similar to wrf_gsn_1.ncl, except more plot resources</div><div>; are set to:</div><div>;   - explicitly set the contour levels</div><div>;   - change the look of the map outlines</div><div>;   - change the color map</div><div>;   - make the labelbar vertical</div><div>;----------------------------------------------------------------------;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;</div><div><br></div><div>begin</div><div>;---Open WRF output file.</div><div>  dir      = &quot;/scratch2/portfolios/BMC/winds/Craig.Tierney/theia/wrf/windswrf/trunk/conusplus-wrf-6day/201308010000/nowfp-nocu/wrf/&quot;</div><div>  filename = &quot;wrfout_d01_2013-08-04_00:00:00&quot;</div><div>  a = addfile(dir + filename + &quot;.nc&quot;,&quot;r&quot;)</div><div><br></div><div>;---Read terrain height and lat/lon off file.</div><div>  it        = 0     ; first time step</div><div>  hgt       = wrf_user_getvar(a,&quot;HGT&quot;,it)    ; Terrain elevation</div><div>  hgt@lat2d = wrf_user_getvar(a,&quot;XLAT&quot;,it)   ; latitude/longitude</div><div>  hgt@lon2d = wrf_user_getvar(a,&quot;XLONG&quot;,it)  ; required for plotting</div><div><br></div><div>  wks = gsn_open_wks(&quot;png&quot;,&quot;wrf_gsn&quot;)</div><div><br></div><div>;---Set some basic plot options</div><div>  res               = True</div><div><br></div><div>  res@gsnMaximize   = True   ; maximize plot in frame</div><div><br></div><div>  res@tiMainString  = filename</div><div><br></div><div>  res@cnFillOn      = True</div><div>  res@cnFillPalette = &quot;OceanLakeLandSnow&quot;</div><div>  res@cnLinesOn     = False</div><div><br></div><div> res@mpProjection = &quot;CylindricalEquidistant&quot;</div><div>;  res@mpProjection  = &quot;LambertConformal&quot; </div><div><br></div><div>;---Zoom in on plot</div><div>  res@mpMinLatF     = min(hgt@lat2d)</div><div>  res@mpMaxLatF     = max(hgt@lat2d)</div><div>  res@mpMinLonF     = min(hgt@lon2d)</div><div>  res@mpMaxLonF     = max(hgt@lon2d)</div><div><br></div><div>;---Additional resources desired</div><div>  res@pmTickMarkDisplayMode = &quot;Always&quot;   ; nicer tickmarks</div><div><br></div><div>  res@mpDataBaseVersion     = &quot;MediumRes&quot;       ; better and more map outlines</div><div>  res@mpDataSetName         = &quot;Earth..4&quot;</div><div>  res@mpOutlineBoundarySets = &quot;AllBoundaries&quot;</div><div>  res@mpOutlineOn           = True</div><div><br></div><div>  res@lbOrientation         = &quot;Vertical&quot;</div><div>  res@tiMainOffsetYF        = -0.03           ; Move the title down</div><div><br></div><div>;---Change contour levels to better match the color map being used</div><div>  res@cnLevelSelectionMode = &quot;ExplicitLevels&quot;</div><div>  res@cnLevels = (/2,100,200,400,600,800,1000,1200,1400,1600,1800,2000,2200/)</div><div><br></div><div><br></div><div>  contour = gsn_csm_contour_map(wks,hgt,res)</div><div><br></div><div>;</div><div>; This is for debugging purposes only. It shows what map resources the</div><div>; wrf_map_overlays routine would have use, if you had called that routine</div><div>; to do the plotting. This can be useful if you are trying to reproduce</div><div>; an original WRF-ARW plot.</div><div>;</div><div>  dbgres = True</div><div>  dbgres = wrf_map_resources(a,dbgres)</div><div>  print(dbgres)</div><div>end</div></div><span><font color="#888888"><div><br></div><div>Craig</div><div><br></div></font></span></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>