Skip to content

Commit 8087cd0

Browse files
committed
Merge pull request #1717 from UV-CDAT/continents-off-test
Add test for issue #1106: Continents are off.
2 parents b9dbb14 + 2d063a9 commit 8087cd0

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

testing/vcs/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ cdat_add_test(vcs_test_taylor_2_quads
291291
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_canvas_background_update.py
292292
"${BASELINE_DIR}/test_canvas_background_update.png"
293293
)
294+
cdat_add_test(vcs_test_boxfill_decreasing_latitude
295+
"${PYTHON_EXECUTABLE}"
296+
${cdat_SOURCE_DIR}/testing/vcs/test_boxfill_decreasing_latitude.py
297+
"${BASELINE_DIR}/test_vcs_boxfill_decreasing_latitude.png"
298+
"${UVCDAT_GIT_TESTDATA_DIR}/data/decreasing_latitude.nc"
299+
)
294300
cdat_add_test(vcs_test_boxfill_10x10_numpy
295301
"${PYTHON_EXECUTABLE}"
296302
${cdat_SOURCE_DIR}/testing/vcs/test_boxfill_10x10_numpy.py
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/usr/bin/env python
2+
import cdms2
3+
import cdutil
4+
import os
5+
import sys
6+
import vcs
7+
8+
pth = os.path.join(os.path.dirname(__file__), "..")
9+
sys.path.append(pth)
10+
import checkimage
11+
12+
f = cdms2.open(sys.argv[2])
13+
ice = f("variable_6")
14+
x = vcs.init()
15+
x.setantialiasing(0)
16+
x.drawlogooff()
17+
x.setbgoutputdimensions(1200, 900, units="pixels")
18+
19+
#gm = x.createisofill()
20+
#gm.label = "y"
21+
gm = x.createboxfill()
22+
gm.boxfill_type = "custom"
23+
24+
tmpl = x.createtemplate()
25+
#tmpl.blank()
26+
tmpl.data.priority = 1
27+
tmpl.data.x1 = .05
28+
tmpl.data.x2 = .95
29+
tmpl.data.y1 = .05
30+
tmpl.data.y2 = .90
31+
tmpl.title.priority = 1
32+
tmpl.box2.priority = 1
33+
tmpl.box2.x1 = .23
34+
tmpl.box2.x2 = .815
35+
tmpl.box2.y1 = .11
36+
tmpl.box2.y2 = .895
37+
tmpl.title.x = .5
38+
tmpl.title.y = .95
39+
40+
tmpl.legend.priority = 1
41+
tmpl.legend.x1 = tmpl.box2.x1 - .05
42+
tmpl.legend.x2 = tmpl.box2.x2 + .05
43+
tmpl.legend.y1 = .03
44+
tmpl.legend.y2 = .055
45+
tmpl.max.priority = 1
46+
47+
#tmpl.crdate.priority=1
48+
#tmpl.crdate.x=.8
49+
#tmpl.crdate.y=.95
50+
txt = x.createtext()
51+
txt.height = 20
52+
#txt.color=242
53+
txt.valign = "half"
54+
txt.halign = "center"
55+
56+
tmpl.title.textorientation = txt.To_name
57+
tmpl.title.texttable = txt.Tt_name
58+
59+
ice.long_name = "September sea ice fraction: 4xCO2 climate, no ocean albedo alteration "
60+
levs = vcs.mkscale(ice.min(), ice.max())
61+
62+
cols = vcs.getcolors(levs)
63+
cols[0] = 240
64+
65+
gm.levels = levs
66+
gm.fillareacolors = cols
67+
#gm.projection="polar"
68+
gm.datawc_y2 = 30
69+
gm.datawc_y1 = 90
70+
71+
x.plot(ice, gm, tmpl, bg = 1)
72+
fnm = "test_boxfill_decreasing_latitude.png"
73+
x.png(fnm)
74+
ret = checkimage.check_result_image(fnm, sys.argv[1], checkimage.defaultThreshold)
75+
sys.exit(ret)
76+

0 commit comments

Comments
 (0)