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

vector type does not work? (2.8.0) #185

Open
jypeter opened this issue Apr 27, 2017 · 0 comments
Open

vector type does not work? (2.8.0) #185

jypeter opened this issue Apr 27, 2017 · 0 comments
Assignees
Milestone

Comments

@jypeter
Copy link
Member

jypeter commented Apr 27, 2017

@doutriaux1 I have used the following script to display (bg=0) and save to png (bg=1 to avoid black png...), and the type parameter does not seem to change anything!

The quality of the png output is also a bit disappointing (to be polite), but I will try to open another issue about it

Script

#!/usr/bin/env python

import cdms2, vcs

f_in = cdms2.open(vcs.sample_data + "/geos5-sample.nc")
uwnd = f_in('uwnd', time=slice(0,1), lev=slice(0,1), squeeze=1)
vwnd = f_in('vwnd', time=slice(0,1), lev=slice(0,1), squeeze=1)
f_in.close()

x = vcs.init()
bg_type = 1

vect_gm = x.createvector()
vect_gm.scale = 10

print 'vect_gm.type', vect_gm.type
x.plot(vect_gm, uwnd[::5, ::5], vwnd[::5, ::5], bg=bg_type)
x.png('vect_arrows')
x.pdf('vect_arrows')

raw_input('Ready for next?')

print 'Trying to change the arrow type...'
x.clear()
vect_gm.type = 'solidarrows'
print 'vect_gm.type', vect_gm.type
x.plot(vect_gm, uwnd[::5, ::5], vwnd[::5, ::5], bg=bg_type)
x.png('vect_solidarrows')
x.pdf('vect_solidarrows')

raw_input('Ready for next?')

print 'Trying to change the arrow type...'
x.clear()
vect_gm.type = 'barbs'
print 'vect_gm.type', vect_gm.type
x.plot(vect_gm, uwnd[::5, ::5], vwnd[::5, ::5], bg=bg_type)
x.png('vect_barbs')
x.pdf('vect_barbs')

# The end

Resulting output and plots

(cdatm14) bash-4.1$ python -i test_vector_type.py
vect_gm.type arrows
Ready for next?
Trying to change the arrow type...
vect_gm.type solidarrows
Ready for next?
Trying to change the arrow type...
vect_gm.type barbs

vect_arrows
vect_solidarrows
vect_barbs

@doutriaux1 doutriaux1 modified the milestone: 3.0 May 5, 2017
@doutriaux1 doutriaux1 modified the milestones: 3.0, Next Release Mar 29, 2018
@doutriaux1 doutriaux1 modified the milestones: 8.1, 8.2 Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants