Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix_mercator' into fix_vector_plots
Browse files Browse the repository at this point in the history
Conflicts:
	Packages/vcs/Lib/vcs2vtk.py
  • Loading branch information
aashish24 committed Sep 21, 2015
2 parents 8c4dab2 + 13d242b commit 4e31235
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 43 deletions.
3 changes: 1 addition & 2 deletions CMake/cdat_modules/osmesa_pkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ set(${package_uc}_MAJOR_SRC 7)
set(${package_uc}_MINOR_SRC 6)
set(${package_uc}_PATCH_SRC 1)
set(${package_uc}_VERSION "${${package_uc}_MAJOR_SRC}.${${package_uc}_MINOR_SRC}.${${package_uc}_PATCH_SRC}")
set(${package_uc}_URL
"ftp://ftp.freedesktop.org/pub/mesa/older-versions/${${package_uc}_MAJOR_SRC}.x/${${package_uc}_VERSION}/")
set(${package_uc}_URL ${LLNL_URL})
set(${package_uc}_GZ "MesaLib-${${package_uc}_VERSION}.tar.gz")
set(${package_uc}_MD5 e80fabad2e3eb7990adae773d6aeacba)
set(${package_uc}_SOURCE "${${package_uc}_URL}/${${package_uc}_GZ}")
Expand Down
14 changes: 8 additions & 6 deletions Packages/vcs/Lib/vcs2vtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ def putMaskOnVTKGrid(data, grid, actorColor=None, cellData=True, deep=True):
return mapper


def handleProjectionEdgeCases(projName, data):
def handleProjectionEdgeCases(projection, data):
# For mercator projection, latitude values of -90 or 90
# transformation result in infinity values. We chose -85, 85
# as that's the typical limit used by the community.
if (projName.lower() == "mercator"):

pname = projDict.get(projection._type, projection.type)

if (pname.lower() == "merc"):
lat = data.getLatitude()[:]
# Reverse the latitudes incase the starting latitude is greater
# than the ending one
Expand All @@ -149,9 +152,9 @@ def genGridOnPoints(data1, gm, deep=True, grid=None, geo=None,
xm, xM, ym, yM = None, None, None, None
useStructuredGrid = True

data1 = handleProjectionEdgeCases(projection.name, data1)
data1 = handleProjectionEdgeCases(projection, data1)
if data2 is not None:
data2 = handleProjectionEdgeCases(projection.name, data2)
data2 = handleProjectionEdgeCases(projection, data2)

try:
g = data1.getGrid()
Expand Down Expand Up @@ -246,7 +249,7 @@ def genGrid(data1, data2, gm, deep=True, grid=None, geo=None):
xm, xM, ym, yM = None, None, None, None
projection = vcs.elements["projection"][gm.projection]

data1 = handleProjectionEdgeCases(projection.name, data1)
data1 = handleProjectionEdgeCases(projection, data1)

try: # First try to see if we can get a mesh out of this
g = data1.getGrid()
Expand Down Expand Up @@ -607,7 +610,6 @@ def project(pts, projection, wc, geo=None):
geo.TransformPoints(pts, geopts)
return geo, geopts


def setProjectionParameters(pd, proj):
if proj._type > 200:
proj4 = proj.parameters
Expand Down
53 changes: 25 additions & 28 deletions testing/dv3d/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
set(BASELINE_DIR "${UVCDAT_GIT_TESTDATA_DIR}/baselines/dv3d")

cdat_add_test(Hovmoller_volume_test
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/dv3d/dv3d_execute_test.py
Hovmoller_volume_test
False
${BASELINE_DIR}
)


cdat_add_test(dv3d_vector_test
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/dv3d/dv3d_execute_test.py
Expand All @@ -27,13 +18,31 @@ cdat_add_test(dv3d_slider_test
)


cdat_add_test(dv3d_volume_test
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/dv3d/dv3d_execute_test.py
dv3d_volume_test
False
${BASELINE_DIR}
)
#Mesa driver 7.* as issues with these
if (NOT CDAT_BUILD_OFFSCREEN)
cdat_add_test(Hovmoller_volume_test
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/dv3d/dv3d_execute_test.py
Hovmoller_volume_test
False
${BASELINE_DIR}
)

cdat_add_test(dv3d_volume_test
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/dv3d/dv3d_execute_test.py
dv3d_volume_test
False
${BASELINE_DIR}
)
cdat_add_test(dv3d_constituents_test
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/dv3d/dv3d_execute_test.py
dv3d_constituents_test
False
${BASELINE_DIR}
)
endif()


cdat_add_test(dv3d_surface_test
Expand All @@ -44,22 +53,10 @@ cdat_add_test(dv3d_surface_test
${BASELINE_DIR}
)


cdat_add_test(dv3d_constituents_test
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/dv3d/dv3d_execute_test.py
dv3d_constituents_test
False
${BASELINE_DIR}
)


cdat_add_test(dv3d_hovmoller_test
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/dv3d/dv3d_execute_test.py
dv3d_hovmoller_test
False
${BASELINE_DIR}
)


12 changes: 6 additions & 6 deletions testing/vcs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,6 @@ cdat_add_test(vcs_test_taylor_2_quads
${cdat_SOURCE_DIR}/testing/vcs/test_oned_level_axis.py
"${BASELINE_DIR}/test_oned_level_axis.png"
)
cdat_add_test(vcs_test_patterns
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_patterns.py
"${BASELINE_DIR}/test_vcs_patterns.png"
)
cdat_add_test(vcs_test_first_png_blank
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_first_png_blank.py
Expand Down Expand Up @@ -683,7 +678,7 @@ cdat_add_test(vcs_test_taylor_2_quads
${cdat_SOURCE_DIR}/testing/vcs/test_animate_isoline_colored.py
${BASELINE_DIR}
)
if (NOT EXISTS /etc/redhat-release)
if ( (NOT EXISTS /etc/redhat-release) AND (NOT CDAT_BUILD_OFFSCREEN))
cdat_add_test(vcs_test_animate_isoline_text_labels
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_animate_isoline_text_labels.py
Expand All @@ -694,6 +689,11 @@ cdat_add_test(vcs_test_taylor_2_quads
${cdat_SOURCE_DIR}/testing/vcs/test_animate_isoline_text_labels_colored.py
${BASELINE_DIR}
)
cdat_add_test(vcs_test_patterns
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_patterns.py
"${BASELINE_DIR}/test_vcs_patterns.png"
)
endif()
endif()

Expand Down
5 changes: 4 additions & 1 deletion testing/vcs/test_vcs_mercator_edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
f = cdms2.open(os.path.join(vcs.sample_data, "clt.nc"))
s = f("clt")
x = vcs.init()
x.setantialiasing(0)
x.drawlogooff()
x.setbgoutputdimensions(1200,1091,units="pixels")
iso = x.createisofill()
iso.projection = "mercator"
x.plot(s(latitude=(-90, 90)), iso)
x.plot(s(latitude=(-90, 90)), iso, bg=1)

# Load the image testing module:
testingDir = os.path.join(os.path.dirname(__file__), "..")
Expand Down

0 comments on commit 4e31235

Please sign in to comment.