[pyngl-talk] mapping regional data with mpLimitMode corners

Fearon, Dr. Matthew, Contractor, Code 7533 matthew.fearon.ctr at nrlmry.navy.mil
Wed Jun 20 14:14:18 MDT 2018


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.

Thank you,

    cnres.sfXArray                   = lon
    cnres.sfYArray                   = lat

    mpres.mpFillOn                   = True
    mpres.mpLandFillColor            = "Tan1"
    mpres.mpOceanFillColor           = "SkyBlue"
    mpres.mpInlandWaterFillColor     = "SkyBlue"
    mpres.mpGeophysicalLineThicknessF= 2.5
    mpres.mpLimitMode                = "Corners"  #"LatLon"

    mpres.mpProjection                = "Stereographic"
    mpres.mpLeftCornerLatF            = lat[0,0]
    mpres.mpLeftCornerLonF            = lon[0,0]
    mpres.mpRightCornerLatF           = lat[ny-1,nx-1]
    mpres.mpRightCornerLonF           = lon[ny-1,nx-1]

#    mpres.mpCenterRotF                = -1
    mpres.mpRelativeCenterLon         = True
    mpres.mpCenterLonF                = 358.
    mpres.mpRelativeCenterLat         = True
    mpres.mpCenterLatF                = 80.
    mpres.tfDoNDCOverlay              = "DataTransform" #NDCViewport"

    mpres.mpGridLineThicknessF       = 0.5
    mpres.mpGridLineDashPattern      = 2
    mpres.mpGridSpacingF             = 1

    mpres.mpDataBaseVersion          = "MediumRes"
    map_plot                         = Ngl.map(wks,mpres)

    cnres.cnFillOn                   = True
    cnres.cnLinesOn                  = False
    cnres.cnLineLabelsOn             = False
    cmap                             = Ngl.read_colormap_file("MPL_PuOr")
    cnres.cnFillPalette              = cmap[::-1,:]
    cnres.cnLevelSelectionMode       = "ExplicitLevels"
    cnres.cnLevels                   = [-10,-8,-6,-4,-2,2,4,6,8,10]

    cnres.lbAutoManage               = False
    cnres.pmLabelBarWidthF           = 0.02
    cnres.lbLabelFontHeightF         = 0.009
    contour_plot                     = Ngl.contour(wks,cvar,cnres)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20180620/1bf7f9c2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: figure1.png
Type: image/png
Size: 236234 bytes
Desc: figure1.png
URL: <http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20180620/1bf7f9c2/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: figure2.png
Type: image/png
Size: 233915 bytes
Desc: figure2.png
URL: <http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20180620/1bf7f9c2/attachment-0003.png>

More information about the pyngl-talk mailing list