Skip to content

Commit

Permalink
Merge pull request #1830 from UV-CDAT/wrapping-long-cells
Browse files Browse the repository at this point in the history
Add test for BUG # 1728: wrapping data creates long cells
  • Loading branch information
doutriaux1 committed Feb 18, 2016
2 parents aeed97c + 4873300 commit 6522555
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions testing/vcs/CMakeLists.txt
Expand Up @@ -317,6 +317,11 @@ cdat_add_test(vcs_test_meshfill_no_wrapping
"${BASELINE_DIR}/vcs_test_meshfill_no_wrapping.png"
"${UVCDAT_GIT_TESTDATA_DIR}/data/heat.nc"
)
cdat_add_test(vcs_test_boxfill_robinson_wrap
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/vcs_test_boxfill_robinson_wrap.py
"${BASELINE_DIR}/vcs_test_boxfill_robinson_wrap.png"
)
cdat_add_test(vcs_test_boxfill_10x10_numpy
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_boxfill_10x10_numpy.py
Expand Down
25 changes: 25 additions & 0 deletions testing/vcs/vcs_test_boxfill_robinson_wrap.py
@@ -0,0 +1,25 @@
#!/usr/bin/env python
import cdms2, cdutil, genutil
import vcs,os
import sys

# This tests if extening the longitude to more than 360 decrees is handled correctly by
# proj4. See https://github.com/UV-CDAT/uvcdat/issues/1728 for more information.
pth = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(pth)
import checkimage


cdmsfile = cdms2.open(os.path.join(vcs.sample_data, "clt.nc"))
clt2 = cdmsfile('clt')
clt3 = clt2(latitude=(-90.0, 90.0),squeeze=1,longitude=(-180, 200.0),time=('1979-01', '1988-12'),)
canvas = vcs.init()
gmBoxfill = vcs.getboxfill('a_robinson_boxfill')
kwargs = {}
kwargs[ 'cdmsfile' ] = cdmsfile.id
kwargs['bg'] = 1
canvas.plot(clt3, gmBoxfill, **kwargs)
fnm = "test_robinson_wrap.png"
canvas.png(fnm)
ret = checkimage.check_result_image(fnm, sys.argv[1], checkimage.defaultThreshold)
sys.exit(ret)

0 comments on commit 6522555

Please sign in to comment.