From 5fed2d3342c4449fc09b144be9b490aa909f4d01 Mon Sep 17 00:00:00 2001 From: Aashish Chaudhary Date: Thu, 24 Sep 2015 00:30:20 -0400 Subject: [PATCH] Added test for vector plots using Robinson projection --- testing/vcs/CMakeLists.txt | 5 +++++ testing/vcs/test_vcs_vectors_robinson.py | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 testing/vcs/test_vcs_vectors_robinson.py diff --git a/testing/vcs/CMakeLists.txt b/testing/vcs/CMakeLists.txt index 06138ec9ea..d4eb3cdb72 100644 --- a/testing/vcs/CMakeLists.txt +++ b/testing/vcs/CMakeLists.txt @@ -702,6 +702,11 @@ cdat_add_test(vcs_test_taylor_2_quads ${cdat_SOURCE_DIR}/testing/vcs/test_vcs_patterns.py "${BASELINE_DIR}/test_vcs_patterns.png" ) + cdat_add_test(vcs_test_vectors_robinson + "${PYTHON_EXECUTABLE}" + ${cdat_SOURCE_DIR}/testing/vcs/test_vcs_vectors_robinson.py + "${BASELINE_DIR}/test_vcs_vectors_robinson.png" + ) endif() endif() diff --git a/testing/vcs/test_vcs_vectors_robinson.py b/testing/vcs/test_vcs_vectors_robinson.py new file mode 100644 index 0000000000..bf808dafca --- /dev/null +++ b/testing/vcs/test_vcs_vectors_robinson.py @@ -0,0 +1,24 @@ +import vcs, cdms2, numpy, os, sys +src = sys.argv[1] +pth = os.path.join(os.path.dirname(__file__),"..") +sys.path.append(pth) +import checkimage + +x = vcs.init() +x = vcs.init() +x.setantialiasing(0) +x.drawlogooff() +x.setbgoutputdimensions(1200, 1091, units="pixels") +f = cdms2.open(os.path.join(vcs.sample_data, "clt.nc")) +u = f("u") +v = f("v") +V = x.createvector() +p = x.createprojection() +p.type = "mercator" +V.projection = p +x.plot(u,v,V, bg=1) + +fnm= "test_vcs_vectors_robinson.png" +x.png(fnm) +ret = checkimage.check_result_image(fnm, src, checkimage.defaultThreshold) +sys.exit(ret)