1 pixel artifact when map masking contour plot

From: daryl herzmann <akrherz_at_nyahnyahspammersnyahnyah>
Date: Thu Sep 23 2010 - 16:23:59 MDT

Hi PyNGLers!

Attached you'll find an image that has a 1 pixel wide artifact at the
north and south end of grid that I attempt to mask by the map. This
situation seems to happen when the viewport shape does not match the map
shape (pardon the loose/incorrect terminology).

I've included below a reproducer for me based on the ngl05p example. I
know it looks ugly, just wanted something to demonstrate the problem :)

Am I doing something wrong, or is this a bug? I am using PyNGL 1.3.1 on
Linux x86_64, python 2.5, redhat 5.5

thanks!
   daryl

import numpy, os
import Nio

#
import Ngl
#
#
data_dir = Ngl.pynglpath("data")
cdf_file1 = Nio.open_file(os.path.join(data_dir,"cdf","941110_P.cdf"),"r")
cdf_file2 =
Nio.open_file(os.path.join(data_dir,"cdf","sstdata_netcdf.nc"),"r")
cdf_file3 = Nio.open_file(os.path.join(data_dir,"cdf","Pstorm.cdf"),"r")

psl = cdf_file1.variables["Psl"]

psl_lon = cdf_file1.variables["lon"][:]
psl_lat = cdf_file1.variables["lat"][:]
psl_nlon = len(psl_lon)
psl_nlat = len(psl_lat)

wks_type = "png"
wks = Ngl.open_wks(wks_type,"ngl05p")

resources = Ngl.Resources()

resources.cnFillOn = True

resources.nglMaximize = False
resources.vpWidthF = 0.8
resources.vpHeightF = 0.8
resources.nglPaperOrientation = "landscape"
resources.vpXF = 0.1
resources.vpYF = 0.9

resources.mpProjection = "LambertConformal"
resources.mpLambertParallel1F = 33.0
resources.mpLambertParallel2F = 45.0
resources.mpLambertMeridianF = -95.0
resources.mpLimitMode = "LatLon"
resources.mpMinLatF = 22.0
resources.mpMaxLatF = 52.0
resources.mpMinLonF = -119.0
resources.mpMaxLonF = -74.0
resources.pmTickMarkDisplayMode = "Never"
resources.mpPerimOn = False
resources.mpDataBaseVersion = "MediumRes"
resources.mpDataSetName = "Earth..2"
resources.mpGridAndLimbOn = False
resources.mpUSStateLineThicknessF = 1
resources.mpOutlineOn = True
resources.mpOutlineBoundarySets = "USStates"
resources.mpFillOn = True
resources.mpFillAreaSpecifiers = ["land","water"]
resources.mpFillBoundarySets = "NoBoundaries"
resources.mpSpecifiedFillColors = [0,0]
resources.mpAreaMaskingOn = True
resources.mpMaskAreaSpecifiers = ["Conterminous US",]
resources.cnFillDrawOrder = "Predraw"

resources.sfXCStartV = float(min(psl_lon))
resources.sfXCEndV = float(max(psl_lon))
resources.sfYCStartV = float(min(psl_lat))
resources.sfYCEndV = float(max(psl_lat))

map = Ngl.contour_map(wks,psl,resources)

del map
del resources

Ngl.end()

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

pyngl_example.png
Received on Thu Sep 23 16:24:05 2010

This archive was generated by hypermail 2.1.8 : Mon Oct 04 2010 - 09:57:00 MDT