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 1133 lon labels freaks out #1172

Merged
merged 4 commits into from
Mar 26, 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/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ def drawTicks(self,slab,gm,x,axis,number,vp,wc,bg=0,X=None,Y=None,**kargs):
for t in loc.keys():
loc[t]=''
if isinstance(loc,str):
loc = vcs.elements["list"].get(loc,{})
loc = copy.copy(vcs.elements["list"].get(loc,{}))
# Make sure the label passed are not outside the world coordinates
dw1=1.E20
dw2=1.E20
Expand Down
9 changes: 7 additions & 2 deletions testing/vcs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,21 @@ cdat_add_test(vcs_test_taylor_2_quads
cdat_add_test(vcs_test_1d_marker_not_shown_if_xaxis_flipped
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_1d_marker_not_shown_if_xaxis_flipped.py
${BASELINE_DIR}/test_1d_marker_not_shown_if_xaxis_flipped.png
"${BASELINE_DIR}/test_1d_marker_not_shown_if_xaxis_flipped.png"
)


# These test actually plot things need sample data
if (CDAT_DOWNLOAD_SAMPLE_DATA)
cdat_add_test(test_vcs_lon_axes_freak_out
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_lon_axes_freak_out.py
"${BASELINE_DIR}/test_lon_axes_freak_out.png"
)
cdat_add_test(test_vcs_isofill_mask_cell_shift
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_isofill_mask_cell_shift.py
${BASELINE_DIR}/test_vcs_isofill_mask_cell_shift.png
"${BASELINE_DIR}/test_vcs_isofill_mask_cell_shift.png"
)
cdat_add_test(vcs_test_bad_time_units
"${PYTHON_EXECUTABLE}"
Expand Down
29 changes: 29 additions & 0 deletions testing/vcs/test_lon_axes_freak_out.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os,sys,vcs,cdms2
src=sys.argv[1]
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")
s3=f("clt",longitude=(0,360))

print s.shape,s3.shape


x=vcs.init()
x.drawlogooff()
x.setbgoutputdimensions(1200,1091,units="pixels")

x.plot(s,bg=1)
x.clear()
x.plot(s3,bg=1)

fnm = "test_lon_axes_freak_out.png"

x.png(fnm)
print "fnm:",fnm
print "src:",src
ret = checkimage.check_result_image(fnm,src,checkimage.defaultThreshold)
sys.exit(ret)