File: streamribbon_demo1.py

package info (click to toggle)
scitools 0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 17,252 kB
  • ctags: 2,871
  • sloc: python: 28,744; sh: 112; makefile: 15
file content (48 lines) | stat: -rwxr-xr-x 1,128 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python

# Example taken from:
# http://www.mathworks.com/access/helpdesk/help/techdoc/ref/streamribbon.html

from scitools.easyviz import *
from time import sleep
from scipy import io

wind = io.loadmat('wind_matlab_v6.mat')
x = wind['x']
y = wind['y']
z = wind['z']
u = wind['u']
v = wind['v']
w = wind['w']

setp(show=False)
sx,sy,sz = ndgrid([80]*4,seq(20,50,10),seq(0,15,5),sparse=False)
streamribbon(x,y,z,u,v,w,sx,sy,sz,ribbonwidth=5)
view(3)
daspect([1,1,1])
axis('tight')
shading('interp')
#camlight(); lighting('gouraud')
setp(show=True)
show()
#sleep(3)

#hardcopy('tmp_streamribbon1a_hq.eps')
#hardcopy('tmp_streamribbon1a_lq.eps', vector_file=False)
#hardcopy('tmp_streamribbon1a.png')

figure()
# alternative syntax:
streamribbon(x,y,z,u,v,w,sx,sy,sz,
             daspect=[1,1,1],
             view=3,
             axis='tight',
             shading='interp',
             camlight='right',
             lighting='gouraud')

raw_input('Press Return key to quit: ')

#hardcopy('tmp_streamribbon1b_hq.eps')
#hardcopy('tmp_streamribbon1b_lq.eps', vector_file=False)
#hardcopy('tmp_streamribbon1b.png')