<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Andrew,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Whenever you have data in native projection, which is data that has already been projected into a particular area on a map, AND you have set tfDoNDCOverlay to True, you have to be careful about zooming in on it. The "res@tfDoNDCOverlay = True", tells NCL that the data has already been projected, so assumes that you've already done the work of setting the map projection parameters.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">This works for the original data, of course. However, when you zoom in on the map, you also have to zoom in on the data itself, because NCL has no way of knowing how to correctly subset your data in order to have it line up with your new map projection parameters.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">There are two things you can do to get the zoom to be correct:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">1) If you want to stay in the native map projection that's defined on the file, you will need to subset your data to match the area of interest. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">2) If you don't care about staying in the native map projection, then you can read the 2D lat/lon arrays off the file and pass these to the plotting procedure so NCL will know how to correctly zoom in on your data.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Please see the "dataonmap_zoom_10.ncl" example that I just added to the "Plotting data on a map" page, which shows both methods:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml#ex10zoom">http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml#ex10zoom<br></a></div><div class="gmail_default"><br></div><div class="gmail_default">You can compare this to the example above it, which plots the original data:</div><div class="gmail_default"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml#ex10">http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml#ex10<br></a></div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 13, 2017 at 2:16 PM, Andrew Schwartz <span dir="ltr"><<a href="mailto:aschwa@ucar.edu" target="_blank">aschwa@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am working on zooming in on Texas/ New Mexico for a case study
that I'm performing with the WRF. I have the actual map zoomed in to the
region that I want, but the plotting of the qnifa variable doesn't
scale and stays as if the map projected is that of the CONUS. Can anyone
tell me what I'm doing wrong? I have attached two plots to illustrate the issue. The plot of the CONUS is correct in its placement and areas of qnifa, the zoomed plot is not.<br><br>Thanks in advance for the help!<br><br>-Andrew<br><br>load "$CSM/gsn_code.ncl"<br>load "$CSM/gsn_csm.ncl"<br>load "$CSM/contributed.ncl"<br><br>begin<br> res = True<br> res@cnLinesOn = False<br> res@cnFillOn = True ; color plot desired<br> res@cnLineLabelsOn = False ; turn off contour lines<br> res@cnInfoLabelOn = False ; turn off cn info label<br><br> res@mpGeophysicalLineColor= "black" ; color of continental outlines<br> res@mpPerimOn = True ; draw box around map<br> res@mpPerimDrawOrder = "PostDraw"<br> res@mpGridLineDashPattern = 2 ; lat/lon lines as dashed<br> res@mpOutlineBoundarySets = "GeophysicalAndUSStates"<br> res@mpUSStateLineColor = "black"<br><br> cmap = read_colormap_file("CBR_drywet<wbr>")<br><br> ff = addfile("<a href="http://wrfout.nc" target="_blank">wrfout.nc</a>","r")<br> if (ff@MAP_PROJ .eq. 1) then<br> res@mpProjection = "LambertConformal"<br> end if<br> res@mpLambertMeridianF = ff@CEN_LON<br> res@mpLambertParallel1F = ff@TRUELAT1<br> res@mpLambertParallel2F = ff@TRUELAT2<br> res@gsnAddCyclic = False<br> res@tfDoNDCOverlay = True<br> res@mpLimitMode = "Corners"<br> xlats = ff->XLAT<br> xlons = ff->XLONG<br> ijdim = dimsizes(xlats)<br> imax = ijdim(1)<br> jmax = ijdim(2)<br> res@mpLeftCornerLatF = 37<br> res@mpLeftCornerLonF = -110<br> res@mpRightCornerLatF = 28<br> res@mpRightCornerLonF = -96<br> res@mpFillOn <wbr> = True<br><br> res@cnLevelSelectionMode = "ExplicitLevels"<br> res@cnLevels = (/4E6,8E6,16E6,32E6,64E6/)<br> res@cnFillColors = (/7,6,5,4,3,2/)<br> res@cnMissingValFillColor = 13<br><br> hgt = ff->QNIFA(0,0,:,:)<br><br>
res@tiMainString = "Ice-Friendly Aerosol Concentration at Lowest Model
Level ~C~ W/ IC_BC and -30% SMOIS 19:00Z February 24, 2007"<br> res@tiMainFontHeightF = 0.015<br> res@gsnRightString = " "<br> res@gsnLeftString = " "<br> res@gsnMaximize = True<br> res@gsnFrame = False ; Don't advance the frame<br><br> wks = gsn_open_wks("png","qnifa_plot<wbr>")<br> gsn_define_colormap(wks, "CBR_drywet")<br><br> map = gsn_csm_contour_map(wks,hgt,re<wbr>s)<br><br> frame(wks)<br><br>end</div>
<br>______________________________<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>
<br></blockquote></div><br></div>