Skip to content

Commit

Permalink
Added test for vector plots using Robinson projection
Browse files Browse the repository at this point in the history
  • Loading branch information
aashish24 committed Sep 24, 2015
1 parent df7ef7b commit a0aecd6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions testing/vcs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
24 changes: 24 additions & 0 deletions testing/vcs/test_vcs_vectors_robinson.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit a0aecd6

Please sign in to comment.