<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div class=""><div class=""><div><blockquote type="cite" class=""><div class="">On 14 Mar 2016, at 16:36, Kerwyn Texeira <<a href="mailto:ktish86@gmail.com" class="">ktish86@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class="">Hi Alan Brammer,<br class=""><br class=""></div><div class="">I appreciate your help in this matter!<br class=""></div><br class="">I still got a few errors:<br class=""><br class=""></div>1. When i use overlay, I get: warning:wkImageFileName is not a resource in the given object<br class="">warning:wkImageFormat is not a resource in the given object<br class="">warning:PlotManagerSetValues: TickMark annotation cannot be added after NhlCreate<br class="">warning:mpProjection is not a valid resource in test_contour at this time<br class="">warning:mpMinLonF is not a valid resource in test_contour at this time<br class="">warning:mpMaxLonF is not a valid resource in test_contour at this time<br class="">warning:mpMinLatF is not a valid resource in test_contour at this time<br class="">warning:mpMaxLatF is not a valid resource in test_contour at this time<br class="">warning:mpShapeMode is not a valid resource in test_contour at this time<br class="">warning:mpFillOn is not a valid resource in test_contour at this time<br class="">warning:mpOutlineOn is not a valid resource in test_contour at this time<br class="">warning:mpDataBaseVersion is not a valid resource in test_contour at this time<br class="">warning:cnLineOn is not a valid resource in test_contour at this time<br class="">(0) wrf_map_overlay: Warning: This procedure is obsolete. Consider<br class="">(0) using wrf_map_overlays instead.<br class="">warning:ContourPlotDraw: data boundary is out of range<br class=""><br class=""></div>2. I do not understand part of no.5 "you want to transfer the mp resources to a new variable and pass that to wrf_map() instead of True"<br class=""><br class=""></div>The revised script:<br class=""><br class="">;*************************************************<br class="">; overlay_1.ncl<br class="">;<br class="">; Concepts illustrated:<br class="">; - Overlaying line contours on filled contours<br class="">; - Explicitly setting contour levels<br class="">; - Selecting a different color map<br class="">;<br class="">;*************************************************<br class="">;<br class="">; These files are loaded by default in NCL V6.2.0 and newer<br class=""> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br class=""> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br class=""> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br class=""><br class="">begin<br class=""> a = addfile("./wrfout_d03_2014-01-11_21:00:<a href="http://00.nc/" class="">00.nc</a>","r")<br class=""> <br class=""> it = 0<br class=""> hgt = wrf_user_getvar(a, "HGT", it)<br class=""> hgt@lat2d = wrf_user_getvar(a, "XLAT", it)<br class=""> hgt@lon2d = wrf_user_getvar(a, "XLONG", it)<br class=""> u = wrf_user_getvar(a, "ua", it)<br class=""> v = wrf_user_getvar(a, "va", it)<br class=""> p = wrf_user_getvar(a, "pressure", it)<br class=""><br class=""> u_wind = wrf_user_intrp3d(u, p, "h", 650., 0.0, False)<br class=""> v_wind = wrf_user_intrp3d(v, p, "h", 650., 0.0, False)<br class=""> <br class=""><br class=""> spd = (u_wind*u_wind + v_wind*v_wind)^(0.5) ;m/s<br class=""> ; spd = spd*1.94384449<br class=""> ; spd@units = "Wind Speed"<br class=""> ; spd@units = "m/s"<br class=""> <br class=""> <br class=""><br class=""> wks = gsn_open_wks("png","test") ; send graphics to PNG file<br class=""> gsn_define_colormap(wks,"BlAqGrYeOrRe")<br class=""> <br class=""> <br class=""> res = True<br class=""> res@mpFillOn = False<br class=""> res@mpMaxLatF = 38.20 ; specify the plot domain<br class=""> res@mpMinLatF = 37.75 ; <br class=""> res@mpMinLonF = -120.00 ;<br class=""> res@mpMaxLonF = -119.10 ;<br class=""> res@mpOutlineOn = True ; turn the map outline on<br class=""> res@gsnDraw = False ; do not draw the plot<br class=""> res@gsnFrame = False ; do not advance the frame<br class="">; res@csnLinesOn = True<br class="">; res@tiMainString = a<br class=""><br class=""> res@mpProjection = "CylindricalEquidistant" ;The default<br class=""> res@pmTickMarkDisplayMode = "Always"<br class=""> res@mpDataBaseVersion = "MediumRes"<br class=""> res@mpOutlineOn =True<br class=""> res@lbOrientation = "Vertical"<br class=""> res@tiMainOffsetYF = -0.03<br class=""> res@mpShapeMode = "FreeAspect"<br class=""> res@vpWidthF = 0.9<br class=""> res@vpHeightF = 0.9<br class=""><br class="">; res@cnLevelSelectionMode = "ExplicitLevels" ; use explicit levels<br class="">; res@cnLevels = ispan(215,265,5) ; set the contour levels<br class=""> res@cnLineLabelsOn = False ; do not use line labels<br class=""> res@cnFillOn = True ; color fill<br class=""> res@cnLineOn = False ; do not draw contour lines<br class="">; res@cnFillPalette = "BlueDarkRed18"<br class=""><br class=""> res@gsnAddCyclic = False<br class=""><br class=""> map = wrf_map(wks, a, True)<br class=""><br class="">u_wind = u_wind*1.94384449<br class="">v_wind = v_wind*1.94384449<br class=""><br class=""> contour = gsn_csm_contour(wks,hgt,res) <br class=""> <br class=""> ;------wind vectors<br class=""> res2 = True<br class=""> res2@gsnDraw = True<br class=""> res2@gsnFrame = True<br class=""> res2@FieldTitle = "Winds"<br class=""> res2@NumVectors = 47<br class=""> res2@vcWindBarbLineThicknessF= 2.5<br class=""><br class="">vector = wrf_vector(a,wks,u_wind,v_wind,res2)<br class=""> wrf_map_overlay(wrf,map,(/contour,vector/),True)<br class="">;overlay(contour,vector)<br class=""><br class=""><br class=""> <br class="">end<br class=""> <br class=""> <br class=""><br class=""><br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Mar 14, 2016 at 9:04 AM, Alan Brammer <span dir="ltr" class=""><<a href="mailto:abrammer@albany.edu" target="_blank" class="">abrammer@albany.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><br class=""></div><div class="">Not sure where you’re getting those error messages from but there are many problems in the script. Here are the errors I got on running your code on my own file and the step by step to fix them. Make the below edits. If there are still problems send the whole new script to the list so we can see your edits. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class=""></div><blockquote type="cite" class=""><div class="">warning:attsetvalues: the value associated with (tiMainString) does not have an HLU representation</div><div class="">warning:csnLinesOn is not a valid resource in gsnapp_contour at this time</div><div class="">(0)<span style="white-space:pre-wrap" class="">        </span>gsn_csm_map_ce: Fatal: The resources mpMinLatF/mpLeftCornerLatF must be less than the resources mpMaxLatF/mpRightCornerF.</div><div class="">(0)<span style="white-space:pre-wrap" class="">        </span>Execution halted.</div></blockquote></div><div class=""><br class=""></div><div class="">;====</div><div class="">1.</div><div class="">so the top error:</div><div class=""><blockquote type="cite" class="">"warning:attsetvalues: the value associated with (tiMainString) does not have an HLU representation"</blockquote></div><div class=""><br class=""></div><div class="">Some thing is wrong with tiMainString. " res1@tiMainString = a “ a is a pointer to a file. NCL has no idea how to turn that into a string. </div><div class="">If you upgrade to 6.3.0 you could do the following.</div><div class="">res1@tiMainString = getfilepath(a) ;; needs 6.3.0!!!</div><div class="">or </div><div class="">res1@tiMainString = “Some string value for a title"</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">;====</div><div class="">2.</div><div class=""><blockquote type="cite" class="">warning:csnLinesOn is not a valid resource in gsnapp_contour at this time</blockquote></div><div class="">Self explanatory, csnLineOn isn’t a resource. This is a typo. Find that resource and fix it. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">;====</div><div class="">3.</div><div class=""><div class=""></div><blockquote type="cite" class=""><div class="">(0)<span style="white-space:pre-wrap" class="">        </span>gsn_csm_map_ce: Fatal: The resources mpMinLatF/mpLeftCornerLatF must be less than the resources mpMaxLatF/mpRightCornerF.</div><div class="">(0)<span style="white-space:pre-wrap" class="">        </span>Execution halted.</div></blockquote></div><div class="">Again, does what it says on the tin. minLat must be less than maxLat. Yours are not. Switch your min/max lat resources and you’ll be set. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">;====</div><div class="">4.</div><div class="">Once those are fixed, you’ll get the following error.</div><div class=""><div class=""></div><blockquote type="cite" class=""><div class="">(0)<span style="white-space:pre-wrap" class="">        </span>wrf_map_overlay: Warning: This procedure is obsolete. Consider</div><div class="">(0)<span style="white-space:pre-wrap" class="">        </span> using wrf_map_overlays instead.</div><div class="">fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member</div><div class="">warning:NhlRemoveOverlay: plot not found in overlay sequence</div></blockquote></div><div class=""><br class=""></div><div class="">You can’t overlay 2 maps on top of each other. wrf_map() and gsn_csm_contour_map() so just remove the _map part and make a plain contour plot. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">;====</div><div class="">5.</div><div class="">Lastly, you want to transfer the mp resources to a new variable and pass that to wrf_map() instead of True. </div><div class="">and change the order in the overlay function … map, (/contour, vector/)...</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On 13 Mar 2016, at 18:12, Kerwyn Texeira <<a href="mailto:ktish86@gmail.com" target="_blank" class="">ktish86@gmail.com</a>> wrote:</div><br class=""></div></div><div class=""><div class=""><div class="h5"><div dir="ltr" class=""><div class="">Hi All,<br class=""><br class="">For a month now I have been having trouble overlay windbards on zoomed terrain with specified lat and lon in ncl.<span class=""> I do not want the entire domain plotted with winds. If so, I would have used the multiOverlay.ncl script which works perfectly for many overlay for the entire domain. No images are being plotted with the script below. I'm not getting any fatal errors. I'm using NCL version 6.2.1. All I'm getting is the following; warning:wkImageFileName is not a resource in the given object<br class="">warning:wkImageFormat is not a resource in the given object.<br class=""><br class=""> </span>I would like some help with this script please.<span class=""> </span>I looked online for a script to help with this (overlay on zoomed in terrain with specified lat and lon) but I’m having trouble finding it.<span class="">
</span><span class="">
</span>Any advice will be greatly appreciated. Thanks, Kerwyn<br class=""><br class=""></div>Script:<br class=""><br class="">;*************************************************<br class="">; overlay_1.ncl<br class="">;<br class="">; Concepts illustrated:<br class="">; - Overlaying line contours on filled contours<br class="">; - Explicitly setting contour levels<br class="">; - Selecting a different color map<br class="">;<br class="">;*************************************************<br class="">;<br class="">; These files are loaded by default in NCL V6.2.0 and newer<br class=""> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br class=""> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br class=""> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br class=""><br class="">begin<br class=""> a = addfile("./wrfout_d03_2014-01-11_21:00:<a href="http://00.nc/" target="_blank" class="">00.nc</a>","r")<br class=""> <br class=""> it = 0<br class=""> hgt = wrf_user_getvar(a, "HGT", it)<br class=""> hgt@lat2d = wrf_user_getvar(a, "XLAT", it)<br class=""> hgt@lon2d = wrf_user_getvar(a, "XLONG", it)<br class=""> u = wrf_user_getvar(a, "ua", it)<br class=""> v = wrf_user_getvar(a, "va", it)<br class=""> p = wrf_user_getvar(a, "pressure", it)<br class=""><br class=""> u_wind = wrf_user_intrp3d(u, p, "h", 650., 0.0, False)<br class=""> v_wind = wrf_user_intrp3d(v, p, "h", 650., 0.0, False)<br class=""> <br class=""><br class="">; spd = (u_wind*u_wind + v_wind*v_wind)^(0.5) ;m/s<br class="">; spd@units = "Wind Speed"<br class="">; spd@units = "m/s"<br class=""><br class=""><br class=""> wks = gsn_open_wks("png","test") ; send graphics to PNG file<br class=""> gsn_define_colormap(wks,"BlAqGrYeOrRe")<br class=""> <br class=""> <br class=""> res1 = True<br class=""> res1@mpFillOn = False<br class=""> res1@mpMaxLatF = 37.75 ; specify the plot domain<br class=""> res1@mpMinLatF = 38.20 ; <br class=""> res1@mpMinLonF = -120.00 ;<br class=""> res1@mpMaxLonF = -119.10 ;<br class=""> res1@mpOutlineOn = True ; turn the map outline on<br class=""> res1@gsnDraw = False ; do not draw the plot<br class=""> res1@gsnFrame = False ; do not advance the frame<br class=""> res1@csnLinesOn = True<br class=""> res1@tiMainString = a<br class=""><br class=""> res1@mpProjection = "CylindricalEquidistant" ;The default<br class=""> res1@pmTickMarkDisplayMode = "Always"<br class=""> res1@mpDataBaseVersion = "MediumRes"<br class=""> res1@mpOutlineOn =True<br class=""> res1@lbOrientation = "Vertical"<br class=""> res1@tiMainOffsetYF = -0.03<br class=""> res1@mpShapeMode = "FreeAspect"<br class=""> res1@vpWidthF = 0.9<br class=""> res1@vpHeightF = 0.9<br class=""><br class="">; res@cnLevelSelectionMode = "ExplicitLevels" ; use explicit levels<br class="">; res@cnLevels = ispan(215,265,5) ; set the contour levels<br class=""> res1@cnLineLabelsOn = False ; do not use line labels<br class=""> res1@cnFillOn = True ; color fill<br class=""> res1@cnLinesOn = False ; do not draw contour lines<br class="">; res@cnFillPalette = "BlueDarkRed18"<br class=""><br class=""> res1@gsnAddCyclic = False<br class=""><br class=""> map = wrf_map(wks, a, True)<br class=""><br class=""> contour = gsn_csm_contour_map(wks,hgt,res1) <br class=""> <br class=""> ;------wind vectors<br class=""> res2 = True<br class=""> res2@FieldTitle = "Winds"<br class=""> res2@NumVectors = 47<br class=""> res2@vcWindBarbLineThicknessF= 2.5<br class=""> vector = wrf_vector(a, wks, u_wind, v_wind, res2)<br class=""><br class=""> wrf_map_overlay(wks,map,(/vector, contour/),True)<br class=""> <br class="">end<br class=""></div></div></div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" target="_blank" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class=""><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br class=""></div></blockquote></div><br class=""></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""></div></div></body></html>