From ce1fbfb832d633af9f61f607c6bfa344968dcaff Mon Sep 17 00:00:00 2001 From: Charles Doutriaux Date: Mon, 27 Apr 2015 11:31:59 -0700 Subject: [PATCH 1/4] was an easy fix add to let update know to use CellData rather than PointData code was in place but was returning False rather than True in this instance fix #1234 still need to add tests --- Packages/vcs/Lib/VTKPlots.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/vcs/Lib/VTKPlots.py b/Packages/vcs/Lib/VTKPlots.py index 4634025050..3e6db361f4 100644 --- a/Packages/vcs/Lib/VTKPlots.py +++ b/Packages/vcs/Lib/VTKPlots.py @@ -1153,7 +1153,7 @@ def plot2D(self,data1,data2,tmpl,gm,vtk_backend_grid=None,vtk_backend_geo=None): else: lmx= levs[-1] mapper.SetScalarRange(lmn,lmx) - returned["vtk_backend_luts"]=[[lut,[lmn,lmx,False]],] + returned["vtk_backend_luts"]=[[lut,[lmn,lmx,True]],] if missingMapper is not None: if isinstance(gm,meshfill.Gfm): From 94e78a49429a0a51de986203cb5bf54560291561 Mon Sep 17 00:00:00 2001 From: Charles Doutriaux Date: Mon, 27 Apr 2015 12:48:05 -0700 Subject: [PATCH 2/4] was an easy fix add to let update know to use CellData rather than PointData code was in place but was returning False rather than True in this instance fix #1234 still need to add tests --- testing/vcs/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testing/vcs/CMakeLists.txt b/testing/vcs/CMakeLists.txt index 10bf1cfb7e..ad658d808c 100644 --- a/testing/vcs/CMakeLists.txt +++ b/testing/vcs/CMakeLists.txt @@ -581,6 +581,11 @@ cdat_add_test(vcs_test_taylor_2_quads ${BASELINE_DIR}/test_vcs_issue_960_labels_1.png ${BASELINE_DIR}/test_vcs_issue_960_labels_2.png ) + cdat_add_test(vcs_test_animate_boxfill + "${PYTHON_EXECUTABLE}" + ${cdat_SOURCE_DIR}/testing/vcs/test_animate_boxfill.py + ${BASELINE_DIR} + ) cdat_add_test(vcs_test_animate_isoline "${PYTHON_EXECUTABLE}" ${cdat_SOURCE_DIR}/testing/vcs/test_animate_isoline.py From 98fa86528d98933dd5491b668cddc0e4984b5ec1 Mon Sep 17 00:00:00 2001 From: Charles Doutriaux Date: Mon, 27 Apr 2015 13:01:30 -0700 Subject: [PATCH 3/4] test files --- testing/vcs/test_animate_boxfill.py | 33 +++++++++++++++++++++++++++++ testing/vcs/test_animate_isofill.py | 33 +++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 testing/vcs/test_animate_boxfill.py create mode 100644 testing/vcs/test_animate_isofill.py diff --git a/testing/vcs/test_animate_boxfill.py b/testing/vcs/test_animate_boxfill.py new file mode 100644 index 0000000000..0a0d904da5 --- /dev/null +++ b/testing/vcs/test_animate_boxfill.py @@ -0,0 +1,33 @@ +import vcs +import cdms2 +import os +import sys +import time +pth = os.path.join(os.path.dirname(__file__),"..") +sys.path.append(pth) +import checkimage + +f=cdms2.open(os.path.join(vcs.prefix,"sample_data","clt.nc")) +s=f("clt",slice(0,12)) # read only 12 times steps to speed up things + +x=vcs.init() +x.drawlogooff() +x.setbgoutputdimensions(1200,1091,units="pixels") + +gm=x.createboxfill() +x.plot(s,gm,bg=1) +x.animate.create() +print "Saving now" +prefix= os.path.split(__file__)[1][:-3] +x.animate.save("%s.mp4"%prefix) +pngs = x.animate.close(preserve_pngs = True) # so we can look at them again +src_pth = sys.argv[1] +pth = os.path.join(src_pth,prefix) +ret = 0 +for p in pngs: + print "Checking:",p + ret += checkimage.check_result_image(p,os.path.join(pth,os.path.split(p)[1]),checkimage.defaultThreshold) +if ret == 0: + os.removedirs(os.path.split(p)[0]) + os.remove("%s.mp4" % prefix) +sys.exit(ret) diff --git a/testing/vcs/test_animate_isofill.py b/testing/vcs/test_animate_isofill.py new file mode 100644 index 0000000000..eed836bebd --- /dev/null +++ b/testing/vcs/test_animate_isofill.py @@ -0,0 +1,33 @@ +import vcs +import cdms2 +import os +import sys +import time +pth = os.path.join(os.path.dirname(__file__),"..") +sys.path.append(pth) +import checkimage + +f=cdms2.open(os.path.join(vcs.prefix,"sample_data","clt.nc")) +s=f("clt",slice(0,12)) # read only 12 times steps to speed up things + +x=vcs.init() +x.drawlogooff() +x.setbgoutputdimensions(1200,1091,units="pixels") + +gm=x.createisofill() +x.plot(s,gm,bg=1) +x.animate.create() +print "Saving now" +prefix= os.path.split(__file__)[1][:-3] +x.animate.save("%s.mp4"%prefix) +pngs = x.animate.close(preserve_pngs = True) # so we can look at them again +src_pth = sys.argv[1] +pth = os.path.join(src_pth,prefix) +ret = 0 +for p in pngs: + print "Checking:",p + ret += checkimage.check_result_image(p,os.path.join(pth,os.path.split(p)[1]),checkimage.defaultThreshold) +if ret == 0: + os.removedirs(os.path.split(p)[0]) + os.remove("%s.mp4" % prefix) +sys.exit(ret) From 7230aecad1f0d0fff3b7fa5031fdab229fb7a17c Mon Sep 17 00:00:00 2001 From: Charles Doutriaux Date: Mon, 27 Apr 2015 13:03:31 -0700 Subject: [PATCH 4/4] adding test_animate_isofill to cmakelist --- testing/vcs/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testing/vcs/CMakeLists.txt b/testing/vcs/CMakeLists.txt index ad658d808c..bf9f9af7e7 100644 --- a/testing/vcs/CMakeLists.txt +++ b/testing/vcs/CMakeLists.txt @@ -581,6 +581,11 @@ cdat_add_test(vcs_test_taylor_2_quads ${BASELINE_DIR}/test_vcs_issue_960_labels_1.png ${BASELINE_DIR}/test_vcs_issue_960_labels_2.png ) + cdat_add_test(vcs_test_animate_isofill + "${PYTHON_EXECUTABLE}" + ${cdat_SOURCE_DIR}/testing/vcs/test_animate_isofill.py + ${BASELINE_DIR} + ) cdat_add_test(vcs_test_animate_boxfill "${PYTHON_EXECUTABLE}" ${cdat_SOURCE_DIR}/testing/vcs/test_animate_boxfill.py