diff --git a/Packages/vcs/Lib/Canvas.py b/Packages/vcs/Lib/Canvas.py index a7d242f60f..58a4595a89 100644 --- a/Packages/vcs/Lib/Canvas.py +++ b/Packages/vcs/Lib/Canvas.py @@ -2727,11 +2727,11 @@ def __plot (self, arglist, keyargs): xs=arglist[0].getAxis(-1) ys=arglist[0].getAxis(-2) if xs.isLongitude() and ys.isLatitude() and isinstance(inGrid,cdms2.grid.TransientRectGrid): - arglist[1]=MV2.array(g.getMesh()) + arglist[1]=MV2.array(inGrid.getMesh()) if not 'wrap' in keyargs.keys(): keyargs['wrap']=[0.,360.] elif ys.isLongitude() and xs.isLatitude() and isinstance(inGrid,cdms2.grid.TransientRectGrid): - arglist[1]=MV2.array(g.getMesh()) + arglist[1]=MV2.array(inGrid.getMesh()) if not 'wrap' in keyargs.keys(): keyargs['wrap']=[360.,0.] else: diff --git a/testing/vcs/CMakeLists.txt b/testing/vcs/CMakeLists.txt index 0ea777aa9c..f64188d962 100644 --- a/testing/vcs/CMakeLists.txt +++ b/testing/vcs/CMakeLists.txt @@ -266,6 +266,11 @@ cdat_add_test(vcs_test_taylor_2_quads # These test actually plot things need sample data if (CDAT_DOWNLOAD_SAMPLE_DATA) + cdat_add_test(test_vcs_meshfill_regular_grid + "${PYTHON_EXECUTABLE}" + ${cdat_SOURCE_DIR}/testing/vcs/test_meshfill_regular_grid.py + "${BASELINE_DIR}/test_meshfill_regular_grid.png" + ) cdat_add_test(test_vcs_plot_unstructured_via_boxfill "${PYTHON_EXECUTABLE}" ${cdat_SOURCE_DIR}/testing/vcs/test_plot_unstructured_via_boxfill.py diff --git a/testing/vcs/test_meshfill_regular_grid.py b/testing/vcs/test_meshfill_regular_grid.py new file mode 100644 index 0000000000..d51764bb90 --- /dev/null +++ b/testing/vcs/test_meshfill_regular_grid.py @@ -0,0 +1,20 @@ +import vcs, cdms2, os, sys +src=sys.argv[1] +pth = os.path.join(os.path.dirname(__file__),"..") +sys.path.append(pth) +import checkimage +x=vcs.init() +x.drawlogooff() + +x.setbgoutputdimensions(1200,1091,units="pixels") +x = vcs.init() +f = cdms2.open(os.path.join(vcs.prefix, "sample_data", "clt.nc")) +s = f("clt") +x.meshfill(s,bg=1) +fnm = "test_meshfill_regular_grid.png" +x.png(fnm) + +print "fnm:",fnm +print "src:",src +ret = checkimage.check_result_image(fnm,src,checkimage.defaultThreshold) +sys.exit(ret)