Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 1234 boxfill anim broken #1236

Merged
merged 4 commits into from
Apr 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Packages/vcs/Lib/VTKPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]],]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These map entries really need some documentation. I have no idea what this change should do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but aren't we changing all of this anyway once we refactor?


if missingMapper is not None:
if isinstance(gm,meshfill.Gfm):
Expand Down
10 changes: 10 additions & 0 deletions testing/vcs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,16 @@ 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
${BASELINE_DIR}
)
cdat_add_test(vcs_test_animate_isoline
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_animate_isoline.py
Expand Down
33 changes: 33 additions & 0 deletions testing/vcs/test_animate_boxfill.py
Original file line number Diff line number Diff line change
@@ -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)
33 changes: 33 additions & 0 deletions testing/vcs/test_animate_isofill.py
Original file line number Diff line number Diff line change
@@ -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)