-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1203 from UV-CDAT/isoline_anim_labeled_or_not_1199
Isoline anim labeled or not 1199
- Loading branch information
Showing
9 changed files
with
300 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
|
||
iso=x.createisoline() | ||
x.plot(s,iso,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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
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") | ||
|
||
iso=x.createisoline() | ||
levs = range(0,101,10) | ||
iso.level=levs | ||
# add dummy values to levs to get the correct number of cols | ||
cols=vcs.getcolors(levs+[56,]) | ||
print levs | ||
print cols | ||
iso.textcolors = cols | ||
iso.linecolors = cols | ||
x.plot(s,iso,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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
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") | ||
|
||
iso=x.createisoline() | ||
iso.label='y' | ||
x.plot(s,iso,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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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") | ||
|
||
iso=x.createisoline() | ||
iso.label='y' | ||
levs = range(0,101,10) | ||
iso.level=levs | ||
# add dummy values to levs to get the correct number of cols | ||
cols=vcs.getcolors(levs+[56,]) | ||
print levs | ||
print cols | ||
iso.textcolors = cols | ||
iso.linecolors = cols | ||
x.plot(s,iso,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) |
Oops, something went wrong.