<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Matt,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Sorry for the delay. I was creating a new NCL example to help explain things.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Plotting data in its native projection can be tricky, especially if you have a rotated pole or if you are not sure of the exact parameters for the map projection.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I think you already know this, but these resources are going to be critical to getting the map projection correct:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace"> mpres.mpProjection = "Stereographic"</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres.mpLeftCornerLatF = lat[0,0]</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres.mpLeftCornerLonF = lon[0,0]</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres.mpRightCornerLatF = lat[ny-1,nx-1]</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres.mpRightCornerLonF = lon[ny-1,nx-1]</font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"># mpres.mpCenterRotF = -1</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres.mpRelativeCenterLon = True</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres.mpCenterLonF = 358.</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres.mpRelativeCenterLat = True</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres.mpCenterLatF = 80.</font></div><div class="gmail_default"><br></div><div class="gmail_default">It's likely going to be the center lat/lon settings that are the issue, and not the four corners of your data, since the way you are setting the corners looks correct to me.</div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Did the data come from a file that had the map projection parameters defined? If so, could you include the output from an ncdump -h of that file so I can see if there's anything that might have been left out?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I don't know if you saw these examples, but they might help (even though they are NCL-based, the same principles apply):</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/native.shtml#ex1" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/native.shtml#ex1</a><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/native.shtml#ex6">http://www.ncl.ucar.edu/<wbr>Applications/native.shtml#ex6</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">Example native_6.ncl is the one I just created. This was an example where we didn't know the correct center longitude, so I had to create a do loop to try different ones out. I also drew the lat/lon lines associated with the data (since I had them), so I could see if they were straight or not. If the lines are straight, then this is a good sign that you have the correct map projection resources set.</div><div class="gmail_default"><br></div><div class="gmail_default">Since you have the lat/lon arrays, you can also add the grid for debugging purposes. You can use Ngl.add_polyline for this. I've attached an example of adding lat/lon grid lines using dummy data.</div><div class="gmail_default"><br></div><div class="gmail_default">Hope this helps,</div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 20, 2018 at 2:14 PM, Fearon, Dr. Matthew, Contractor, Code 7533 via pyngl-talk <span dir="ltr"><<a href="mailto:pyngl-talk@ucar.edu" target="_blank">pyngl-talk@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 lang="EN-US" link="blue" vlink="purple">
<div class="m_3029890798667166331WordSection1">
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m using the following Ngl resources to map regional raster data with a stereographic projection onto a basemap. Things work fairly well, except I am able to see edges of the underlying basemap. Please see figure one attached. When I include
mpCenterRotF= -1, the basemap edge visibility is reduced, but still partially shown along the NW and SE edges. Please see figure two. I would like the data overlay to fill the window fully. I’ve tried adjusting the lat corners by 0.5 to 1 degree, eg, mpRightCornerLatF
= lat[ny-1,nx-1]-0.5 and mpLeftCornerLatF = lat[0,0]+0.5, to figure two but doing so seems to reveal the underlying basemap more – perhaps because rotation of -1 is active after I contract my lat corners. Seems like this should be a simple fix, but here I
struggle. Perhaps I should be mapping regional data differently? Any help or suggestions would be greatly appreciated.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thank you,<u></u><u></u></p>
<p class="MsoNormal">Matt<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> cnres.sfXArray <wbr> = lon<u></u><u></u></p>
<p class="MsoNormal"> cnres.sfYArray <wbr> = lat<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> mpres.mpFillOn <wbr> = True<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpLandFillColor <wbr> = "Tan1"<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpOceanFillColor <wbr> = "SkyBlue"<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpInlandWaterFillColor <wbr> = "SkyBlue"<u></u><u></u></p>
<p class="MsoNormal"> mpres.<wbr>mpGeophysicalLineThicknessF= 2.5<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpLimitMode <wbr> = "Corners" #"LatLon"<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> mpres.mpProjection <wbr> = "Stereographic"<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpLeftCornerLatF <wbr> = lat[0,0]<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpLeftCornerLonF <wbr> = lon[0,0]<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpRightCornerLatF <wbr> = lat[ny-1,nx-1]<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpRightCornerLonF <wbr> = lon[ny-1,nx-1]<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"># mpres.mpCenterRotF <wbr> = -1<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpRelativeCenterLon <wbr> = True<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpCenterLonF <wbr> = 358.<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpRelativeCenterLat <wbr> = True<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpCenterLatF <wbr> = 80.<u></u><u></u></p>
<p class="MsoNormal"> mpres.tfDoNDCOverlay <wbr> = "DataTransform" #NDCViewport"<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> mpres.mpGridLineThicknessF <wbr> = 0.5<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpGridLineDashPattern <wbr> = 2<u></u><u></u></p>
<p class="MsoNormal"> mpres.mpGridSpacingF <wbr> = 1<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> mpres.mpDataBaseVersion <wbr> = "MediumRes"<u></u><u></u></p>
<p class="MsoNormal"> map_plot <wbr> = Ngl.map(wks,mpres)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> cnres.cnFillOn <wbr> = True<u></u><u></u></p>
<p class="MsoNormal"> cnres.cnLinesOn <wbr> = False<u></u><u></u></p>
<p class="MsoNormal"> cnres.cnLineLabelsOn <wbr> = False<u></u><u></u></p>
<p class="MsoNormal"> cmap <wbr> = Ngl.read_colormap_file("MPL_<wbr>PuOr")<u></u><u></u></p>
<p class="MsoNormal"> cnres.cnFillPalette <wbr> = cmap[::-1,:]<u></u><u></u></p>
<p class="MsoNormal"> cnres.cnLevelSelectionMode <wbr> = "ExplicitLevels"<u></u><u></u></p>
<p class="MsoNormal"> cnres.cnLevels <wbr> = [-10,-8,-6,-4,-2,2,4,6,8,10]<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> cnres.lbAutoManage <wbr> = False<u></u><u></u></p>
<p class="MsoNormal"> cnres.pmLabelBarWidthF <wbr> = 0.02<u></u><u></u></p>
<p class="MsoNormal"> cnres.lbLabelFontHeightF <wbr> = 0.009<u></u><u></u></p>
<p class="MsoNormal"> contour_plot <wbr> = Ngl.contour(wks,cvar,cnres)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> Ngl.overlay(map_plot,contour_<wbr>plot)<u></u><u></u></p>
</div>
</div>
<br>______________________________<wbr>_________________<br>
pyngl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/pyngl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/pyngl-talk</a><br>
<br></blockquote></div><br></div>